/* Sign in, join and waiting, in the public landing's language (after
   framer.com, 13/10): true black, Satoshi headlines, Inter text, white buttons.
   Behind the card a slow wall of real ads from the landing sample drifts; it is
   the only signature motion, the card answers with short step transitions. All
   motion is transform/opacity and stops under prefers-reduced-motion. */

/* The landing's faces (licences in /fonts): Satoshi for headlines, Inter for text. */
@font-face {
  font-family: 'Satoshi'; font-style: normal; font-weight: 500 600; font-display: swap;
  src: url(/fonts/satoshi-500.woff2) format('woff2');
}
@font-face {
  font-family: 'Satoshi'; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/fonts/satoshi-700.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter Var'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-var-latin.woff2) format('woff2');
}

.login-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: block; overflow: hidden;
  color-scheme: dark;
  --a-bg: #000; --a-panel: rgb(10 10 10 / .86); --a-field: #111;
  --a-text: #FFF; --a-text-2: #A8A8A8; --a-muted: #8C8C8C;
  --a-line: #1C1C1C; --a-line-2: #2C2C2C;
  --a-accent: #FFF; --a-accent-ink: #000; --a-danger: #FF8C86; --a-ok: #7FE3B0;
  --a-display: 'Satoshi', 'Inter Var', 'IBM Plex Sans', system-ui, sans-serif;
  --a-font: 'Inter Var', 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--a-bg); color: var(--a-text); font-family: var(--a-font);
}
.login-overlay[hidden] { display: none; }

/* ---- the wall of ads ---- */
.auth-wall {
  position: absolute; inset: -20% -10%;
  display: flex; justify-content: center; gap: 22px;
  transform: rotate(-9deg); transform-origin: 50% 50%;
  opacity: .5; pointer-events: none;
}
.auth-col { flex: 0 0 200px; display: flex; flex-direction: column; gap: 22px; will-change: transform; animation: auth-drift 90s linear infinite; }
.auth-col:nth-child(2) { animation-duration: 120s; animation-direction: reverse; margin-top: -120px; }
.auth-col:nth-child(3) { animation-duration: 105s; margin-top: 60px; }
.auth-col:nth-child(4) { animation-duration: 135s; animation-direction: reverse; margin-top: -40px; }
.auth-col:nth-child(5) { animation-duration: 95s; margin-top: 90px; }
@keyframes auth-drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* a real ad from the landing sample */
.auth-pic { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; flex: none; border-radius: 14px; background: #111; box-shadow: inset 0 0 0 1px var(--a-line); }

/* the shade keeps the wall readable but never loud */
.auth-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(52% 78% at 22% 52%, rgb(0 0 0 / .97) 0%, rgb(0 0 0 / .9) 45%, rgb(0 0 0 / .4) 80%, transparent 100%),
    linear-gradient(180deg, rgb(0 0 0 / .75), transparent 22%, transparent 78%, rgb(0 0 0 / .85));
}

