/* ===========================================================================
 * goform — design system
 * Light + dark themes, mobile-first, accessible, modern
 * ===========================================================================*/

:root {
  /* Light theme */
  --bg: #f8f8f7;
  --bg-2: #f1f1f0;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;
  --surface-hover: #f4f4f5;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --border-focus: #6366f1;

  --text: #0a0a0a;
  --text-2: #525252;
  --text-3: #a3a3a3;
  --text-on-brand: #ffffff;

  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-soft: #eef2ff;
  --brand-strong: #4f46e5;
  --accent: #f59e0b;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #ca8a04;
  --warning-soft: #fefce8;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
  --shadow-brand: 0 8px 24px rgba(99, 102, 241, 0.24);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.16);
  --ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.16);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --t: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);

  --nav-height: 56px;
  --sidebar-w: 280px;
  --inspector-w: 320px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-2: #050505;
    --surface: #121212;
    --surface-2: #171717;
    --surface-3: #1f1f1f;
    --surface-hover: #1c1c1c;
    --border: #262626;
    --border-strong: #404040;

    --text: #fafafa;
    --text-2: #a1a1aa;
    --text-3: #71717a;

    --brand: #818cf8;
    --brand-2: #a78bfa;
    --brand-soft: #1e1b4b;
    --brand-strong: #6366f1;
    --accent: #fbbf24;

    --danger: #ef4444;
    --danger-soft: #450a0a;
    --success: #22c55e;
    --success-soft: #052e16;
    --warning: #eab308;
    --warning-soft: #422006;
    --info: #38bdf8;
    --info-soft: #082f49;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.6);
    --shadow-brand: 0 8px 24px rgba(129, 140, 248, 0.32);
    --ring: 0 0 0 3px rgba(129, 140, 248, 0.24);
  }
}

[data-theme="light"] {
  --bg: #f8f8f7; --bg-2: #f1f1f0; --surface: #ffffff; --surface-2: #fafafa;
  --surface-3: #f4f4f5; --surface-hover: #f4f4f5; --border: #e7e5e4;
  --border-strong: #d6d3d1; --text: #0a0a0a; --text-2: #525252; --text-3: #a3a3a3;
  --brand: #6366f1; --brand-soft: #eef2ff;
}
[data-theme="dark"] {
  --bg: #0a0a0a; --bg-2: #050505; --surface: #121212; --surface-2: #171717;
  --surface-3: #1f1f1f; --surface-hover: #1c1c1c; --border: #262626;
  --border-strong: #404040; --text: #fafafa; --text-2: #a1a1aa; --text-3: #71717a;
  --brand: #818cf8; --brand-soft: #1e1b4b;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
  text-align: left;
}
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; }
img, svg { display: block; }

/* ===== Top Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}
.brand-wordmark { font-weight: 600; }

.nav-spacer { flex: 1; }
.nav-actions { display: flex; gap: 6px; align-items: center; }
.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.user-menu {
  position: relative;
}
.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  transition: background var(--t);
}
.user-trigger:hover { background: var(--surface-2); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
@media (max-width: 600px) { .user-name { display: none; } }

.user-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 4px;
  display: none;
  animation: popIn 160ms var(--t);
  z-index: 60;
}
.user-menu-pop.open { display: block; }
.user-menu-pop .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  cursor: pointer;
  color: var(--text);
  transition: background var(--t);
}
.user-menu-pop .item:hover { background: var(--surface-2); }
.user-menu-pop .item.danger { color: var(--danger); }
.user-menu-pop .item.danger:hover { background: var(--danger-soft); }
.user-menu-pop .head {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-menu-pop .head .who { font-weight: 600; font-size: 13px; }
.user-menu-pop .head .em { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all var(--t);
  white-space: nowrap;
  user-select: none;
  position: relative;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn .ic { width: 14px; height: 14px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: white;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-strong), var(--brand-strong));
  border-color: transparent;
}
.btn-primary:focus-visible { box-shadow: var(--ring); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }

.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger.btn-primary { background: var(--danger); color: white; border-color: transparent; }

.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-sm.btn-icon { width: 28px; height: 28px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }

.btn[disabled], .btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Form controls ===== */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color var(--t), box-shadow var(--t);
  color: var(--text);
}
.input:hover, .textarea:hover, .select:hover {
  border-color: var(--border-strong);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.input.error, .textarea.error, .select.error {
  border-color: var(--danger);
}
.input.error:focus { box-shadow: var(--ring-danger); }

.textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.field-hint {
  font-size: 12px;
  color: var(--text-2);
}
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* ===== Cards & Layout ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-header {
  padding: 20px 20px 0;
}
.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-header p {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 4px;
}
.card-body { padding: 16px 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== Auth pages (login/setup/change-password) ===== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.05), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-brand .logo { width: 48px; height: 48px; border-radius: 12px; }
.auth-brand .name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-card h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  text-align: center;
}
.auth-card .sub {
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  margin-bottom: 24px;
}
.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.auth-footer {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 18px;
}

