@font-face { font-family: "Inter"; src: url("/app/fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #080c11; --surface: #0f1620; --surface-2: #141d29; --border: #1d2a37;
  --text: #f2f5fb; --text-2: #acbacb; --text-3: #6f8195; --accent: #2f8cff; --danger: #ff6b6b;
  --ease: cubic-bezier(.2,0,0,1); --ease-out: cubic-bezier(.16,1,.3,1);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* ---- layout: phone and tablet — the living scene on top, the form below ---------------- */
.login-shell {
  position: relative; z-index: 1; min-height: 100dvh; display: grid; justify-items: center;
  grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 20px;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}
.scene-anchor { grid-row: 2; align-self: stretch; justify-self: stretch; min-height: 0; pointer-events: none; }
.login-brand { grid-row: 1; display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.login-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 22px; box-shadow: 0 8px 24px rgb(47 140 255 / .35); }
.login-pitch { display: none; }
.login-footer { grid-row: 4; }
.login-card {
  grid-row: 3; align-self: end; width: min(420px, 100%); padding: 32px 28px; border: 1px solid rgb(255 255 255 / .08); border-radius: 24px;
  background: linear-gradient(180deg, rgb(255 255 255 / .05), transparent 40%), rgb(15 22 32 / .78);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 24px 64px rgb(0 0 0 / .5), inset 0 1px 0 rgb(255 255 255 / .05);
}
@media (max-height: 640px) and (max-width: 1099px) {
  .scene-anchor { display: none; }
  .login-card { grid-row: 2 / 4; align-self: center; }
}

/* ---- layout: desktop — the form on the left, the scene and the pitch on the right ------- */
@media (min-width: 1100px) {
  .login-shell {
    grid-template-columns: minmax(420px, 38%) 1fr; grid-template-rows: auto 1fr auto; justify-items: start;
    gap: 24px 48px; padding: 32px clamp(40px, 5vw, 88px);
  }
  .login-brand { grid-column: 1; grid-row: 1; }
  .login-card { grid-column: 1; grid-row: 2; align-self: center; justify-self: stretch; max-width: 440px; }
  .login-footer { grid-column: 1; grid-row: 3; align-self: end; justify-content: flex-start; }
  .scene-anchor { display: block; grid-column: 2; grid-row: 1 / 3; }
  .login-pitch {
    display: grid; gap: 10px; grid-column: 2; grid-row: 3 / 4; align-self: end; max-width: 520px;
    position: relative; pointer-events: none;
  }
  .login-pitch::before {
    /* A quiet patch of sky under the text, so passing offers never cross the words. */
    content: ""; position: absolute; inset: -60px -80px -40px -60px; z-index: -1;
    background: radial-gradient(closest-side, rgb(8 12 17 / .85), rgb(8 12 17 / .5) 60%, transparent);
  }
  .login-pitch span { color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .login-pitch p {
    margin: 0; font-size: clamp(34px, 3.1vw, 48px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em;
    background: linear-gradient(100deg, #fff 30%, #9cc7ff 60%, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .login-pitch small { color: var(--text-2); font-size: 15px; line-height: 1.5; max-width: 440px; }
}

/* ---- the scene ---------------------------------------------------------------------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; --s: 1; }
.scene canvas, .sc-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-layer > * { position: absolute; left: 0; top: 0; }
.scene::after {
  /* A soft vignette keeps the edges calm and the form readable. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgb(8 12 17 / .7));
}
.scene.is-wide::after { background: linear-gradient(90deg, rgb(8 12 17 / .55), transparent 42%), radial-gradient(120% 90% at 65% 45%, transparent 55%, rgb(8 12 17 / .7)); }

.sc-card, .sc-deal-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 16px; white-space: nowrap;
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(255 255 255 / .02)), rgb(13 20 30 / .86);
  border: 1px solid rgb(255 255 255 / .1); color: var(--text); font-size: 12px; line-height: 1.25;
  box-shadow: 0 12px 32px rgb(0 0 0 / .45), 0 0 28px -8px var(--c);
}
.sc-card { will-change: transform, opacity; transform-origin: 50% 50%; opacity: 0; z-index: 2; }
.sc-card.is-deal { z-index: 4; }
.sc-logo {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 11.5px; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--c), color-mix(in oklab, var(--c), #05070a 45%)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .25);
}
.sc-meta { display: grid; }
.sc-meta b { font-size: 13px; font-weight: 600; }
.sc-meta small { color: var(--text-3); font-size: 11px; }
.sc-card em, .sc-deal-head em {
  margin-left: 4px; padding: 5px 8px; border-radius: 9px; background: rgb(255 255 255 / .07); font-style: normal; font-weight: 650; font-size: 12.5px;
  font-variant-numeric: tabular-nums; color: #fff;
}

.sc-hub { z-index: 3; width: 0; height: 0; transform-origin: 0 0; }
.sc-avatar { position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; }
.sc-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(#2f8cff, #8b5cf6, #ec4899, #f59e0b, #22d3ee, #2f8cff);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: sc-spin 6s linear infinite; filter: drop-shadow(0 0 10px rgb(139 92 246 / .6));
}
.sc-face {
  position: absolute; inset: 2px; display: grid; place-items: end center; overflow: hidden; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #5aa9ff, #2153b8 55%, #151d4a); box-shadow: 0 0 40px rgb(47 140 255 / .45);
}
.sc-face svg { width: 74%; height: 74%; fill: rgb(255 255 255 / .92); margin-bottom: -6%; }
.sc-badge {
  position: absolute; right: -8px; top: -4px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center;
  background: #ff3b5c; color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; border: 3px solid #0b1118;
  box-shadow: 0 4px 14px rgb(255 59 92 / .5);
}
.sc-label { position: absolute; top: 54px; left: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; white-space: nowrap; }
.sc-label strong { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.sc-verified { width: 16px; height: 16px; fill: #2f8cff; }
.sc-audience { color: var(--text-3); font-size: 12px; }
.sc-earn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--text-2);
  background: rgb(34 197 94 / .1); border: 1px solid rgb(34 197 94 / .25);
}
.sc-earn b { color: #4ade80; font-size: 13px; font-variant-numeric: tabular-nums; }

.sc-planet {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgb(13 20 30 / .92); border: 1px solid rgb(255 255 255 / .12); box-shadow: 0 0 18px -3px var(--c);
}
.sc-planet svg { width: 15px; height: 15px; fill: var(--c); }

.sc-paid, .sc-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; white-space: nowrap; font-size: 12.5px; font-weight: 600;
  color: #bbf7d0; background: rgb(22 101 52 / .55); border: 1px solid rgb(74 222 128 / .4); box-shadow: 0 0 24px -6px #22c55e;
}
.sc-paid svg, .sc-status svg { width: 15px; height: 15px; fill: none; stroke: #4ade80; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: sc-draw 420ms 120ms ease-out forwards; }
.sc-paid { position: absolute; left: 0; top: -88px; transform: translateX(-50%); animation: sc-paid 2.6s cubic-bezier(.16,1,.3,1) forwards; }

.sc-deal {
  z-index: 4; width: 292px; display: grid; gap: 10px; padding: 10px; border-radius: 20px;
  background: linear-gradient(180deg, rgb(255 255 255 / .07), rgb(255 255 255 / .02)), rgb(11 17 25 / .9);
  border: 1px solid rgb(255 255 255 / .1); box-shadow: 0 30px 70px rgb(0 0 0 / .55), 0 0 60px -20px var(--c);
  animation: sc-pop 520ms cubic-bezier(.16,1,.3,1);
}
.sc-deal.is-still { animation: none; }
.sc-deal.is-out { animation: sc-out 480ms ease-in forwards; }
.sc-deal-head { box-shadow: none; background: rgb(255 255 255 / .04); }
.sc-deal-head em { margin-left: auto; }
.sc-thread { display: grid; gap: 6px; padding: 2px 2px 4px; }
.sc-msg {
  max-width: 86%; padding: 8px 11px; border-radius: 14px; font-size: 12.5px; line-height: 1.35; animation: sc-msg 320ms cubic-bezier(.16,1,.3,1);
}
.sc-msg.from-brand { justify-self: start; background: rgb(255 255 255 / .08); border-bottom-left-radius: 5px; }
.sc-msg.from-me { justify-self: end; display: grid; gap: 2px; background: linear-gradient(135deg, #2f8cff, #5b5cf0); border-bottom-right-radius: 5px; }
.sc-msg.from-me small { color: rgb(255 255 255 / .7); font-size: 10.5px; font-weight: 600; }
.sc-msg.sc-typing { display: inline-flex; gap: 4px; padding: 11px 13px; }
.sc-typing i { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .7); animation: sc-dot 900ms infinite ease-in-out; }
.sc-typing i:nth-child(2) { animation-delay: 150ms; }
.sc-typing i:nth-child(3) { animation-delay: 300ms; }
.sc-status { justify-self: center; margin-top: 4px; animation: sc-pop 520ms cubic-bezier(.16,1,.3,1); }

.sc-toasts { z-index: 5; left: auto; right: 28px; top: 28px; display: grid; gap: 10px; width: 300px; }
.sc-toast {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
  background: rgb(15 22 32 / .82); border: 1px solid rgb(255 255 255 / .09); box-shadow: 0 16px 40px rgb(0 0 0 / .45);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: sc-toast 520ms cubic-bezier(.16,1,.3,1);
}
.sc-toast.is-out { animation: sc-toast-out 400ms ease-in forwards; }
.sc-toast-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in oklab, var(--c), transparent 80%); }
.sc-toast-icon svg { width: 16px; height: 16px; fill: var(--c); }
.sc-toast-body { display: grid; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.sc-toast-body small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-toast time { align-self: start; color: var(--text-3); font-size: 10.5px; }
.scene:not(.is-wide) .sc-toasts, .scene:not(.is-wide) .sc-deal { display: none; }

@keyframes sc-spin { to { transform: rotate(1turn); } }
@keyframes sc-draw { to { stroke-dashoffset: 0; } }
@keyframes sc-pop { from { opacity: 0; transform: var(--from, none) scale(.92); } }
@keyframes sc-out { to { opacity: 0; filter: blur(4px); } }
@keyframes sc-msg { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes sc-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes sc-toast { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes sc-toast-out { to { opacity: 0; transform: translateX(16px); } }
@keyframes sc-paid {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.85); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -14px); }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

.login-step { display: grid; gap: 16px; }
.login-step[hidden] { display: none; }
.login-step.is-entering { animation: step-in 320ms var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.login-lead { margin: -6px 0 4px; color: var(--text-2); }
.login-lead strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.login-note { margin: 4px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.45; }

.login-field { display: grid; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.login-field input {
  height: 52px; padding: 0 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 16px; transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(47 140 255 / .18); }

.code-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-cell {
  width: 100%; aspect-ratio: 5 / 6; min-height: 52px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
  color: var(--text); font: 650 24px/1 Inter, sans-serif; text-align: center; font-variant-numeric: tabular-nums;
  caret-color: var(--accent); transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease), transform 120ms var(--ease);
}
.code-cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(47 140 255 / .18); transform: translateY(-1px); }
.code-cells.is-shaking { animation: shake 360ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.login-error { margin: -4px 0 0; color: var(--danger); font-size: 13px; }
.login-primary {
  position: relative; height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #fff;
  font: 600 16px/1 Inter, sans-serif; cursor: pointer; transition: transform 120ms var(--ease), filter 120ms var(--ease);
}
.login-primary:hover { filter: brightness(1.08); }
.login-primary:active { transform: scale(.985); }
.login-primary:disabled { cursor: progress; }
.login-primary.is-busy span { opacity: 0; }
.login-primary.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.login-back, .login-resend { justify-self: start; padding: 4px 0; border: 0; background: none; color: var(--accent); font: 500 14px/1.4 Inter, sans-serif; cursor: pointer; }
.login-resend { justify-self: center; font-variant-numeric: tabular-nums; }
.login-resend:disabled { color: var(--text-3); cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.login-done { justify-items: center; text-align: center; padding: 12px 0; }
.login-check { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgb(34 197 94 / .14); }
.login-check svg { width: 32px; height: 32px; fill: none; stroke: #22c55e; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 360ms 120ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.login-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; }
.login-footer a { color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  /* The scene stands still here: a solid card instead of live glass. */
  .login-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, rgb(255 255 255 / .05), transparent 40%), rgb(15 22 32 / .95); }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
