/* Login page — split layout: an animated brand stage (one queue of posts flying out to every
   platform) and the sign-in card. Motion only moves things: every element is fully visible
   in its resting state, so nothing disappears if animations are paused or reduced. */

.auth-page { background: var(--canvas-glow), var(--canvas); }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }

/* ---------------------------------------------------------------- brand stage */
.stage {
  --stage-ink: #F3F7FF;
  --stage-ink-2: #B9CCE6;
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto; gap: 28px;
  padding: clamp(28px, 4vw, 56px);
  background: linear-gradient(155deg, #0A1F3D 0%, #0C2D5A 46%, #0B4F9E 100%);
  color: var(--stage-ink);
}
.stage-grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 60% 45%, #000 0%, transparent 72%);
}
.stage-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); will-change: transform; transition: transform 1.2s var(--ease); }
.orb-a { width: 420px; height: 420px; right: -120px; top: -140px; background: rgba(46, 139, 240, .55); }
.orb-b { width: 360px; height: 360px; left: -140px; bottom: -160px; background: rgba(243, 154, 56, .32); }

.stage-kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 99px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--stage-ink-2);
}
.stage-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(243,154,56,.22); }
.stage-title { margin-top: 18px; font-size: clamp(34px, 3.8vw, 56px); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; }
.stage-title .word { display: inline-block; }
.stage-title .accent {
  background: linear-gradient(90deg, #8CC4FF 0%, #F6AE5C 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* the flight: queue (left/bottom) → plane → platform nodes (right arc) */
.flight { position: relative; min-height: 300px; align-self: center; }
.queue { position: absolute; left: 4%; bottom: 10%; width: 150px; height: 120px; }
.qcard {
  position: absolute; left: 0; bottom: 0; width: 132px; height: 84px; padding: 14px; border-radius: 16px;
  background: #FFFFFF; box-shadow: 0 14px 30px rgba(3, 12, 30, .35); display: grid; align-content: start; gap: 8px;
}
.qcard span { display: block; height: 8px; border-radius: 99px; background: #D6E4F1; }
.qcard span:first-child { width: 72%; background: #0868CC; opacity: .85; }
.qcard span:last-child { width: 48%; }
.qcard.q3 { transform: translate(16px, -28px) rotate(-8deg) scale(.9); opacity: .55; }
.qcard.q2 { transform: translate(8px, -14px) rotate(-4deg) scale(.95); opacity: .8; }
.qcard.q1 { transform: none; }

.plane {
  position: absolute; left: 0; top: 0; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  fill: #FFFFFF; stroke: #0868CC; stroke-width: 1.2; stroke-linejoin: round;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); opacity: 0; pointer-events: none;
}

.orbit { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.node {
  position: absolute; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px);
  font-size: 13px; font-weight: 700; color: var(--stage-ink); transition: background .4s var(--ease), border-color .4s var(--ease), transform .5s cubic-bezier(.34,1.56,.64,1);
}
.node-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); }
.node-check { width: 16px; height: 16px; fill: none; stroke: #7FD8AE; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .45s var(--ease) .1s; }
.node[data-p="linkedin"]  { --c: #2F8BE6; right: 6%;  top: 2%; }
.node[data-p="tiktok"]    { --c: #FE2C55; right: 0%;  top: 23%; }
.node[data-p="instagram"] { --c: #E1306C; right: 3%;  top: 45%; }
.node[data-p="facebook"]  { --c: #1877F2; right: 12%; top: 66%; }
.node[data-p="fastwork"]  { --c: #F39A38; right: 27%; top: 84%; }
.node.hit { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.34); transform: scale(1.08); }
.node.hit .node-dot { animation: ping .9s var(--ease); }
.node.hit .node-check, .node.done .node-check { stroke-dashoffset: 0; }

.stage-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: var(--stage-ink-2); font-size: 14px; font-weight: 600; }
.stage-points li { display: flex; align-items: center; gap: 10px; }
.stage-points svg { width: 18px; height: 18px; fill: none; stroke: #8CC4FF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- sign-in panel */
.auth-panel { display: grid; place-items: center; padding: clamp(20px, 4vw, 56px); }
.auth-card {
  width: min(430px, 100%); display: grid; gap: 20px; padding: clamp(24px, 3vw, 34px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lift);
}
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-brand .brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.auth-brand .brand-name span { color: var(--brand); }
.auth-sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; min-height: 1.5em; transition: transform .25s var(--ease); }
.auth-sub.swap { transform: translateY(-4px); }

/* buddy: the logo with a pair of eyes that follow your typing */
.buddy { position: relative; flex: none; width: 56px; height: 56px; }
.buddy-icon { width: 56px; height: 56px; border-radius: 15px; box-shadow: var(--brand-glow); display: block; }
.eyes {
  position: absolute; right: -12px; bottom: -8px; display: flex; gap: 4px; padding: 5px 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 4px 10px rgba(19,43,74,.14);
}
.eye { position: relative; width: 13px; height: 13px; border-radius: 50%; background: #FFFFFF; border: 1.5px solid #132B4A; overflow: hidden; }
.pupil {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #132B4A;
  transform: translate(var(--px, 0px), var(--py, 0px)) scale(var(--ps, 1)); transition: transform .18s var(--ease);
}
.lid { position: absolute; inset: 0; background: var(--brand); transform-origin: top; transform: scaleY(0); transition: transform .22s var(--ease); }
.buddy.shy .lid, .buddy.blink .lid { transform: scaleY(1); }
.buddy.peek .lid { transform: scaleY(.15); }

/* sliding segmented control */
.auth-card .seg-slide { position: relative; display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; }
.seg-slide [role="tab"] { position: relative; z-index: 1; text-align: center; transition: color .3s var(--ease); }
.seg-slide [role="tab"][aria-selected="true"] { background: transparent; box-shadow: none; color: var(--ink); }
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
.seg-slide[data-mode="signup"] .seg-pill { transform: translateX(calc(100% + 4px)); }
.seg-slide [role="tab"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.auth-form { display: grid; gap: 14px; }

/* floating-label fields */
.float-field { position: relative; }
/* styled by class, not by type, so the password keeps its look when revealed as text */
.float-field input {
  display: block; width: 100%; height: 58px; padding: 22px 46px 6px 16px; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.float-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.float-field label {
  position: absolute; left: 16px; top: 19px; font-size: 15px; font-weight: 600; color: var(--ink-3); pointer-events: none;
  transform-origin: left top; transition: transform .25s var(--ease), color .25s var(--ease);
}
.float-field input:focus + label, .float-field input:not(:placeholder-shown) + label { transform: translateY(-11px) scale(.78); color: var(--brand); }
.float-field input:not(:focus):not(:placeholder-shown) + label { color: var(--ink-3); }
.field-ok {
  position: absolute; right: 14px; top: 19px; width: 20px; height: 20px; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .4s var(--ease);
}
.float-field.valid .field-ok { stroke-dashoffset: 0; }
.float-field.invalid input { border-color: var(--bad); }

/* password: venetian blinds that tilt open when you reveal it */
.pw-field input { padding-right: 52px; }
.blinds {
  position: absolute; inset: 1px 48px 1px 1px; border-radius: 13px 0 0 13px; overflow: hidden; pointer-events: none;
  display: grid; grid-template-rows: repeat(6, 1fr); perspective: 500px; visibility: hidden;
}
.blinds.active { visibility: visible; }
.slat {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 70%, #FFFFFF) 0%, var(--surface-3) 55%, color-mix(in srgb, var(--line-strong) 80%, var(--surface)) 100%);
  border-bottom: 1px solid var(--line); transform-origin: center; backface-visibility: hidden;
}
.reveal {
  position: absolute; right: 6px; top: 9px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease);
}
.reveal:hover { background: var(--surface-3); color: var(--brand); }
.reveal:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.reveal svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s; }
.reveal .eye-open { transform: scale(.4); opacity: 0; }
.reveal[aria-pressed="true"] .eye-open { transform: none; opacity: 1; }
.reveal[aria-pressed="true"] .eye-shut { transform: scale(.4); opacity: 0; }

.caps-warn { display: flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.caps-warn svg { width: 15px; height: 15px; fill: var(--accent); }

/* strength meter + live rules (sign up) */
.strength { display: grid; gap: 8px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.meter span { height: 6px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.meter span::after { content: ""; position: absolute; inset: 0; background: var(--lvl, var(--bad)); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.meter[data-level="1"] { --lvl: var(--bad); }
.meter[data-level="2"] { --lvl: var(--accent); }
.meter[data-level="3"] { --lvl: #2E8BF0; }
.meter[data-level="4"] { --lvl: var(--ok); }
.meter[data-level="1"] span:nth-child(-n+1)::after,
.meter[data-level="2"] span:nth-child(-n+2)::after,
.meter[data-level="3"] span:nth-child(-n+3)::after,
.meter[data-level="4"] span:nth-child(-n+4)::after { transform: scaleX(1); }
.meter span:nth-child(2)::after { transition-delay: .05s; }
.meter span:nth-child(3)::after { transition-delay: .1s; }
.meter span:nth-child(4)::after { transition-delay: .15s; }
.meter-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rules li {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); transition: all .3s var(--ease);
}
.rules em { font-style: normal; font-weight: 600; opacity: .8; }
.tick { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; position: relative; transition: all .3s cubic-bezier(.34,1.56,.64,1); }
.rules li.met { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.rules li.met .tick { background: var(--ok); border-color: var(--ok); transform: scale(1.1); }
.rules li.met .tick::after { content: ""; position: absolute; left: 3px; top: 0; width: 3px; height: 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* submit: label → spinner → check */
.submit { position: relative; min-height: 52px; overflow: hidden; }
.submit .spinner, .submit .done { position: absolute; left: 50%; top: 50%; }
.submit .spinner {
  width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff;
  transform: scale(0); transition: transform .25s var(--ease);
}
.submit .done { width: 24px; height: 24px; margin: -12px 0 0 -12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.submit-label { transition: transform .25s var(--ease); display: inline-block; }
.submit.is-loading .submit-label { transform: translateY(-40px); }
.submit.is-loading .spinner { transform: scale(1); animation: spin .8s linear infinite; }
.submit.is-done { background: linear-gradient(135deg, #197653, #1E8A61); box-shadow: 0 8px 22px rgba(25,118,83,.35); }
.submit.is-done .submit-label { transform: translateY(-40px); }
.submit.is-done .done { stroke-dashoffset: 0; transition: stroke-dashoffset .45s var(--ease); }
.submit:disabled { cursor: default; }
.submit.is-loading:disabled, .submit.is-done:disabled { opacity: 1; }

.auth-foot { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; color: var(--ink-3); }
.auth-foot svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

/* ---------------------------------------------------------------- motion */
@keyframes spin { to { transform: scale(1) rotate(360deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
/* `translate` composes with each card's own transform, so the stack keeps its fan while it floats */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

@media (prefers-reduced-motion: no-preference) {
  .stage-title .word { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
  .stage-title .word:nth-child(2) { animation-delay: .06s; }
  .stage-title .word:nth-child(4) { animation-delay: .14s; }
  .stage-title .word:nth-child(5) { animation-delay: .2s; }
  .auth-card { animation: rise .6s cubic-bezier(.2,.8,.2,1) both; }
  .qcard.q3 { animation: float 5s ease-in-out infinite; }
  .qcard.q2 { animation: float 5s ease-in-out .6s infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .stage *, .auth-card * { transition: none !important; animation: none !important; }
  .node .node-check { stroke-dashoffset: 0; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .stage { grid-template-rows: auto auto; gap: 8px; padding: 22px 20px 6px; }
  .stage-title { font-size: clamp(28px, 7vw, 40px); margin-top: 12px; }
  .flight { min-height: 210px; }
  .queue { transform: scale(.8); transform-origin: left bottom; }
  .stage-points { display: none; }
  .auth-panel { padding: 0 16px 32px; margin-top: -10px; }
}
@media (max-width: 420px) {
  .node-label { display: none; }
  .node { padding: 6px; }
}

/* ---------- Sign in with Google (Google brand guidelines: white button, colour G, Roboto-like weight) */
.sso { display: grid; gap: 14px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; height: 48px; border-radius: 12px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; text-decoration: none; font-weight: 600; font-size: 15px;
  transition: background .2s ease, box-shadow .2s ease;
}
.btn-google:hover { background: #f8faff; box-shadow: 0 1px 3px rgba(60, 64, 67, .3); }
.btn-google:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.g-logo { width: 20px; height: 20px; flex: none; }
.sso-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.sso-or::before, .sso-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* AI app consent (/oauth/authorize) */
.consent-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--canvas-glow), var(--canvas); }
.consent { width: min(100%, 520px); display: grid; gap: 14px; }
.consent h1 { font-size: clamp(20px, 4vw, 24px); line-height: 1.25; margin: 0; }
.consent-app { color: var(--accent-ink); }
.consent-brand { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 800; }
.consent-brand img { border-radius: 10px; }
.consent-form { display: grid; gap: 14px; }
.consent-form select { min-height: 44px; }
.consent-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.consent-form legend { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.consent-facts { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 420px) { .consent-actions .btn { flex: 1; } }
