:root {
  --bg: var(--brand-plum);
  --surface: rgba(24, 24, 27, 0.72);
  --border: var(--brand-border);
  --border-strong: var(--brand-border-strong);
  --text: #fafafa;
  --muted: #a1a1aa;
  --primary: var(--brand-violet);
  --primary-2: var(--brand-pink);
  --danger: #f87171;
  --success: #34d399;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--brand-tint); text-decoration: none; font-weight: 600; }
a:hover { color: var(--brand-tint-soft); text-decoration: underline; }

/* ---------- Layout ---------- */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

/* ---------- Showcase (desktop only) ---------- */
.showcase {
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  isolation: isolate;
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}

.blob {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.blob.b1 { width: 480px; height: 480px; background: var(--brand-violet); top: -140px; left: -120px; animation: drift1 18s ease-in-out infinite alternate; }
.blob.b2 { width: 420px; height: 420px; background: var(--brand-pink); bottom: -120px; right: -100px; animation: drift2 22s ease-in-out infinite alternate; }
.blob.b3 { width: 300px; height: 300px; background: var(--brand-violet-deep); top: 38%; left: 38%; opacity: 0.35; animation: drift3 26s ease-in-out infinite alternate; }

@keyframes drift1 { to { transform: translate(140px, 110px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-130px, -90px) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-90px, 80px) scale(0.85); } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

.showcase-body { display: flex; flex-direction: column; gap: 40px; align-items: flex-start; }

.showcase h2 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  max-width: 520px;
}
.showcase h2 span {
  background: linear-gradient(90deg, var(--brand-violet), var(--brand-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.showcase p.lead { margin: 14px 0 0; color: var(--muted); max-width: 460px; line-height: 1.6; }

/* floating paywall cards */
.stage { position: relative; width: 100%; height: 300px; }

.pw-card {
  position: absolute;
  width: 200px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(39,39,42,0.85), rgba(24,24,27,0.85));
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.pw-card .pill { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 14px; }
.pw-card .line { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.14); margin-bottom: 8px; }
.pw-card .line.w60 { width: 60%; }
.pw-card .line.w80 { width: 80%; }
.pw-card .cta {
  margin-top: 16px; padding: 9px; text-align: center; font-size: 0.75rem; font-weight: 700;
  border-radius: 10px; color: #fff;
}
.pw-card.c1 { left: 2%; top: 30px; animation: float 7s ease-in-out infinite; transform: rotate(-6deg); }
.pw-card.c2 { left: 30%; top: 0; width: 220px; z-index: 2; animation: float 8s ease-in-out -2s infinite; }
.pw-card.c3 { left: 60%; top: 44px; animation: float 9s ease-in-out -4s infinite; transform: rotate(6deg); }
.c1 .pill, .c1 .cta { background: var(--brand-violet-deep); }
.c2 .pill, .c2 .cta { background: linear-gradient(135deg, #7C3AED, #BE3D9B); }
.c3 .pill { background: var(--brand-pink); }
.c3 .cta { background: var(--brand-pink); color: #120D1C; }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -16px; }
}

.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats strong { font-size: 1.35rem; letter-spacing: -0.02em; }
.stats span { font-size: 0.78rem; color: var(--muted); }

.showcase-foot { color: var(--muted); font-size: 0.8rem; }

/* ---------- Form panel ---------- */
.panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  animation: rise 0.5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.mobile-brand { display: none; margin-bottom: 28px; }

.card h1 {
  margin: 0 0 8px;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.card .sub { margin: 0 0 26px; color: var(--muted); line-height: 1.55; font-size: 0.95rem; }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 18px;
  border: 1px solid;
}
.alert[hidden] { display: none; }
.alert.error { color: #fecaca; background: rgba(248,113,113,0.09); border-color: rgba(248,113,113,0.35); }
.alert.ok { color: #a7f3d0; background: rgba(52,211,153,0.09); border-color: rgba(52,211,153,0.35); }

.field { margin-bottom: 16px; }
.field[hidden] { display: none; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 7px; color: #d4d4d8; }

.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--text);
  background: rgba(24,24,27,0.8);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-wrap input::placeholder { color: #52525b; }
.input-wrap input:hover { border-color: #52525b; }
.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.22);
  background: rgba(24,24,27,1);
}
.input-wrap.has-toggle input { padding-right: 48px; }

.toggle-pw {
  position: absolute; right: 4px; top: 4px; width: 40px; height: 40px;
  display: grid; place-items: center;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.toggle-pw:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.row-between { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: 0.85rem; }
.row-between[hidden] { display: none; }

.hint { margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.hint[hidden] { display: none; }

.strength { display: flex; gap: 4px; margin-top: 10px; }
.strength[hidden] { display: none; }
.strength i { flex: 1; height: 4px; border-radius: 2px; background: var(--border-strong); transition: background .2s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: #ef4444; }
.strength[data-level="2"] i:nth-child(-n+2) { background: #f59e0b; }
.strength[data-level="3"] i:nth-child(-n+3) { background: #84cc16; }
.strength[data-level="4"] i:nth-child(-n+4) { background: var(--success); }

.btn-primary {
  width: 100%;
  height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  color: #fff;
  background: var(--brand-violet-deep);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124,58,237,0.35);
  transition: transform .1s, box-shadow .2s, filter .2s, opacity .2s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 10px 40px rgba(236,72,153,0.42); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary:focus-visible, .toggle-pw:focus-visible, .btn-link:focus-visible { outline: 2px solid var(--brand-tint); outline-offset: 2px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0; color: #71717a; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .08em;
}
.divider[hidden] { display: none; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

#googleButton { display: flex; justify-content: center; min-height: 44px; color-scheme: light; }

.btn-link {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  background: none; border: 0; font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--muted); cursor: pointer; border-radius: 8px;
}
.btn-link[hidden] { display: none; }
.btn-link:hover:not(:disabled) { color: var(--text); }
.btn-link:disabled { opacity: .5; cursor: wait; }

.switch { margin-top: 26px; text-align: center; font-size: 0.9rem; color: var(--muted); }

.legal { margin-top: 22px; text-align: center; font-size: 0.75rem; color: #71717a; line-height: 1.5; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .showcase { display: none; }
  .panel {
    padding: 28px 20px 40px;
    align-items: flex-start;
    background:
      radial-gradient(420px 320px at 10% -5%, rgba(130,90,255,0.28), transparent 70%),
      radial-gradient(380px 300px at 100% 0%, rgba(200,90,240,0.22), transparent 70%),
      var(--bg);
  }
  .card { margin: 0 auto; padding-top: 4px; }
  .mobile-brand { display: inline-flex; }
  .card h1 { font-size: 1.65rem; }
}

@media (min-width: 961px) {
  .panel { background: radial-gradient(600px 400px at 70% 0%, rgba(139,92,246,0.08), transparent 70%), var(--bg); }
}

@media (max-height: 760px) and (min-width: 961px) {
  .stage { height: 240px; }
  .showcase-body { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.lang-float { position: absolute; top: 20px; right: 20px; z-index: 5; }
@media (max-width: 960px) { .lang-float { top: 16px; right: 16px; } .mobile-brand { margin-top: 36px; } }
.legal a { color: #c4b5fd; text-decoration: underline; }

.brand img.brand-lockup{width:225px;height:36px;object-fit:contain;border-radius:0}
@media(max-width:480px){.brand img.brand-lockup{width:200px;height:32px}}

/* Email-sent confirmation */
.sent { text-align: center; padding: 6px 0 2px; animation: sentIn .45s cubic-bezier(.3, .8, .3, 1) both; }
.sent[hidden] { display: none; }
@keyframes sentIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sent-icon { position: relative; width: 68px; height: 68px; margin: 4px auto 22px; display: grid; place-items: center; border-radius: 20px; color: #c4b5fd; background: rgba(139, 92, 246, .14); border: 1px solid rgba(167, 139, 250, .32); box-shadow: 0 12px 34px rgba(124, 58, 237, .22); }
.sent-flap { stroke-dasharray: 30; stroke-dashoffset: 30; animation: sentDraw .7s .25s ease-out forwards; }
@keyframes sentDraw { to { stroke-dashoffset: 0; } }
.sent-badge { position: absolute; right: -7px; bottom: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #052e1f; background: #34d399; border: 3px solid var(--bg, #120d1c); animation: sentPop .45s .55s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes sentPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.sent h1 { margin: 0 0 10px; }
.sent .sub { margin: 0 auto 20px; max-width: 34ch; }
.sent .sub strong { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.sent-tips { list-style: none; margin: 0 0 22px; padding: 14px 16px; display: grid; gap: 8px; text-align: left; font-size: .88rem; color: var(--muted); border-radius: 12px; background: rgba(139, 92, 246, .06); border: 1px solid var(--border); }
.sent-tips li { position: relative; padding-left: 22px; line-height: 1.45; }
.sent-tips li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: rgba(167, 139, 250, .7); }
.btn-secondary { width: 100%; padding: 13px 16px; border-radius: 12px; font: inherit; font-weight: 700; font-size: .95rem; color: var(--text); background: transparent; border: 1px solid var(--border-strong, rgba(167, 139, 250, .35)); cursor: pointer; transition: background .15s, border-color .15s; }
.btn-secondary:hover:not(:disabled) { background: rgba(139, 92, 246, .12); border-color: rgba(167, 139, 250, .6); }
.btn-secondary:disabled { opacity: .55; cursor: default; }
.btn-secondary:focus-visible { outline: 2px solid var(--brand-tint); outline-offset: 2px; }
.sent-status { min-height: 1.3em; margin: 10px 0 4px; font-size: .85rem; color: var(--muted); }
.sent-status[data-tone="ok"] { color: #6ee7b7; }
.sent-status[data-tone="error"] { color: #fca5a5; }
.sent .btn-link { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .sent, .sent-flap, .sent-badge { animation: none; } .sent-flap { stroke-dashoffset: 0; } }
.sent h1:focus { outline: none; }
.sent-login { display: block; margin-top: 18px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.sent-login:hover { color: var(--text); }
.step .btn-primary{width:100%}.step .btn-link{display:block;margin:14px auto 0}.step form .field{margin-bottom:14px}
/* In-place two-step setup dialog (after sign-up) */
.tf-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100vh - 32px);padding:0;border:1px solid var(--border-strong);border-radius:20px;background:#17121f;color:var(--text);box-shadow:0 30px 80px rgba(0,0,0,.6);overflow:auto}
.tf-dialog::backdrop{background:rgba(8,5,14,.72);backdrop-filter:blur(6px)}
.tf-dialog[open]{animation:tfIn .22s cubic-bezier(.2,.8,.2,1)}
@keyframes tfIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}
.tf-close{position:absolute;top:12px;right:12px;width:34px;height:34px;border-radius:10px;border:0;background:transparent;color:var(--muted);font-size:1.4rem;line-height:1;cursor:pointer}
.tf-close:hover{background:rgba(255,255,255,.06);color:var(--text)}
.tf-body{padding:28px 26px 24px;text-align:center}
.tf-icon{width:48px;height:48px;margin:0 auto 14px;border-radius:14px;display:grid;place-items:center;color:#c4b5fd;background:rgba(139,92,246,.16)}
.tf-body h2{font-size:1.25rem;font-weight:800;margin:0 0 6px}
.tf-lead{color:var(--muted);font-size:.9rem;line-height:1.5;margin:0 0 18px}
.tf-body form{text-align:left}
.tf-body .btn-primary{width:100%}
.tf-qr{display:block;width:184px;height:184px;margin:0 auto 12px;padding:10px;border-radius:14px;background:#fff}
.tf-manual{margin:0 auto 18px;font-size:.82rem;color:var(--muted)}
.tf-manual summary{cursor:pointer;color:#c4b5fd;font-weight:600}
.tf-manual code{display:block;margin-top:8px;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.06);color:var(--text);font-size:.85rem;letter-spacing:.06em;word-break:break-all;user-select:all}
.tf-code{text-align:center;font-size:1.3rem !important;letter-spacing:.3em;font-variant-numeric:tabular-nums}
.tf-codes{list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 10px;padding:14px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--border);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.92rem;user-select:all}
.tf-tools{display:flex;justify-content:center;gap:18px;margin-bottom:12px}
.tf-tools .btn-link{margin:0}
.tf-check{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 0 14px;font-size:.88rem;color:#d4d4d8;cursor:pointer}
.tf-check input{width:16px;height:16px;accent-color:#8b5cf6}
.tf-body .alert{margin-bottom:12px}