/* ===== Page layout ===== */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
@media (max-width: 640px) { .page { padding: 24px 16px 60px; } }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.page-header p { color: var(--text-2); margin-top: 4px; font-size: 14px; }

/* ===== Dashboard ===== */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all var(--t);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 150px;
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(99,102,241,0.04), transparent);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.form-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.form-card:hover::before { opacity: 1; }
.form-card-title {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.form-card-desc {
  color: var(--text-2);
  font-size: 13px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.form-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: auto;
}
.form-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t);
}
.form-card:hover .form-card-actions,
.form-card:focus-within .form-card-actions { opacity: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.badge.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.badge.live { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent);
}
.badge.paused { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.admin { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-2) 20%, transparent)); color: var(--brand-strong); border-color: transparent; }

/* ===== Empty state ===== */
.empty {
  text-align: center;
  padding: 80px 20px;
}
.empty .empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-3);
}
.empty h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 13px; margin-bottom: 18px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ===== Form Builder ===== */
.builder {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--inspector-w);
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}
.builder-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 16px 12px;
}
.builder-canvas {
  overflow-y: auto;
  background: var(--bg);
  padding: 40px 24px;
}
.builder-inspector {
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 18px;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 8px;
  padding: 0 6px;
}

/* Field type palette */
.field-type {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: grab;
  border: 1px solid transparent;
  transition: all var(--t);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  user-select: none;
  color: var(--text);
}
.field-type:hover {
  background: var(--surface-2);
  border-color: var(--border);
  transform: translateX(2px);
}
.field-type:active { cursor: grabbing; }
.field-type .ic-wrap {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all var(--t);
}
.field-type:hover .ic-wrap {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Canvas */
.form-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.form-meta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--form-gradient, linear-gradient(90deg, var(--brand), var(--brand-2)));
}
.form-meta-title {
  width: 100%;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  margin-bottom: 6px;
  color: var(--text);
}
.form-meta-title:focus { border-bottom-color: var(--brand); }
.form-meta-title::placeholder { color: var(--text-3); }

.form-meta-desc {
  width: 100%;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-2);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  resize: none;
  min-height: 24px;
  line-height: 1.55;
}
.form-meta-desc:focus { border-bottom-color: var(--brand); }

/* Field item */
.field-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: all var(--t);
  cursor: pointer;
}
.field-item:hover { border-color: var(--border-strong); }
.field-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-sm);
}
.field-item.selected::before {
  content: '';
  position: absolute;
  left: -1px; top: 24px; bottom: 24px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.field-item.dragging { opacity: 0.4; }

.field-item .drag-handle {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--t);
  border-radius: 6px;
}
.field-item:hover .drag-handle,
.field-item.selected .drag-handle { opacity: 1; }
.field-item .drag-handle:hover { background: var(--surface-2); color: var(--text); }
.field-item .drag-handle:active { cursor: grabbing; }

.field-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.field-label-input {
  flex: 1;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  color: var(--text);
  min-width: 0;
}
.field-label-input:focus { border-bottom-color: var(--brand); }
.field-label-input::placeholder { color: var(--text-3); font-weight: 400; }
.field-required-mark { color: var(--danger); margin-left: 2px; }
.field-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t);
}
.field-item:hover .field-actions,
.field-item.selected .field-actions,
.field-item:focus-within .field-actions { opacity: 1; }

.field-description-input {
  width: 100%;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-2);
  padding: 0 0 8px;
  resize: none;
  line-height: 1.55;
}
.field-description-input::placeholder { color: var(--text-3); }

.field-preview {
  margin-top: 8px;
  pointer-events: none;
  opacity: 0.95;
}

.drop-indicator {
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  margin: 4px 0;
  position: relative;
  opacity: 0;
  transition: opacity 100ms;
}
.drop-indicator.active { opacity: 1; }
.drop-indicator::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* Choices */
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.choice-row > span { font-size: 14px; color: var(--text); }
.choice-row input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
}
.choice-row input[type="text"]:focus { border-bottom-color: var(--brand); }
.choice-row .remove {
  opacity: 0; transition: opacity var(--t);
  color: var(--text-3);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
}
.choice-row:hover .remove { opacity: 1; }
.choice-row .remove:hover { color: var(--danger); background: var(--danger-soft); }

.choice-marker {
  width: 16px; height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
}
.choice-marker.checkbox { border-radius: 4px; }

.add-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--t);
  background: none;
  border: none;
}
.add-choice:hover { color: var(--brand); }
.add-choice:hover .choice-marker { border-color: var(--brand); }
.add-choice .choice-marker { background: var(--surface-2); }

