/* Shared styling for signup/login/workspace pages.
   Reuses the design tokens from the dashboard so the visual rhythm carries through. */

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;
  --bg-app: #08080b;
  --bg-card: #111116;
  --bg-card-hover: #16161d;
  --bg-input: #0a0a10;
  --bg-elevated: #181820;
  --border-subtle: #1f1f27;
  --border-default: #2a2a34;
  --text-primary: #f1f1f4;
  --text-secondary: #b1b1bc;
  --text-muted: #7e7e8a;
  --text-faint: #54545e;
  --good: #4ade80;
  --warn: #f5b544;
  --bad: #ef6b6f;
  --accent: #7c8cff;
  --accent-soft: #2a2f55;
  --good-bg: rgba(74,222,128,.10);
  --warn-bg: rgba(245,181,68,.10);
  --bad-bg: rgba(239,107,111,.10);
  --accent-bg: rgba(124,140,255,.08);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 36px rgba(0,0,0,.55);
  --motion-fast: 120ms ease;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-app); color: var(--text-primary);
  min-height: 100vh; font-feature-settings: 'ss01','cv11';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  line-height: 1.5;
  background-image:
    radial-gradient(900px 400px at 50% -100px, rgba(124,140,255,0.12), transparent 60%),
    radial-gradient(700px 300px at 10% 30%, rgba(124,140,255,0.04), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--bg-input); padding: 1px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px;
  color: var(--text-primary);
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; max-width: 480px; margin: 0 auto;
  padding: var(--s-7) var(--s-5);
  display: flex; flex-direction: column; align-items: center;
}
.workspace-wrap { max-width: 760px; }

/* ── Brand ───────────────────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-7); color: var(--text-primary) !important;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #5762cc 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 15px; letter-spacing: -.02em;
  box-shadow: 0 2px 8px rgba(124,140,255,0.3);
}
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }

/* ── Workspace bar ───────────────────────────────────────────────────── */
.workspace-bar {
  width: 100%; display: flex; align-items: center; gap: var(--s-3);
  padding: 0 0 var(--s-6); border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s-6);
}
.workspace-bar .brand { margin-bottom: 0; }
.workspace-bar .meta { font-size: 12px; color: var(--text-muted); }
.workspace-bar .btn-ghost {
  padding: 6px 12px; font-size: 12px; font-weight: 550;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border-default); border-radius: var(--r-sm);
  cursor: pointer; font-family: inherit;
}
.workspace-bar .btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ── Card ────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: var(--r-lg);
  padding: var(--s-7);
  box-shadow: var(--shadow-md);
}
.auth-card.centered { text-align: center; }
.welcome-card {
  width: 100%; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-7); margin-bottom: var(--s-4);
}

h1 {
  font-size: 24px; font-weight: 650; letter-spacing: -.015em;
  line-height: 1.2; margin-bottom: var(--s-2);
}
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.lead {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6;
  margin-bottom: var(--s-5);
}
.meta { color: var(--text-muted); font-size: 11.5px; font-weight: 400; }

