/* ════════════════════════════════════════════════════════════
   AUTH FLOW — faithful vanilla port of the React 5-step signup.
   Everything scoped under #authScreen so the light/indigo/Garet
   styling is isolated from the (dark, orange) app and never
   collides with the app's generic .field/.input/.divider classes.
   ════════════════════════════════════════════════════════════ */
@import url('https://fonts.cdnfonts.com/css/garet');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

#authScreen {
  position: fixed;
  inset: 0;
  z-index: 60;
  /* — design tokens (light/indigo) — */
  --bg:        #FAFAF7;
  --bg-2:      #F4F4EF;
  --surface:   #FFFFFF;
  --surface-2: #F7F7F2;
  --surface-3: #EFEFE8;
  --hairline:  #E8E8E1;
  --hairline-2:#DCDCD2;
  --ink:       #18181B;
  --muted:     #82828B;
  --dim:       #B6B6AE;
  --accent:    #FF3503;
  --accent-soft:   rgba(255,53,3,.10);
  --accent-border: rgba(255,53,3,.28);
  --accent-hi:     #ff5a30;
  --font-display: "Garet", "Helvetica Neue", Arial, sans-serif;
  --font-sans:    "Garet", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  font-family: var(--font-sans);
  color: var(--ink);
}
#authScreen * { box-sizing: border-box; }
#authScreen button { font-family: inherit; border: none; background: none; cursor: pointer; }

#authScreen .auth-stage {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

#authScreen .auth-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7);
  position: relative;
}
#authScreen .auth-brand {
  position: absolute;
  top: var(--s-5);
  left: var(--s-5);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
#authScreen .ws-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}
#authScreen .auth-brand .dim { color: var(--muted); font-weight: 400; }

#authScreen .auth-card { width: 100%; max-width: 420px; min-height: 480px; display: flex; flex-direction: column; }

#authScreen .auth-step {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: var(--s-2);
  display: flex; align-items: center; gap: 10px;
}
#authScreen .auth-progress {
  flex: 1; height: 2px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
}
#authScreen .auth-progress > i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }

#authScreen .auth-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px; font-weight: 400;
  letter-spacing: -0.02em; color: var(--ink);
}
#authScreen .auth-card .lede {
  margin: var(--s-2) 0 var(--s-5);
  color: var(--muted); font-size: 13px; line-height: 1.55;
}

#authScreen .tab-pill {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 100px; padding: 3px; margin-bottom: var(--s-4);
}
#authScreen .tab-pill button {
  height: 32px; font-size: 12.5px; font-weight: 500;
  color: var(--muted); border-radius: 100px; transition: all .15s ease;
}
#authScreen .tab-pill button.on { background: var(--accent); color: #fff; }

#authScreen .field { margin-bottom: var(--s-3); }
#authScreen .field label {
  display: block; font-size: 11.5px; font-weight: 500;
  color: var(--muted); margin-bottom: var(--s-1);
}
#authScreen .field label .opt { color: var(--dim); }
#authScreen .input {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--surface); border: 1.5px solid rgba(24,24,27,.22);
  border-radius: 10px; color: var(--ink); font-size: 13.5px;
  font-family: var(--font-sans);
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(24,24,27,.04);
}
#authScreen .input:hover { border-color: rgba(24,24,27,.36); }
#authScreen .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#authScreen .input::placeholder { color: var(--dim); }

#authScreen .btn-block {
  width: 100%; height: 44px; border-radius: 100px;
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
#authScreen .btn-block.solid { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
#authScreen .btn-block.solid:hover { background: var(--accent-hi); }
#authScreen .btn-block.solid:disabled { opacity: .6; cursor: default; }
#authScreen .btn-block.outline { background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); }
#authScreen .btn-block.outline:hover { background: var(--surface-2); border-color: var(--ink); }

#authScreen .divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 11px; margin: var(--s-3) 0;
}
#authScreen .divider::before, #authScreen .divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

@keyframes auth-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
#authScreen .auth-anim { animation: auth-enter .22s cubic-bezier(.16,1,.3,1); }

#authScreen .auth-invite {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft, rgba(79,70,229,.08));
  border: 1px solid var(--accent-border, rgba(79,70,229,.22));
  color: var(--accent);
  border-radius: 10px; padding: 10px 13px; margin-bottom: 16px;
  font-size: 13px; font-weight: 500;
}
#authScreen .auth-invite::before { content: "✦"; font-size: 13px; }
#authScreen .auth-invite strong { color: var(--ink); font-weight: 700; }

#authScreen .auth-err {
  display: flex; align-items: flex-start; gap: 8px;
  color: #b42318; background: #fef3f2; border: 1px solid #fecdca;
  border-radius: 9px; padding: 10px 12px; margin: 2px 0 14px;
  font-size: 12.5px; line-height: 1.45; font-weight: 500;
}
#authScreen .auth-err::before { content: "!"; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: #d92d20; color: #fff; font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
#authScreen .auth-row {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
#authScreen .auth-remember {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); cursor: pointer; user-select: none;
}
#authScreen .auth-remember input { accent-color: var(--accent); width: 14px; height: 14px; }
#authScreen .text-link { font-size: 12px; color: var(--ink); cursor: pointer; }
#authScreen .text-link:hover { text-decoration: underline; }

#authScreen .auth-footer {
  margin-top: var(--s-4); font-size: 12px; color: var(--muted); text-align: center;
}
#authScreen .auth-footer a { color: var(--ink); font-weight: 500; cursor: pointer; border-bottom: 1px solid var(--hairline-2); }

#authScreen .gbtn-wrap { display: flex; justify-content: center; min-height: 40px; margin-top: 4px; }

/* ── Right preview panel ── */
#authScreen .auth-right {
  background: var(--bg-2); border-left: 1px solid var(--hairline);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; padding: var(--s-7);
}
#authScreen .auth-r-copy { max-width: 480px; margin-top: var(--s-7); }
#authScreen .auth-r-copy h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 30px; font-weight: 400; letter-spacing: -0.015em; color: var(--ink);
}
#authScreen .auth-r-copy p { margin: var(--s-2) 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

#authScreen .preview-frame {
  margin-top: var(--s-6); flex: 1; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 10px 10px 0 0;
  overflow: hidden; position: relative; min-height: 0;
}
#authScreen .pf-bar {
  height: 32px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--surface-2);
}
#authScreen .pf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
#authScreen .pf-url { flex: 1; text-align: right; font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
#authScreen .pf-body { padding: var(--s-4); display: grid; grid-template-columns: 80px 1fr; gap: var(--s-3); height: calc(100% - 32px); }
#authScreen .pf-side { display: flex; flex-direction: column; gap: 6px; }
#authScreen .skel { background: var(--surface-2); border-radius: 4px; height: 8px; }
#authScreen .skel.lg { height: 12px; }
#authScreen .skel.sq { height: 48px; border-radius: 6px; }
#authScreen .skel.dim { background: var(--surface-3); }
#authScreen .pf-main { display: flex; flex-direction: column; gap: 10px; }
#authScreen .pf-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* ── Responsive: hide the preview on narrow screens ── */
@media (max-width: 860px) {
  #authScreen .auth-stage { grid-template-columns: 1fr; }
  #authScreen .auth-right { display: none; }
}