/* Rating */
.rating { display: flex; gap: 4px; pointer-events: auto; }
.field-preview .rating { pointer-events: none; }
.rating .star {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--t);
}
.rating .star:hover { color: var(--accent); transform: scale(1.1); }
.rating .star.active { color: var(--accent); }
.rating .star.active svg { fill: currentColor; }

/* Scale */
.scale { display: grid; gap: 6px; margin-top: 4px; }
.scale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
}
.scale-buttons {
  display: flex;
  gap: 4px;
}
.scale-btn {
  flex: 1;
  padding: 9px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--t);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  min-width: 32px;
}
.scale-btn:hover { border-color: var(--brand); color: var(--brand); }
.scale-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

/* Inspector */
.inspector-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-3);
  font-size: 13px;
}
.inspector-empty svg {
  margin: 0 auto 12px;
  opacity: 0.4;
}

.insp-group { margin-bottom: 16px; }
.insp-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  display: block;
}
.insp-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
}
.insp-input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.insp-input[type="range"] {
  padding: 0;
  background: transparent;
  border: none;
}

.insp-divider {
  height: 1px;
  background: var(--border);
  margin: 16px -18px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  gap: 12px;
}
.toggle-text { flex: 1; min-width: 0; }
.toggle-label { font-size: 13px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.toggle-switch {
  position: relative;
  width: 34px;
  height: 20px;
  background: var(--surface-3);
  border-radius: 999px;
  transition: background var(--t);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle-row input { display: none; }
.toggle-row input:checked + .toggle-switch {
  background: var(--brand);
  border-color: var(--brand);
}
.toggle-row input:checked + .toggle-switch::after { transform: translateX(14px); }

/* ===== Form View (public filling) ===== */
.view-body {
  background: var(--bg);
}
.view-page {
  min-height: 100vh;
  padding: 32px 16px 20px;
  background:
    radial-gradient(ellipse 800px 400px at 50% 0%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 60%),
    var(--bg);
}
@media (min-width: 640px) { .view-page { padding: 48px 24px 24px; } }

.view-container {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.view-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.view-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--form-gradient, linear-gradient(90deg, var(--brand), var(--brand-2)));
}
.view-header h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.25;
}
@media (max-width: 640px) {
  .view-header { padding: 26px 22px 22px; }
  .view-header h1 { font-size: 22px; }
}
.view-header p {
  color: var(--text-2);
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
}

.view-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color var(--t), box-shadow var(--t);
}
.view-field:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.view-field.error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 40%, var(--surface));
}
@media (max-width: 640px) {
  .view-field { padding: 18px 18px; }
}
.view-field-label {
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 4px;
  display: block;
  color: var(--text);
  line-height: 1.4;
}
.view-field-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
  line-height: 1.55;
}
.view-field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 4px 0;
}

.success-page, .closed-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.success-page .icon-wrap {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}
.success-page h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.success-page p {
  color: var(--text-2);
  margin-bottom: 20px;
  line-height: 1.55;
}

/* Public form: form-themed override for view-header gradient bar */
.form-themed .view-header::before,
.form-themed .form-meta::before {
  background: var(--form-gradient, linear-gradient(90deg, var(--brand), var(--brand-2)));
}

/* Larger touch targets on the public view */
.view-field .choices .choice-row {
  padding: 8px 0;
}
.view-field .input,
.view-field .textarea,
.view-field .select {
  padding: 12px 14px;
  font-size: 15px;
}
.view-field .scale-btn {
  padding: 12px 6px;
  font-size: 14px;
}
.view-field .rating .star {
  width: 36px; height: 36px;
}

.poweredby {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 24px;
  padding: 16px;
}
.poweredby a {
  color: var(--text-2);
  font-weight: 500;
  transition: color var(--t);
}
.poweredby a:hover { color: var(--brand); }
.poweredby .pb-logo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.poweredby .pb-logo svg {
  width: 14px; height: 14px;
  vertical-align: middle;
}

/* ===== Responses page ===== */
.resp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .label { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.stat-card .delta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
  background: none;
  transition: color var(--t);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.resp-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.resp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.resp-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
}
.resp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.resp-table tr:last-child td { border-bottom: none; }
.resp-table tr:hover td { background: var(--surface-2); }

