/*
  Sign in, sign up and a new password. A form column and a brand panel; below
  the tablet width the panel goes and a short progress line takes its place.
  Opening an account happens once, so the panel gets one quiet entrance; the
  steps themselves change in under 300 ms, and only by opacity and a few pixels.
*/

.auth { padding: clamp(104px, 11vw, 132px) 0 var(--section); }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(40px, 6vw, 96px); align-items: start; }
.auth-main { max-width: 560px; min-width: 0; }
.auth-title { font-size: clamp(32px, 1.2rem + 2vw, 46px); font-weight: 300; letter-spacing: -0.026em; line-height: 1.08; margin-top: 14px; outline: none; }
.auth-lede { color: var(--ink-2); margin-top: 12px; font-size: 16.5px; max-width: 31.824em; }
.auth .app-notice { margin: 24px 0 0; }
.auth-step { margin-top: 32px; }
.auth-step h2 { font-size: 22px; font-weight: 400; letter-spacing: -0.012em; line-height: 1.25; outline: none; }
.auth-step > p { color: var(--ink-2); margin-top: 10px; }
.auth-step .hero-actions { margin-top: 24px; }

/* Forms */
.auth-form { display: grid; gap: 18px; }
.auth-form .field + .field { margin-top: 0; }
.auth-form .field input, .auth-form .field select { width: 100%; min-width: 0; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--error); }
.auth-form .form-error { margin-top: 0; }
.auth-for { color: var(--ink-2); font-size: 15px; }
.auth-for b { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.auth-fieldset { display: grid; gap: 14px; margin: 6px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.auth-fieldset legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-size: 15px; font-weight: 500; color: var(--ink); }
.auth-fieldset legend + * { clear: both; }
.auth-section-title { font-size: 15px; font-weight: 500; color: var(--ink); }

.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-width: 48px; padding: 6px 8px; border: 0; border-radius: var(--btn-r); background: transparent; color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pw-show:hover { background: var(--accent-bg); }
.pw-show:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-top a { font-size: 13.5px; color: var(--accent-ink); text-decoration: none; }
.field-top a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Business or personal */
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--ink); }
.choice-item { position: relative; display: grid; gap: 4px; padding: 16px 16px 16px 48px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; transition: border-color 0.15s var(--ease-ui), background-color 0.15s var(--ease-ui), box-shadow 0.15s var(--ease-ui); }
.choice-item input { position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.choice-item b { font-weight: 500; font-size: 15.5px; color: var(--ink); }
.choice-item small { font-size: 13.5px; line-height: 1.45; color: var(--mute); }
.choice-item:has(input:checked) { border-color: var(--primary); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice-item:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .choice-item:hover { border-color: var(--ghost-border); }
}

/* Agreements: the site's own check rows (site.css) */
.checks .check { color: var(--ink); font-size: 14.5px; }
.checks .check input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }
.checks .check small { display: block; color: var(--mute); font-size: 13px; margin-top: 2px; }
.checks .check a { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }

