/* Auth area layout: sign in, sign up, forgot password, OTP, invitation and switching-profile
   screens (the profile gateway lives in gateway.css). Tokens only, loaded after pages.css. */

/* ---------- card frame and shared head ---------- */
.auth-card { gap: var(--s-6); outline: none; }
.auth-body { display: flex; flex-direction: column; gap: var(--s-5); }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.auth-head-ic {
  width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--on-soft); margin-bottom: var(--s-2);
}
.auth-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-400); }
.auth-title { font-size: var(--fs-page); line-height: 28px; font-weight: var(--fw-page); color: var(--ink-900); }
.auth-lead { color: var(--ink-600); max-width: 340px; }
.auth-lead strong { color: var(--ink-900); font-weight: 600; white-space: nowrap; }
.auth-foot { text-align: center; font-size: 13px; color: var(--ink-600); }
.auth-foot a { font-weight: 600; }
.auth-divider { height: 1px; background: var(--line); margin: 0; border: 0; }
.auth-note { font-size: 13px; color: var(--ink-600); text-align: center; }
.auth-note a { font-weight: 600; }
.auth-back { align-self: flex-start; margin-left: calc(-1 * var(--s-3)); }
.auth-form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-form .btn-primary { margin-top: var(--s-1); }
.auth-required { font-size: 12px; color: var(--ink-400); margin-top: calc(-1 * var(--s-2)); }

/* the shared error line is display:flex, which would beat the hidden attribute */
.error-text[hidden] { display: none; }

/* label with a trailing link (Password ... Forgot password?) */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.label-row a { font-size: 13px; font-weight: 600; }
.label-row label { font-size: 13px; font-weight: 600; color: var(--ink-900); }

/* password strength: 4 segments + a label */
.pw-meter { display: flex; align-items: center; gap: var(--s-3); margin-top: 2px; }
.pw-bars { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pw-bars span { height: 4px; border-radius: var(--r-full); background: var(--line-strong); transition: background-color .2s ease; }
.pw-meter[data-score="1"] .pw-bars span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score="2"] .pw-bars span:nth-child(-n+2) { background: var(--amber-500); }
.pw-meter[data-score="3"] .pw-bars span:nth-child(-n+3) { background: var(--green-500); }
.pw-meter[data-score="4"] .pw-bars span { background: var(--green-700); }
.pw-meter-label { font-size: 12px; font-weight: 600; color: var(--ink-400); min-width: 48px; text-align: right; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px var(--s-4); font-size: 12px; color: var(--ink-400); }
.pw-rules li { display: inline-flex; align-items: center; gap: 4px; }
.pw-rules li .ic { width: 14px; height: 14px; }
.pw-rules li.is-met { color: var(--green-700); }

/* ---------- OTP ---------- */
.otp-row { display: flex; gap: var(--s-2); justify-content: center; }
.otp-row .otp-digit { width: 48px; height: 56px; padding: 0; text-align: center; font-size: 22px; font-weight: 700; color: var(--ink-900); }
.otp-row .otp-digit.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--crimson-50); }
.otp-row .otp-gap { margin-left: var(--s-3); }
@media (max-width: 420px) {
  .otp-row { gap: 6px; }
  .otp-row .otp-digit { width: 44px; height: 52px; font-size: 20px; }
  .otp-row .otp-gap { margin-left: 0; }
}
.resend-row { display: flex; align-items: center; justify-content: center; gap: var(--s-2); font-size: 13px; color: var(--ink-600); flex-wrap: wrap; }
.resend-row .btn[disabled] { opacity: 1; color: var(--ink-400); background: var(--field); }
.resend-time { font-variant-numeric: tabular-nums; }

/* ---------- invitation (single) ---------- */
.inv-hero { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center; }
.inv-details { margin: 0; border: 1px solid var(--line-strong); border-radius: var(--r-card); }
.inv-details > div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) var(--s-4); align-items: baseline; }
.inv-details > div + div { border-top: 1px solid var(--line); }
.inv-details dt { font-size: 13px; color: var(--ink-600); font-weight: 500; }
.inv-details dd { margin: 0; font-weight: 600; min-width: 0; }
.inv-details dd .t-meta { display: block; font-weight: 500; }
.inv-can { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-card); background: var(--soft); color: var(--on-soft); font-size: 13px; line-height: 19px; }
.inv-can .ic { flex-shrink: 0; margin-top: 1px; }
.inv-actions { display: flex; justify-content: flex-end; gap: var(--s-3); }
.inv-actions .btn { min-width: 120px; }
@media (max-width: 480px) {
  .inv-details > div { grid-template-columns: 1fr; gap: 2px; }
  .inv-actions .btn { flex: 1 1 0; min-width: 0; }
}

/* blocking state: gateway rows inside the card */
.blocking-list { margin: 0 calc(-1 * var(--s-8)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.blocking-list .gw-invite { padding: var(--s-4) var(--s-8); grid-template-columns: 48px minmax(0, 1fr) auto; }
.blocking-list .crest-56 { width: 48px; height: 48px; font-size: 16px; }
.blocking-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.blocking-count { font-size: 13px; color: var(--ink-600); }
@media (max-width: 640px) {
  .blocking-list { margin: 0 calc(-1 * var(--s-6)); }
  .blocking-list .gw-invite { padding: var(--s-4) var(--s-6); grid-template-columns: 48px minmax(0, 1fr); }
  .blocking-list .gw-invite-actions { grid-column: 1 / -1; }
  .blocking-list .gw-invite-actions .btn { flex: 1 1 0; }
  .blocking-foot .btn { width: 100%; }
}

/* ---------- switching ---------- */
.switch-page { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; }
.switch-crest { width: 72px; height: 72px; font-size: 24px; margin-bottom: var(--s-2); }
.switch-steps { list-style: none; margin: var(--s-2) 0 0; padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-card); }
.switch-step { display: flex; align-items: center; gap: var(--s-3); font-size: 14px; color: var(--ink-400); transition: color .2s ease; }
.switch-step-dot { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line-strong); color: transparent; }
.switch-step-dot .ic { width: 14px; height: 14px; }
.switch-step.is-active { color: var(--ink-900); font-weight: 600; }
.switch-step.is-active .switch-step-dot { border-color: var(--soft); border-top-color: var(--primary); animation: switch-spin .8s linear infinite; }
.switch-step.is-done { color: var(--ink-900); }
.switch-step.is-done .switch-step-dot { border: 0; color: var(--success); }
.switch-step.is-done .switch-step-dot .ic { width: 24px; height: 24px; }
@keyframes switch-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .switch-step.is-active .switch-step-dot { animation: none; border-color: var(--primary); } }
.switch-continue { text-align: center; font-size: 13px; color: var(--ink-600); }
.switch-continue a { font-weight: 600; }

/* ---------- account view ---------- */
.account-card { max-width: 520px; width: 100%; margin: 0 auto var(--s-6); }
.account-row { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-row dt { color: var(--ink-400); font-size: 13px; font-weight: 600; }
.account-row dd { margin: 0; font-weight: 600; text-align: right; }

@media (max-width: 480px) {
  .auth-card { gap: var(--s-5); }
}
.auth-dest { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 15px; }
.auth-dest strong { font-weight: 600; letter-spacing: .02em; }
.auth-dest a { font-size: 13px; font-weight: 600; }
.auth-dest a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-2); }