/* ── Form ────────────────────────────────────────────────────────────── */
form { display: flex; flex-direction: column; gap: var(--s-4); }
label {
  display: flex; flex-direction: column; gap: var(--s-1);
  font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .04em;
}
label .meta {
  text-transform: none; letter-spacing: normal; font-weight: 400;
  font-size: 11px; margin-left: var(--s-2);
}
input[type=text], input[type=email], select {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border-default); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 13.5px; color: var(--text-primary);
  font-family: inherit; font-weight: 500;
  transition: border-color var(--motion-fast);
}
input[type=text]:focus, input[type=email]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,140,255,0.15);
}
input::placeholder { color: var(--text-faint); }
.row { display: flex; gap: var(--s-3); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--accent); color: white;
  border: 1px solid var(--accent); cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--motion-fast); text-decoration: none;
  box-shadow: 0 2px 8px rgba(124,140,255,0.2);
}
.btn-primary:hover { background: #8b9aff; text-decoration: none; }
.btn-primary:disabled { background: var(--border-default); border-color: var(--border-default); cursor: not-allowed; opacity: 0.6; box-shadow: none; }
.btn-ghost {
  padding: 10px 16px; border-radius: var(--r-sm);
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-default); cursor: pointer;
  font-size: 13px; font-weight: 550; font-family: inherit;
  transition: all var(--motion-fast); text-decoration: none;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* ── Error / success ─────────────────────────────────────────────────── */
.error-box {
  background: var(--bad-bg); border: 1px solid rgba(239,107,111,.3);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 13px; color: var(--bad); line-height: 1.5;
}
.success-icon {
  width: 56px; height: 56px; margin: 0 auto var(--s-5);
  border-radius: var(--r-full); background: var(--good-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--good); font-weight: 700;
}
.info-box {
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--r-sm); padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0;
}
.info-box-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: var(--s-3);
}
.info-box ol {
  padding-left: var(--s-5); color: var(--text-secondary);
  font-size: 13px; line-height: 1.7;
}
.fine-print {
  font-size: 12px; color: var(--text-muted); margin-top: var(--s-3);
  line-height: 1.6; text-align: center;
}
.auth-footer {
  margin-top: var(--s-7); font-size: 12px; color: var(--text-muted);
  text-align: center; display: flex; gap: var(--s-3); align-items: center;
}

/* ── Welcome / checklist ─────────────────────────────────────────────── */
.welcome-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: var(--s-2);
}
.welcome-headline {
  font-size: 28px; font-weight: 650; letter-spacing: -.018em;
  line-height: 1.15; margin-bottom: var(--s-2);
}
.checklist { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-5); }
.checklist-item {
  display: flex; gap: var(--s-4); align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: border-color var(--motion-fast);
}
.checklist-item:hover:not(.disabled):not(.done) { border-color: var(--accent); }
.checklist-item.disabled { opacity: 0.55; }
.checklist-item.done { border-color: rgba(74,222,128,0.25); }
.checklist-num {
  width: 26px; height: 26px; border-radius: var(--r-full);
  background: var(--accent-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.checklist-item.done .checklist-num { background: var(--good-bg); color: var(--good); }
.checklist-body { flex: 1; }
.checklist-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.checklist-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.checklist-action { flex-shrink: 0; }
.checklist-action .btn-primary { padding: 7px 14px; font-size: 12.5px; }

/* ── Key-value table ─────────────────────────────────────────────────── */
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table td {
  padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border-subtle);
}
.kv-table tr:last-child td { border-bottom: 0; }
.kv-table td:first-child { color: var(--text-muted); width: 40%; font-weight: 500; }
.kv-table td:last-child { color: var(--text-primary); font-weight: 550; }

/* ── Modal (reused for Shopify connect) ──────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
}
.modal-bg[hidden] { display: none; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-default);
  border-radius: var(--r-lg); padding: var(--s-6);
  max-width: 480px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 16px; font-weight: 650; margin-bottom: var(--s-2); }

/* ── Advanced details (signup form collapsible) ──────────────────────── */
.advanced-details {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--s-3); margin-top: var(--s-2);
}
.advanced-details summary {
  list-style: none; cursor: pointer; font-size: 12px; color: var(--text-muted);
  font-weight: 550; display: inline-flex; align-items: center; gap: 6px;
  transition: color var(--motion-fast);
}
.advanced-details summary::-webkit-details-marker { display: none; }
.advanced-details summary::before {
  content: '+'; color: var(--text-faint); font-size: 14px; font-weight: 400;
  transition: transform var(--motion-fast);
}
.advanced-details[open] summary::before { transform: rotate(45deg); }
.advanced-details summary:hover { color: var(--text-secondary); }

/* Focus states (a11y) */
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
  border-radius: var(--r-sm);
}