/* Google */
.btn-oauth { width: 100%; justify-content: center; gap: 10px; background: var(--dd-bg); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--lift-1); }
.btn-oauth:hover { border-color: var(--ink-2); }
.btn-oauth svg { width: 18px; height: 18px; flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 13px; color: var(--faint); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-submit { width: 100%; justify-content: center; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.auth-actions .btn-primary { flex: 1; justify-content: center; min-width: 180px; }
.auth-foot { font-size: 14px; color: var(--mute); }
.auth-foot a, .auth-step > p a { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }
.auth-as { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
/* Busy: the turning check after the label (auth.js, site.css "Waiting"), in place of the dots that grew one by one. */
.btn.is-busy { cursor: progress; }

/* Check your email */
.auth-mail { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-bg); color: var(--accent-ink); margin-bottom: 18px; }
.auth-mail svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-mail .flap { transform-origin: 14px 9px; }

/* Mobile progress, in place of the panel */
.auth-progress { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 24px; }
.auth-progress li { display: grid; gap: 6px; font-size: 12.5px; color: var(--faint); }
.auth-progress li::before { content: ""; height: 3px; border-radius: 2px; background: var(--line-strong); transition: background-color 0.2s var(--ease-ui); }
.auth-progress li[data-state="done"]::before, .auth-progress li[data-state="active"]::before { background: var(--primary); }
.auth-progress li[data-state="active"] { color: var(--ink); font-weight: 500; }

/* The brand panel */
.auth-panel { position: sticky; top: 96px; border-radius: var(--r-lg); background: var(--inv-bg); color: var(--inv-ink); overflow: hidden; isolation: isolate; }
.auth-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--inv-line) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(180deg, #000 0%, transparent 70%); }
.auth-panel-in { display: grid; gap: 28px; padding: clamp(28px, 3vw, 40px); }
.auth-panel-title { font-size: 24px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; max-width: 11.844em; }
.auth-panel-text { color: var(--inv-mute); font-size: 15px; max-width: 23.868em; margin-top: 10px; }

.rail { display: grid; gap: 0; }
.rail li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px; padding-bottom: 22px; }
.rail li:last-child { padding-bottom: 0; }
.rail li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: 4px; width: 1px; background: var(--inv-line); }
.rail li[data-state="done"]:not(:last-child)::after { background: var(--ruby); }
.rail-dot { grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--inv-line); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--inv-mute); transition: background-color 0.2s var(--ease-ui), border-color 0.2s var(--ease-ui), color 0.2s var(--ease-ui), transform 0.2s var(--ease-ui); }
.rail-dot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.rail b { font-weight: 500; font-size: 15px; padding-top: 5px; color: var(--inv-mute); transition: color 0.2s var(--ease-ui); }
.rail small { font-size: 13px; color: var(--inv-mute); line-height: 1.45; }
.rail li[data-state="active"] .rail-dot { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.08); box-shadow: 0 0 0 4px rgba(224, 36, 94, 0.22); }
.rail li[data-state="active"] b, .rail li[data-state="done"] b { color: var(--inv-ink); }
.rail li[data-state="done"] .rail-dot { background: transparent; border-color: var(--ruby); color: var(--ruby); }
.rail li[data-state="done"] .rail-dot span { display: none; }
.rail li[data-state="done"] .rail-dot svg { display: block; }

