/* =========================================================================
   Authify — Design Tokens
   Direction: quiet, precise, "instrument panel" minimalism — closer to a
   security/trust product (1Password, Stripe Radar) than a generic SaaS.
   Signature element: the verification result uses a single animated seal
   (a drawn circular check-ring) rather than a stock checkmark icon.
   ========================================================================= */
:root {
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Neutrals */
  --ink-900: #0B0C0E;
  --ink-700: #33363B;
  --ink-500: #6B6F76;
  --ink-300: #C7CAD1;
  --ink-100: #ECEDF0;
  --paper:   #FAFAFA;
  --white:   #FFFFFF;

  /* Brand + status — tenant primary/button colors override these at runtime
     via inline CSS custom properties set from tenant_branding. */
  --brand: #2E3A8C;        /* deep indigo — "trust" without being corporate-blue */
  --brand-ink: #FFFFFF;
  --success: #12805C;
  --success-bg: #E7F5EF;
  --warning: #B4590E;
  --warning-bg: #FDF1E6;
  --danger: #B3261E;
  --danger-bg: #FBEAE9;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(11,12,14,0.06);
  --shadow-md: 0 8px 24px rgba(11,12,14,0.08);
  --shadow-lg: 0 24px 64px rgba(11,12,14,0.12);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.font-display { font-family: var(--font-display); letter-spacing: -0.02em; }
.text-mono { font-family: var(--font-mono); }

/* ---------- Public verification page ---------- */
#verifyRoot { transition: opacity .15s ease; }

.verify-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 480px) 1fr;
}
@media (max-width: 900px) {
  /* Mobile stacking order: verification form first (that's the job the
     visitor came to do), then the How It Works flow, then the hero
     video/image, then the shared footer (which follows this shell in the
     DOM already). Previously .verify-visual was forced to the top with
     order:-1, burying the form below a video on first load — removed so
     natural DOM order (form pane, then visual pane) applies instead. */
  .verify-shell { grid-template-columns: 1fr; }
  .verify-visual { min-height: 0; }
  .visual-content { padding: 32px 24px; gap: 32px; }
}

.verify-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  background: var(--white);
}
@media (max-width: 560px) { .verify-form-pane { padding: 40px 24px; } }

.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.brand-row img { height: 32px; width: auto; }
.brand-row .brand-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; }

.verify-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-500); margin-bottom: 14px;
}
.verify-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.verify-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.verify-subtitle { color: var(--ink-500); font-size: 15px; line-height: 1.6; margin-bottom: 36px; max-width: 40ch; }

.af-field { margin-bottom: 20px; }
.af-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 8px; }
.af-input {
  width: 100%;
  border: 1.5px solid var(--ink-100);
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  font-size: 16px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.af-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}
.af-input::placeholder { color: var(--ink-300); font-family: var(--font-body); letter-spacing: normal; }

.af-submit {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  background: var(--button, var(--brand));
  color: var(--brand-ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.af-submit:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.af-submit:active { transform: translateY(0); }
.af-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.af-trust-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 28px; font-size: 12.5px; color: var(--ink-500);
}

.verify-visual {
  position: relative;
  background: linear-gradient(160deg, var(--ink-900), #1c2033 65%);
  overflow: hidden;
}
.verify-visual .grid-overlay {
  position: absolute; inset: 0; z-index: 1;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.visual-content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px;
  gap: 24px;
}

.visual-how-it-works-title {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.6);
  margin-bottom: 18px;
}

/* Horizontal step flow: a thin connecting track runs behind the numbered
   nodes, and animates in left-to-right on load so the sequence itself
   reads as "flow" rather than a static list. Each step also fades/rises
   in with a small stagger driven by --step-index. */
.visual-how-it-works-steps {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.hiw-track {
  position: absolute;
  left: calc(100% / var(--step-count) / 2);
  right: calc(100% / var(--step-count) / 2);
  top: 15px;
  height: 2px;
  background: rgba(255,255,255,.14);
  border-radius: 2px;
  z-index: 0;
}
.hiw-track-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #ffffff));
  animation: hiw-fill 1.4s cubic-bezier(.65,0,.35,1) forwards .3s;
}
@keyframes hiw-fill { to { width: 100%; } }

.visual-how-it-works-step {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: hiw-step-in .5s ease forwards;
  animation-delay: calc(.35s + var(--step-index) * .18s);
}
@keyframes hiw-step-in { to { opacity: 1; transform: translateY(0); } }

.visual-how-it-works-step .step-number {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.22);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(11,12,14,0);
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.visual-how-it-works-step .step-number span { transform: translateY(-.5px); }
.visual-how-it-works-step:hover .step-number {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent);
}

.step-copy { max-width: 15ch; }
.visual-how-it-works-step .step-title { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.3; }
.visual-how-it-works-step .step-description { color: rgba(255,255,255,.55); font-size: 11.5px; line-height: 1.4; margin-top: 3px; }

@media (max-width: 560px) {
  .step-copy { max-width: 12ch; }
  .visual-how-it-works-step .step-description { display: none; }
}