.summary-grid {
  display: grid;
  gap: 14px;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.summary-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.summary-card .total { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.bar-label { flex: 0 0 30%; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-value { color: var(--text-3); font-size: 12px; min-width: 48px; text-align: right; }

/* ===== Settings ===== */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav button {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: all var(--t);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button.active { background: var(--brand-soft); color: var(--brand); }

.user-list, .token-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.user-row, .token-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}
.user-row:last-child, .token-row:last-child { border-bottom: none; }
.user-row:hover, .token-row:hover { background: var(--surface-2); }
.user-row .info, .token-row .info { flex: 1; min-width: 0; }
.user-row .name, .token-row .name {
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-row .email, .token-row .meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  word-break: break-all;
  position: relative;
  color: var(--text);
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fadeIn 160ms var(--t);
  padding: 16px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms var(--t);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.modal.lg { max-width: 600px; }
.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-header h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-header p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all var(--t);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 16px 24px; }
.modal-footer {
  padding: 14px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toastIn 200ms, toastOut 200ms 2.6s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }

/* ===== Theme toggle ===== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  gap: 2px;
}
.theme-toggle button {
  width: 24px; height: 24px;
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all var(--t);
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button.active {
  background: var(--surface-2);
  color: var(--text);
}

/* ===== Utility ===== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  display: inline-block;
  opacity: 0.6;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
.center { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); }

.text-muted { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-small { font-size: 12px; }
.text-mono { font-family: var(--font-mono); }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.flex-1 { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hidden { display: none !important; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

/* ===== Animations ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; --inspector-w: 280px; }
}
@media (max-width: 800px) {
  :root { --nav-height: 52px; }
  .builder {
    grid-template-columns: 1fr;
    position: relative;
  }
  .builder-sidebar, .builder-inspector {
    position: fixed;
    top: var(--nav-height);
    bottom: 0;
    width: 280px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform var(--t-slow);
    box-shadow: var(--shadow-lg);
  }
  .builder-inspector { right: 0; left: auto; transform: translateX(100%); }
  .builder-sidebar.open, .builder-inspector.open { transform: translateX(0); }
  .builder-canvas { padding: 24px 16px; }
  .form-meta { padding: 20px; }
  .form-meta-title { font-size: 22px; }
  .field-item { padding: 16px; }
  .field-item .drag-handle { display: none; }
  .mobile-toolbar {
    display: flex !important;
    position: sticky;
    top: var(--nav-height);
    z-index: 20;
    padding: 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 8px;
  }
}
.mobile-toolbar { display: none; }

@media (max-width: 640px) {
  .nav { padding: 0 14px; gap: 8px; }
  .auth-card { padding: 24px; }
  .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  .modal-footer .btn { width: 100%; }
}

/* ===== Focus visible only when keyboard nav ===== */
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== Password input with eye toggle ===== */
.input-wrap {
  position: relative;
}
.input-wrap > .input {
  padding-right: 38px;
}
.input-action {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: all var(--t);
  background: transparent;
  border: none;
  cursor: pointer;
}
.input-action:hover { color: var(--text); background: var(--surface-2); }

/* ===== Nav theme switch ===== */
.theme-switch {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.theme-switch button {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: all var(--t);
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ===== Form theme colors ===== */
.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.theme-color-swatch {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: transform var(--t);
  border: 2px solid transparent;
}
.theme-color-swatch:hover { transform: scale(1.05); }
.theme-color-swatch.active {
  border-color: var(--text);
  outline: 2px solid var(--surface);
  outline-offset: -4px;
}
.theme-color-swatch.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 50%;
  background-position: center;
  background-repeat: no-repeat;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.icon-picker-grid button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--t);
  font-size: 18px;
}
.icon-picker-grid button:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.icon-picker-grid button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

/* ===== Template chooser ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.template-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.template-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
  margin-bottom: 4px;
}
.template-card-title { font-weight: 600; font-size: 14px; }
.template-card-desc { color: var(--text-2); font-size: 12px; line-height: 1.5; flex: 1; }
.template-card-meta { color: var(--text-3); font-size: 11px; margin-top: 4px; }

/* ===== Notification settings ===== */
.notif-channel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color var(--t);
}
.notif-channel.enabled { border-color: var(--brand); }
.notif-channel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.notif-channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notif-channel-icon.discord { background: #5865F2; color: white; }
.notif-channel-icon.telegram { background: #0088CC; color: white; }
.notif-channel-icon.email { background: var(--brand); color: white; }
.notif-channel-body {
  display: none;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.notif-channel.enabled .notif-channel-body { display: block; }

.test-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all var(--t);
}
.test-btn:hover { background: var(--surface-3); color: var(--text); }

/* ===== Form themed view (public form) ===== */
.form-themed .form-meta::before,
.form-themed .view-header::before {
  background: var(--form-gradient, linear-gradient(90deg, var(--brand), var(--brand-2)));
}
.form-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: white;
  margin-bottom: 14px;
  background: var(--form-gradient, linear-gradient(135deg, var(--brand), var(--brand-2)));
  box-shadow: var(--shadow-brand);
}

/* utility */
.hide-sm { display: inline; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
}