/* ---- the stage ---- */
.auth-stage {
  position: relative; z-index: 1; height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center; gap: 48px;
  padding: 40px clamp(24px, 6vw, 96px);
  overflow-y: auto;
}
.auth-hero { max-width: 640px; display: flex; flex-direction: column; gap: 22px; }
.auth-hero-mark { width: 40px; height: 40px; border-radius: 10px; display: block; }
.auth-hero-title {
  margin: 0; font-family: var(--a-display); font-weight: 500;
  font-size: clamp(38px, 4.4vw, 64px); line-height: 1.02; letter-spacing: -.04em; text-wrap: balance;
}
.auth-hero-title em { display: block; font-style: normal; color: var(--a-muted); }
.auth-hero-sub { margin: 0; font-size: 17px; line-height: 1.5; color: var(--a-text-2); max-width: 44ch; }
.auth-stats { display: flex; gap: 40px; margin: 10px 0 0; padding: 0; }
.auth-stat { margin: 0; }
.auth-stat dt { font-family: var(--a-font); font-weight: 600; font-size: 32px; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.auth-stat dd { margin: 6px 0 0; font-size: 14px; font-weight: 500; color: var(--a-text-2, #A8A8A8); }

.auth-panel { display: flex; justify-content: center; }

/* ---- the card ---- */
.login-card {
  width: 100%; max-width: 408px;
  background: var(--a-panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--a-line); border-radius: 20px;
  box-shadow: 0 30px 80px rgb(0 0 0 / .6);
  padding: 28px 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  color: var(--a-text);
}
.login-card[hidden] { display: none; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { width: 26px; height: 26px; border-radius: 7px; }
/* the lockup as on the landing: "Ads" in the blue badge */
.auth-brand span { font: 600 16px/1 var(--a-font); letter-spacing: -.02em; }
.auth-brand i { display: inline-block; margin-left: .14em; padding: .3em .48em .28em; border-radius: .42em; background: #2E4BDB; color: #fff; font-style: normal; font-weight: 700; font-size: .72em; line-height: 1; letter-spacing: 0; vertical-align: .12em; }

.auth-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px;
  background: var(--a-field); border: 1px solid var(--a-line); border-radius: 10px;
}
.auth-tabs[hidden] { display: none; }
.auth-tab {
  position: relative; z-index: 1; border: 0; background: transparent; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--a-text-2); padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; transition: color .15s ease;
}
.auth-tab[aria-selected="true"] { color: var(--a-text); }
.auth-tab:focus-visible { outline: 2px solid var(--a-muted); outline-offset: 1px; }
.auth-tab-ind {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 7px; background: #222; border: 1px solid var(--a-line-2);
  transition: transform var(--dur-3) var(--spring);
}

.login-title { margin: 6px 0 0; font-family: var(--a-display); font-weight: 500; font-size: 28px; letter-spacing: -.035em; line-height: 1.05; }
.login-sub { margin: -6px 0 0; font-size: 14px; line-height: 1.45; color: var(--a-text-2); }
.auth-fields { display: flex; flex-direction: column; gap: 12px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field[hidden] { display: none; }
.auth-field label { font-size: 13px; font-weight: 500; color: var(--a-text-2); display: flex; justify-content: space-between; }
.auth-field label small { font-size: 12.5px; font-weight: 400; color: var(--a-muted); }
.auth-input-wrap { position: relative; }
.login-card .input, .gate-plans .input {
  width: 100%; box-sizing: border-box; height: 44px; padding: 0 14px;
  background: var(--a-field); color: var(--a-text);
  border: 1px solid var(--a-line-2); border-radius: 10px;
  font: inherit; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.login-card .input::placeholder, .gate-plans .input::placeholder { color: #8C8C8C; }
.login-card .input:hover, .gate-plans .input:hover { border-color: #3A3A3A; }
.login-card .input:focus, .gate-plans .input:focus { outline: none; border-color: #C8C8C8; box-shadow: 0 0 0 3px rgb(255 255 255 / .18); }
.auth-input-wrap .input { padding-right: 62px; }
.auth-peek {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--a-text-2); font: inherit; font-size: 13px;
  padding: 6px 8px; border-radius: var(--r-xs); cursor: pointer;
}
.auth-peek:hover { color: var(--a-text); }
.auth-peek:focus-visible { outline: 2px solid var(--a-muted); }
.auth-note { white-space: pre-line; min-height: 0; font-size: 13px; color: var(--a-muted); }
.auth-note:empty { display: none; }
.auth-note.is-ok { color: var(--a-ok); }
.auth-note.is-bad { color: var(--a-danger); }
.auth-note.is-busy { color: var(--a-muted); }

.login-card .btn-primary, .gate-plans .btn-primary {
  height: 46px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--a-accent); color: var(--a-accent-ink);
  font: inherit; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s ease, transform var(--dur-3) var(--spring);
}
.login-card .btn-primary:hover, .gate-plans .btn-primary:hover { opacity: .86; }
.login-card .btn-primary:active, .gate-plans .btn-primary:active { transform: scale(.97); transition-duration: .15s, var(--dur-press); }
.login-card .btn-primary:disabled, .gate-plans .btn-primary:disabled { opacity: .6; cursor: default; }
.login-card .btn-primary:focus-visible, .gate-plans .btn-primary:focus-visible { outline: 2px solid #8C8C8C; outline-offset: 2px; }
.login-card .btn-primary::after, .gate-plans .btn-primary::after { content: '\2192'; display: inline-block; transition: transform .2s ease; }
.login-card .btn-primary:hover::after, .gate-plans .btn-primary:hover::after { transform: translateX(3px); }
.login-card .btn-primary:disabled::after, .gate-plans .btn-primary:disabled::after { content: none; }
.login-card .btn:not(.btn-primary), .gate-plans .btn:not(.btn-primary) {
  height: 44px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 14px;
  background: rgb(128 128 128 / .16); color: var(--a-text); border: 0;
}
.login-card .btn:not(.btn-primary):hover, .gate-plans .btn:not(.btn-primary):hover { background: rgb(128 128 128 / .24); }

.login-error { margin: 0; min-height: 0; color: var(--a-danger); font-size: 13.5px; }
.login-error:empty { display: none; }
.login-alt { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.login-link {
  border: 0; background: transparent; padding: 4px 6px; font: inherit; font-size: 13.5px;
  color: var(--a-text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgb(168 168 168 / .4);
}
.login-link:hover { color: var(--a-text); }
.login-link:focus-visible { outline: 2px solid var(--a-muted); outline-offset: 2px; border-radius: var(--r-xs); }
.auth-fine { margin: 0; text-align: center; font-size: 12.5px; color: var(--a-muted); }

.login-card.shake { animation: shake .5s ease-out; }
/* a "no" like the Mac's password field: a damped shake that dies out, not an even rattle */
@keyframes shake {
  12% { transform: translateX(-9px); }
  26% { transform: translateX(7px); }
  40% { transform: translateX(-5px); }
  54% { transform: translateX(3px); }
  68% { transform: translateX(-1.5px); }
  82% { transform: translateX(.5px); }
}

/* ---- waiting: a premium waitlist ---- */
.auth-wait { gap: 16px; text-align: left; }
.auth-wait-ring { width: 64px; height: 64px; }
.auth-wait-ring circle { fill: none; stroke: rgb(255 255 255 / .09); stroke-width: 3; }
.auth-wait-ring .arc { stroke: var(--a-accent); stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 176; animation: auth-arc 1s .15s cubic-bezier(.3,.7,.2,1) forwards; }
.auth-wait-ring path { fill: none; stroke: var(--a-text); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 34; stroke-dashoffset: 34; animation: auth-tick .5s .85s ease forwards; }
@keyframes auth-arc { to { stroke-dashoffset: 0; } }
@keyframes auth-tick { to { stroke-dashoffset: 0; } }
.auth-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.auth-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.auth-step:last-child { padding-bottom: 0; }
.auth-step::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: 2px; width: 2px; background: var(--a-line); }
.auth-step:last-child::before { display: none; }
.auth-step-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgb(127 227 176 / .14); color: var(--a-ok); }
.auth-step-ico svg { width: 14px; height: 14px; }
.auth-step.is-now .auth-step-ico { background: rgb(255 255 255 / .1); color: var(--a-text); }
.auth-step.is-now .auth-step-ico svg { animation: auth-spin 2.4s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-step b { display: block; font-size: 14.5px; font-weight: 600; }
.auth-step span { font-size: 13.5px; color: var(--a-text-2); line-height: 1.4; }
.auth-wait-partner { font-size: 13.5px; color: var(--a-text-2); }

/* ---- the gate: email code, then a plan (public/gate.js) ---- */
.gate-step { margin: 2px 0 -8px; font-size: 12.5px; font-weight: 500; letter-spacing: .02em; color: var(--a-muted); }
.login-card .input.gate-code {
  height: 58px; text-align: center; font-family: var(--a-display); font-weight: 600; font-size: 30px;
  letter-spacing: .42em; padding: 0 0 0 .42em; font-variant-numeric: tabular-nums;
}
.login-card .input.gate-code::placeholder { color: #3A3A3A; }
.login-link:disabled { cursor: default; text-decoration: none; opacity: .7; }

/* the plan step takes the whole stage: no hero, three cards side by side */
/* The plan step keeps the room of the sign-in: the same wall, a deeper even shade,
   the hero's two-tone headline, and glass cards cut like the sign-in card. White is
   the only accent: the chosen-most plan gets the white button, nothing blue. */
.login-overlay.is-plans .auth-stage { grid-template-columns: minmax(0, 1fr); align-items: start; padding-top: 32px; padding-bottom: 56px; }
.login-overlay.is-plans .auth-hero { display: none; }
.login-overlay.is-plans .auth-shade { background: radial-gradient(90% 70% at 50% 30%, rgb(0 0 0 / .9), rgb(0 0 0 / .78) 60%, rgb(0 0 0 / .92)); }
.gate-plans { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.gate-plans[hidden] { display: none; }
.gate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gate-intro { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin-top: 4px; }
.gate-intro .gate-step { margin: 0; }
.gate-title {
  margin: 0; font-family: var(--a-display); font-weight: 500;
  font-size: clamp(32px, 3.6vw, 50px); line-height: 1.02; letter-spacing: -.04em; text-wrap: balance;
}
.gate-title em { font-style: normal; color: var(--a-muted); }
.gate-sub { margin: 0; font-size: 16px; line-height: 1.5; color: var(--a-text-2); max-width: 52ch; text-wrap: pretty; }
.gate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: stretch; }
.gate-grid > .pl { grid-column: 1 / -1; }
.gate-grid[hidden] { display: none; }
/* the plan cards (plans.css) on the black stage */
.gate-plans .pl {
  --pl-card: #0D0D0F; --pl-line: #232326; --pl-ink: #FFFFFF; --pl-body: #A8A8A8; --pl-muted: #8C8C8C;
  --pl-band: rgb(255 255 255 / .06); --pl-thumb: #2A2A2E; --pl-blue: #4661EE; --pl-blue-ink: #A9BCFF; --pl-blue-soft: rgb(70 97 238 / .14);
  --pl-display: var(--a-display);
}
.gate-plans .pl-cta .btn { height: 46px; font-weight: 600; }
.gate-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.gate-bar[hidden] { display: none; }
.gate-trial { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--a-text-2); }
.gate-trial[hidden] { display: none; }
#gateTrialError:empty { display: none; }
/* styles.css paints a hovered primary button blue: here it stays white */
.gate-plans .btn-primary:hover:not(:disabled) { background: var(--a-accent); filter: none; }
.gate-skel { height: 520px; border-radius: calc(var(--r-xl) + 2px); background: linear-gradient(100deg, rgb(255 255 255 / .03) 30%, rgb(255 255 255 / .07) 50%, rgb(255 255 255 / .03) 70%); background-size: 240% 100%; animation: gate-sh 1.2s linear infinite; }
@keyframes gate-sh { to { background-position: -140% 0; } }
.gate-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.gate-invite[hidden] { display: none; }
.gate-invite label { font-size: 14px; color: var(--a-text-2); }
.gate-invite-row { display: flex; gap: 10px; flex: 0 1 460px; }
.gate-invite-row .input { flex: 1; min-width: 0; }
.gate-invite-row .btn { flex: none; padding: 0 18px; }
.gate-invite .login-error { flex-basis: 100%; margin: 0; }
.gate-invite .login-error:empty { display: none; }
.gate-wait {
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start; max-width: 520px; padding: 24px 26px 20px;
  background: var(--a-panel); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid var(--a-line); border-radius: calc(var(--r-xl) + 2px); box-shadow: 0 30px 80px rgb(0 0 0 / .6);
}
.gate-wait .login-link, .gate-trial .login-link { margin-left: -6px; }
.gate-wait[hidden] { display: none; }

/* ---- step transitions (auth.js drives these with the Web Animations API) ---- */

/* ---- phone: the wall stays as a quiet backdrop, the card takes the screen ---- */
@media (max-width: 900px) {
  .auth-stage { grid-template-columns: minmax(0, 1fr); align-items: center; padding: 20px 16px; gap: 0; }
  .auth-hero { display: none; }
  .auth-wall { opacity: .4; gap: 14px; }
  .auth-col { flex-basis: 150px; }
  .login-card { max-width: 440px; margin: 0 auto; padding: 22px 20px 20px; }
  .gate-plans { max-width: 520px; gap: 22px; }
  .gate-grid { grid-template-columns: minmax(0, 1fr); }
  .gate-intro { margin-top: 4px; }
  .gate-sub { font-size: 15px; }
  .login-overlay.is-plans .auth-stage { padding-top: 16px; align-items: start; }
  .login-title { font-size: 24px; }
  .auth-shade { background: linear-gradient(180deg, rgb(0 0 0 / .6), rgb(0 0 0 / .85)); }
  /* the cookie banner is fixed at the bottom: leave room so the form can scroll above it */
  body:has(#mc-consent) .auth-stage { padding-bottom: 150px; align-items: start; }
  /* a focus jump must never slide the card sideways */
  .auth-stage { overflow-x: clip; }
}
/* short phone with the cookie banner up: tighten the card so its button clears the banner */
@media (max-width: 900px) and (max-height: 720px) {
  body:has(#mc-consent) .auth-stage { padding-top: 12px; }
  body:has(#mc-consent) .login-card { padding: 14px 18px 14px; gap: 10px; }
  body:has(#mc-consent) .login-sub { display: none; }
  body:has(#mc-consent) .login-title { margin: 2px 0 0; font-size: 21px; }
  body:has(#mc-consent) .auth-fields { gap: 8px; }
  body:has(#mc-consent) .auth-fine { margin: 0; }
}
@media (min-width: 901px) and (max-height: 720px) {
  .auth-hero-sub, .auth-stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-col { animation: none; }
  .auth-tab-ind { transition: none; }
  .auth-wait-ring .arc, .auth-wait-ring path { animation: none; stroke-dashoffset: 0; }
  .auth-step.is-now .auth-step-ico svg { animation: none; }
  .login-card.shake { animation: none; }
  .gate-skel { animation: none; }
}

/* ---- no peek at the app before sign-in ----
   The shell is static HTML, so it used to paint, empty, while the page asked who
   you are; a signed-out visitor saw it for a moment before the sign-in screen.
   It now stays hidden until app.js says you are in (data-auth="in", set by
   hideLogin). The sign-in screen is not part of the shell, so it still shows.
   The shell never shows on its own: its static defaults read as somebody's
   account (a customer saw "Mycrea · Creative Studio" during a deploy, 15/10).
   If nobody has answered after 6 s, a neutral line says the app is loading. */
html:not([data-auth="in"]) #shell { visibility: hidden; }
.boot-wait {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center;
  color: var(--text-2, #a1a1aa); font: 14px/1.5 system-ui, sans-serif;
  visibility: hidden; animation: boot-wait-show 0s 6s forwards;
}
#gateResend { font-variant-numeric: tabular-nums; } /* the countdown ticks without the line jumping */
.boot-wait p { margin: 0; }
.boot-wait a {
  font: inherit; color: inherit; text-decoration: none;
  border: 1px solid var(--border, #3f3f46); border-radius: var(--r, 8px); padding: 6px 14px;
}
html[data-auth] .boot-wait { display: none; }
@keyframes boot-wait-show { to { visibility: visible; } }
.auth-fine a { color: var(--a-text-2); text-underline-offset: 3px; }
.auth-fine a:hover { color: var(--a-text); }