.visual-media-slot {
  flex: 1; min-height: 0; border-radius: var(--radius-lg); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.03);
}
.visual-media-slot img, .visual-media-slot video, .visual-media-slot iframe {
  width: 100%; height: 100%; object-fit: cover; border: 0;
}

.verify-visual .caption {
  color: var(--white); font-family: var(--font-display); font-size: 18px; line-height: 1.5; max-width: 36ch;
}

.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-500);
}
.trust-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ---------- Result page ---------- */
.result-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px; }
.result-card {
  width: 100%; max-width: 560px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 56px 48px;
  text-align: center;
}
@media (max-width: 560px) { .result-card { padding: 40px 24px; } }

/* Embedded result (verify.blade.php's in-page AJAX result, injected into
   .verify-form-pane) — that pane is already the white, padded "container",
   so the result shouldn't box itself again on top of it. Only the full-page
   fallback (result.blade.php, no-JS path) keeps the centered standalone
   card look above. */
.result-shell--embedded {
  min-height: 0;
  display: block;
  padding: 0;
}
.result-shell--embedded .result-card {
  width: 100%; max-width: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
}

/* Result seal — a smaller, filled badge instead of a bare outline, with a
   soft one-shot pulse ring behind it (a "ping" halo, iOS-notification style)
   for a more polished, attention-earning moment on genuine results, and a
   gentle bounce as the badge itself scales in. */
.seal-wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
}
.seal-halo {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--seal-color, var(--success));
  opacity: .35;
  animation: seal-halo-ping 1s cubic-bezier(0,0,.2,1) forwards .05s;
}
@keyframes seal-halo-ping {
  0% { transform: scale(.7); opacity: .35; }
  100% { transform: scale(1.9); opacity: 0; }
}

.seal {
  position: relative; z-index: 1;
  width: 96px; height: 96px;
  transform: scale(.6);
  opacity: 0;
  animation: seal-pop .5s cubic-bezier(.34,1.56,.64,1) forwards .05s;
}
@keyframes seal-pop { to { transform: scale(1); opacity: 1; } }

.seal circle.seal-fill {
  fill: var(--seal-color, var(--success));
  opacity: 1;
}
.seal circle.ring {
  fill: none; stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 289; stroke-dashoffset: 289;
  animation: draw-ring .6s cubic-bezier(.65,0,.35,1) forwards .15s;
}
.seal path.check {
  fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw-check .3s ease forwards .68s;
}
.seal path.cross {
  fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw-check .3s ease forwards .6s;
}
.seal path.bang-stem {
  fill: none; stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: draw-check .25s ease forwards .6s;
}
.seal circle.bang-dot {
  opacity: 0;
  animation: bang-dot-in .2s ease forwards .85s;
}
@keyframes bang-dot-in { to { opacity: 1; } }
@keyframes draw-ring { to { stroke-dashoffset: 0; } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .seal-halo, .seal, .seal circle.ring, .seal path.check, .seal path.cross,
  .seal path.bang-stem, .seal circle.bang-dot, .hiw-track-fill, .visual-how-it-works-step {
    animation: none !important; opacity: 1 !important; transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

.result-status { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin-bottom: 8px; }
.result-sub { color: var(--ink-500); font-size: 15px; margin-bottom: 32px; }

.result-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
}
.result-badge.ok { background: var(--success-bg); color: var(--success); }
.result-badge.warn { background: var(--warning-bg); color: var(--warning); }
.result-badge.danger { background: var(--danger-bg); color: var(--danger); }

.result-grid {
  text-align: left; border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 20px 24px; margin-bottom: 24px;
}
.result-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; }
.result-row + .result-row { border-top: 1px solid var(--ink-100); }
.result-row .k { color: var(--ink-500); }
.result-row .v { font-weight: 600; font-family: var(--font-mono); }

.result-footer-note { font-size: 13px; color: var(--ink-500); line-height: 1.6; }

/* ---------- Public footer (shared) ---------- */

/* Full-width split footer: trust badge + support info anchored left,
   legal/social links anchored right. Wraps to a stacked, left-aligned
   layout on narrow screens rather than collapsing to centered text. */
.public-footer {
  width: 100%; margin: 0 auto; padding: 24px 32px 40px;
  border-top: 1px solid var(--ink-100);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.public-footer-left { text-align: left; }
.trust-badge { justify-content: flex-start !important; margin-bottom: 8px; }
.public-footer-support { font-size: 13.5px; color: var(--ink-700); margin-bottom: 0; text-align: left; }
.public-footer-support a { color: var(--brand); text-decoration: none; }
.public-footer-powered { font-size: 12px; color: var(--ink-500); margin-top: 8px; }
.public-footer-powered strong { color: var(--ink-700); }
.public-footer-links { display: flex; justify-content: flex-end; align-items: center; gap: 20px; flex-wrap: wrap; }
.public-footer-links a { font-size: 13px; color: var(--ink-500); text-decoration: none; }
.public-footer-links a:hover { color: var(--ink-900); }

@media (max-width: 640px) {
  .public-footer { flex-direction: column; align-items: flex-start; padding: 24px 24px 40px; }
  .public-footer-links { justify-content: flex-start; }
}
