/* ==========================================================================
   fAIvita app styles. Tokens match the website (see docs/PRODUCT.md §5).
   ========================================================================== */
:root {
  --white: #ffffff; --gray: #f5f5f7; --gray-2: #ebebf0; --black: #000;
  --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #86868b; --hair: #d2d2d7;
  --accent: #0a7fa8; --accent-hover: #0b8cb8; --ring: rgba(10, 127, 168, .14);
  --teal: #1a9baa; --navy: #16213d; --danger: #d70015; --success: #248a3d;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1); --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Helvetica, Arial,
    "Noto Sans", "Noto Sans Devanagari", "Noto Sans Tamil", "Noto Sans Bengali", "Noto Sans Telugu", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.47059;
  letter-spacing: -0.022em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: rgba(10, 127, 168, .18); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  border-radius: 980px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 400; position: relative;
  transition: background .2s var(--ease), opacity .2s, transform .15s; }
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: default; transform: none; background: var(--accent); }
.btn-block { width: 100%; }
.btn.loading span { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.link::after { content: " ›"; }
.link-btn { color: var(--accent); }
.link-btn:disabled { color: var(--ink-3); cursor: default; }
.link-btn:not(:disabled):hover { text-decoration: underline; }

/* ---------- auth layout ---------- */
body.auth { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--white); }
.auth-head { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 max(22px, 4vw); }
.auth-head .brand img { height: 22px; width: auto; }
.auth-head .help { font-size: 14px; color: var(--ink-2); }
.auth-head .help:hover { color: var(--ink); }
.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: clamp(24px, 6vh, 72px) 22px 48px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-card.center { padding-top: 10vh; }
.mark-wrap { width: 76px; margin: 0 auto 28px; }
.mark { width: 100%; height: auto; overflow: visible; }
.mark .seg { stroke-width: 6; stroke-linejoin: round; fill-opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.1s var(--ease) forwards, fillin .6s var(--ease) forwards;
  animation-delay: calc(var(--i) * .09s), calc(var(--i) * .09s + .75s); }
.mark .navy { fill: var(--navy); stroke: var(--navy); }
.mark .teal { fill: var(--teal); stroke: var(--teal); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { fill-opacity: 1; stroke-width: 0; } }
.nf-mark { margin: 0 auto 28px; }
.auth-card h1 { margin: 0; font-size: 32px; line-height: 1.125; font-weight: 600; letter-spacing: .004em; }
.auth-card .sub { margin: 10px 0 0; color: var(--ink-2); font-size: 17px; }
.auth-card .sub strong { color: var(--ink); font-weight: 600; }
.auth-card > .btn { margin-top: 32px; }

.google-slot { margin-top: 32px; display: flex; justify-content: center; min-height: 44px; }
.btn-google { margin-top: 32px; width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--hair); border-radius: 980px; font-size: 15px; font-weight: 500; background: #fff; transition: background .2s; }
.btn-google:hover { background: var(--gray); }
.btn-google svg { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--ink-3); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

.form { display: grid; gap: 12px; text-align: left; }
.form .btn { margin-top: 8px; }
.field { position: relative; }
.field input, .field select { width: 100%; height: 56px; padding: 22px 16px 6px; border: 1px solid var(--hair); border-radius: 12px; background: #fff;
  font: inherit; font-size: 17px; color: var(--ink); letter-spacing: -0.022em; appearance: none; -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.field label { position: absolute; left: 17px; top: 17px; color: var(--ink-3); font-size: 17px; pointer-events: none; transform-origin: left top;
  transition: transform .2s var(--ease), color .2s; }
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field.select label { transform: translateY(-10px) scale(.7); }
.field input:focus + label, .field select:focus + label { color: var(--accent); }
.field.select select { padding-right: 44px; cursor: pointer; }
.field .chev { position: absolute; right: 16px; top: 20px; width: 16px; height: 16px; color: var(--ink-2); pointer-events: none; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field.invalid input:focus { box-shadow: 0 0 0 4px rgba(215, 0, 21, .12); }

.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; font-size: 14px; color: var(--ink-2); line-height: 1.45;
  padding: 6px 2px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--hair); margin-top: 1px; display: grid; place-items: center;
  transition: background .15s, border-color .15s; }
.check .box::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0; transition: opacity .15s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box::after { opacity: 1; }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px var(--ring); border-color: var(--accent); }
.check a { color: var(--accent); }
.check.invalid .box { border-color: var(--danger); }

.form-error { position: relative; margin: 2px 0 0; padding-left: 22px; font-size: 14px; line-height: 1.45; color: var(--danger); }
.form-error::before { content: "!"; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.form-error a { color: var(--accent); text-decoration: underline; }
.form-error[hidden] { display: none; }

.switch { margin: 28px 0 0; font-size: 15px; color: var(--ink-2); }
.timer { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fine { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.fine a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.fine .lock { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 28px; }
.otp input { width: 100%; aspect-ratio: 5/6; max-height: 64px; text-align: center; font: inherit; font-size: 28px; font-weight: 600; letter-spacing: 0;
  border: 1px solid var(--hair); border-radius: 12px; color: var(--ink); background: #fff; caret-color: var(--accent);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.otp input.filled { border-color: var(--ink-3); }
.otp.invalid input { border-color: var(--danger); }
.otp.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.auth-foot { display: flex; justify-content: center; align-items: center; gap: 8px 20px; flex-wrap: wrap; padding: 20px 22px 28px;
  font-size: 12px; color: var(--ink-3); }
.auth-foot nav { display: flex; gap: 16px; }
.auth-foot a:hover { color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-size: 14px;
  padding: 11px 18px; border-radius: 980px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease-out);
  z-index: 100; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .auth-card h1 { font-size: 28px; }
  .otp { gap: 6px; }
  .otp input { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}