/* The finding card: what an account is for */
.artefact { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-md); background: var(--inv-calc); border: 1px solid var(--inv-line); font-size: 14px; }
.artefact-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--inv-mute); }
.artefact small { display: block; margin-bottom: 4px; font-size: 12px; color: var(--inv-mute); }
.artefact q { quotes: "\201C" "\201D"; color: var(--inv-ink); }
.artefact mark { position: relative; padding: 0 2px; color: inherit; background: none; isolation: isolate; }
.artefact mark::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 3px; transform-origin: left center; }
.artefact mark.claim::after { background: rgba(255, 213, 82, 0.42); }
.artefact mark.rule::after { background: rgba(255, 97, 24, 0.34); }
.artefact-verdict { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--inv-line); color: var(--inv-ink); font-size: 13.5px; }
.artefact-verdict svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ruby); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 0; }
.auth-gets { display: grid; gap: 10px; font-size: 14.5px; color: var(--inv-ink); }
.auth-gets li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.auth-gets svg { width: 16px; height: 16px; margin-top: 3px; fill: none; stroke: var(--ruby); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Motion: a step arrives; the panel comes in once; then the finding card plays over and over (Dusan, 29. 11.).
   The card is what an audit does, told in ten seconds: the dots behind drift, what the bot said writes itself and its
   claim is marked, the policy writes itself and its rule is marked, the verdict's check draws, the severity comes, and
   the three ticks below draw one by one; it rests, fades and starts again. Every part keys on the same 10s loop, each
   with its own keyframes, so the parts never drift apart. Writing is linear, as typing is; marks and ticks use the
   strong ease-out. With reduced motion none of this runs: the finished card stands still. */
@media (prefers-reduced-motion: no-preference) {
  .js .auth-step:not([hidden]) { animation: auth-in 0.26s cubic-bezier(0.23, 1, 0.32, 1); }
  .js .auth-panel-in > * { animation: auth-rise 0.6s cubic-bezier(0.23, 1, 0.32, 1) both; }
  .js .auth-panel-in > :nth-child(2) { animation-delay: 80ms; }
  .js .auth-panel-in > :nth-child(3) { animation-delay: 160ms; }
  .js .auth-panel-in > :nth-child(4) { animation-delay: 240ms; }
  .js .auth-step[data-step="inbox"]:not([hidden]) .flap { animation: auth-flap 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.15s both; }
  /* The dots drift one step of their grid, over and over, so the loop has no seam. Only the background moves; the fade
     that hides the dots lower down stays where it is. */
  .js .auth-panel::before { animation: panel-dots 4s linear infinite; }
  .js .artefact q { display: block; }
  .js .artefact p:nth-of-type(2) q { animation: card-write-1 10s infinite; }
  .js .artefact p:nth-of-type(3) small { animation: card-label-2 10s infinite; }
  .js .artefact p:nth-of-type(3) q { animation: card-write-2 10s infinite; }
  .js .artefact mark.claim::after { animation: card-claim 10s infinite; }
  .js .artefact mark.rule::after { animation: card-rule 10s infinite; }
  .js .artefact-verdict { animation: card-verdict 10s infinite; }
  .js .artefact-verdict svg { animation: card-verdict-tick 10s infinite; }
  .js .artefact-head .pill { animation: card-pill 10s infinite; }
  .js .auth-gets svg { stroke-dasharray: 16; }
  .js .auth-gets li:nth-child(1) { animation: card-get-1 10s infinite; }
  .js .auth-gets li:nth-child(2) { animation: card-get-2 10s infinite; }
  .js .auth-gets li:nth-child(3) { animation: card-get-3 10s infinite; }
  .js .auth-gets li:nth-child(1) svg { animation: card-tick-1 10s infinite; }
  .js .auth-gets li:nth-child(2) svg { animation: card-tick-2 10s infinite; }
  .js .auth-gets li:nth-child(3) svg { animation: card-tick-3 10s infinite; }
}
@media (prefers-reduced-motion: reduce) {
  /* !important: site.css's reduced-motion reset otherwise cuts this gentle fade to nothing. */
  .js .auth-step:not([hidden]) { animation: auth-fade 0.2s ease !important; }
}
@keyframes auth-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes auth-fade { from { opacity: 0; } }
@keyframes auth-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes auth-flap { from { transform: scaleY(-1); } }
@keyframes panel-dots { to { background-position: 18px 18px; } }
/* The card's loop, in tenths of its 10s: written by 1.8s and 4.3s, marked by 2.4s and 4.9s, the verdict by 5.7s, the
   severity by 6s, the ticks by 6.5s, 6.9s and 7.3s; it rests until 8.8s and is gone by 9.5s. */
@keyframes card-write-1 {
  0%, 3% { clip-path: inset(0 100% 0 0); opacity: 1; animation-timing-function: linear; }
  18%, 88% { clip-path: inset(0); opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { clip-path: inset(0); opacity: 0; }
}
@keyframes card-label-2 {
  0%, 25% { opacity: 0; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  28%, 88% { opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; }
}
@keyframes card-write-2 {
  0%, 28% { clip-path: inset(0 100% 0 0); opacity: 1; animation-timing-function: linear; }
  43%, 88% { clip-path: inset(0); opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { clip-path: inset(0); opacity: 0; }
}
@keyframes card-claim {
  0%, 18% { transform: scaleX(0); animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  24%, 100% { transform: scaleX(1); }
}
@keyframes card-rule {
  0%, 43% { transform: scaleX(0); animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  49%, 100% { transform: scaleX(1); }
}
@keyframes card-verdict {
  0%, 50% { opacity: 0; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  54%, 88% { opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; }
}
@keyframes card-verdict-tick {
  0%, 51% { stroke-dashoffset: 16; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  57%, 100% { stroke-dashoffset: 0; }
}
@keyframes card-pill {
  0%, 56% { opacity: 0; transform: scale(0.92); animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  60%, 88% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; transform: scale(1); }
}
@keyframes card-get-1 {
  0%, 61% { opacity: 0; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  64%, 88% { opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; }
}
@keyframes card-get-2 {
  0%, 65% { opacity: 0; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  68%, 88% { opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; }
}
@keyframes card-get-3 {
  0%, 69% { opacity: 0; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  72%, 88% { opacity: 1; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  95%, 100% { opacity: 0; }
}
@keyframes card-tick-1 {
  0%, 61% { stroke-dashoffset: 16; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  65%, 100% { stroke-dashoffset: 0; }
}
@keyframes card-tick-2 {
  0%, 65% { stroke-dashoffset: 16; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  69%, 100% { stroke-dashoffset: 0; }
}
@keyframes card-tick-3 {
  0%, 69% { stroke-dashoffset: 16; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }
  73%, 100% { stroke-dashoffset: 0; }
}

@media (max-width: 1023px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-main { max-width: 600px; }
  .auth-panel { display: none; }
  .auth-progress { display: grid; }
  /* What is paid and the refund policy stay in sight of the payment, on any screen. */
  .page-checkout .auth-panel { display: block; position: relative; top: auto; max-width: 600px; }
}
@media (max-width: 560px) {
  .choice { grid-template-columns: minmax(0, 1fr); }
  .auth-actions .btn { flex: 1 1 100%; }
}
