/* v19 auth pages (login, register, verify-email, accept-invitation). Builds on css/site.css:
   .auth / .auth-panel / .auth-main / .auth-card / .field / .input-wrap / .check / .notice / .secret-box.
   Behaviour hooks the page JS toggles (inline display, .loading, .valid/.invalid, .show/.success/.error) are all styled here. */

.auth-panel .brand { color: var(--ink); }
.auth-panel .panel-copy .h2 { font-size: clamp(24px, 2.4vw, 40px); margin-bottom: 18px; }
.auth-panel .panel-copy .fine { margin: 0; font-size: 13px; letter-spacing: .08em; color: var(--ink-2); }
.auth-panel .panel-copy .fine::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: #2f6bff; box-shadow: 0 0 10px #2f6bff; vertical-align: 1px; }
.auth-panel { background: radial-gradient(ellipse 70% 50% at 50% 46%, rgba(47,107,255,.12), transparent 70%), var(--band-bg); box-shadow: 1px 0 0 var(--band-edge); }

.auth-main { position: relative; align-content: center; grid-template-columns: minmax(0, 1fr); }
.auth-card { position: relative; }
.auth-card h1.h2 { margin-bottom: 10px; }
.auth-card .lede { margin-bottom: 26px; }
.auth-card .btn { height: 56px; }
.auth-card .btn-sm { height: 44px; }
.auth-card a:not(.btn) { color: var(--accent); text-underline-offset: 3px; text-decoration-color: var(--link-u); }
.auth-card a:not(.btn):hover { text-decoration-color: currentColor; }

/* ---- login: state containers (JS sets style.display flex/none/block) ---- */
.login-form { display: flex; flex-direction: column; }
.login-form .btn { margin-top: 6px; }
.state-lead { margin: 0 0 22px; font: 400 15.5px/1.55 var(--body); color: var(--ink-2); }
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -4px 0 8px; }
.form-options .check { align-items: center; gap: 10px; font-size: 14.5px; }
.form-options .check input { margin: 0; }
.form-options .check label { cursor: pointer; }
.forgot-password { font: 400 14.5px/1.4 var(--body); color: var(--accent); text-underline-offset: 3px; }
.auth-alt .forgot-password { font-size: 14.5px; }
.code-input { font-family: var(--mono); letter-spacing: .3em; text-align: center; font-size: 20px; }
.code-input::placeholder { letter-spacing: .3em; }
.input-wrap .form-input { padding-right: 56px; }
.input-wrap .icon-btn { top: 6px; right: 6px; border: 0; background: none; cursor: pointer; font-size: 15px; }
.input-wrap .icon-btn:hover { background: var(--hair-soft); }

.verified-banner { display: none; margin: 0 0 22px; align-items: center; }
.verified-banner p { margin: 0; }
.unverified-notice { display: none; margin: 18px 0 0; }
.unverified-notice p { margin: 0 0 12px; }
.unverified-notice .btn { margin-top: 0; width: auto; }
.inline-error-text { display: none; margin: 0; color: var(--alert-ink); font: 400 13.5px/1.4 var(--body); }
.mfa-secret-box { cursor: pointer; font-size: 13.5px; }
.mfa-secret-box:hover, .mfa-secret-box:focus { outline: none; border-color: var(--accent-2); border-style: solid; box-shadow: 0 0 0 3px rgba(47,107,255,.2); }
.mfa-secret-box:empty { min-height: 22px; }
.mfa-uri-box { cursor: text; color: var(--ink-2); font-size: 12px; }

.auth-divider { display: flex; align-items: center; gap: 16px; margin: 28px 0 4px; font: 500 11px/1 var(--head); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.demo-btn { margin-top: 14px; }
.demo-btn[disabled] { opacity: .7; }
.security-note { display: flex; gap: 10px; align-items: flex-start; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--hair-soft); font: 400 13px/1.5 var(--body); color: var(--ink-2); }
.security-note i { margin-top: 3px; color: var(--accent); }

/* ---- buttons with the original loading contract ---- */
.btn .loading-spinner { display: none; width: 18px; height: 18px; border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; border-radius: 50%; animation: auth-spin .8s linear infinite; }
.btn.loading .loading-spinner { display: block; }
.btn.loading .btn-text { display: none; }
.btn .button-content { display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.btn .button-content .loading-spinner { display: none; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---- state panels (verify-email, accept-invitation, register states) ---- */
.state-panel { text-align: center; display: block; }
.state-icon { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair); background: var(--field-bg); color: var(--ink); font-size: 24px; box-shadow: 0 10px 24px -14px rgba(0,0,0,.45); }
.state-icon.success { color: var(--ok-ink); border-color: rgba(48,179,80,.45); background: rgba(48,209,88,.1); }
.state-icon.error { color: var(--alert-ink); border-color: rgba(255,59,48,.45); background: rgba(255,59,48,.07); }
.state-icon.loading i { animation: auth-spin 1s linear infinite; color: var(--accent-2); }
.state-title, .state-panel .h2 { margin-bottom: 12px; }
.state-subtitle, .state-panel > p { margin: 0 0 20px; font: 400 15.5px/1.6 var(--body); color: var(--ink-2); }
.state-panel .btn { margin-top: 6px; }
.state-panel .auth-alt { margin-top: 8px; }
.state-card { max-width: 480px; }
.state-panel .field, .state-panel .hp { text-align: left; }
.state-panel .field { margin-top: 8px; }
.resend-hint { margin: 14px 0 0; font: 400 13.5px/1.5 var(--body); color: var(--ink-2); }
.resend-hint:empty { display: none; }
.verify-email-address { color: var(--ink); word-break: break-all; font-size: .9em; }

/* ---- accept-invitation ---- */
.invitation-header { text-align: center; }
.invitation-header .state-icon { margin-bottom: 18px; }
.invitation-email { margin: 0 0 24px; padding: 12px 16px; text-align: center; border: 1px dashed var(--hair); border-radius: 12px; background: var(--field-bg); font-size: 14px; word-break: break-all; }
.invitation-email:empty { display: none; }
.invitation-form .btn { margin-top: 8px; }
.invitation-form .btn[disabled] i { margin-right: 4px; }
.password-requirements { margin-top: 2px; }
#formState .login-link, #formState .auth-alt { margin-top: 22px; }

/* ---- register ---- */
.auth-main--wide { align-content: start; padding-top: clamp(40px, 6vw, 88px); }
.reg-wrap { width: 100%; max-width: 580px; margin-inline: auto; }
.progress-header { margin-bottom: 22px; }
.progress-bar { height: 3px; margin-bottom: 18px; background: var(--hair); overflow: hidden; border-radius: 3px; }
.progress-fill { width: 100%; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.progress-header .progress-text { margin-bottom: 14px; font-size: 11.5px; }
.progress-header .page-title { font-size: clamp(24px, 2.4vw, 38px); margin-bottom: 10px; }
.progress-header .page-subtitle { margin: 0; font-size: 16px; }
.registration-layout { display: flex; flex-direction: column; gap: 18px; }
.registration-layout .registration-form { order: 2; max-width: none; padding: clamp(24px, 3vw, 40px); }
.registration-layout .plan-summary { order: 1; }
.plan-summary { padding: 22px 24px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--shadow-card), inset 0 1px 0 var(--card-hi); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.plan-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plan-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair); background: var(--field-bg); color: var(--ink); font-size: 18px; }
.plan-details { flex: 1; min-width: 140px; }
.plan-details .h3 { margin: 0 0 4px; }
.plan-details p { margin: 0; font: 400 13px/1.4 var(--mono); letter-spacing: .02em; color: var(--ink-2); }
.plan-pricing { text-align: right; margin-left: auto; }
.plan-price { display: block; font-size: 22px; line-height: 1.1; color: var(--ink); }
.plan-period { margin-top: 4px; font: 400 12px/1.3 var(--mono); color: var(--ink-2); }
.plan-features { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--hair); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.plan-features li { font: 400 14px/1.45 var(--body); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.plan-features li i { margin-top: 4px; font-size: 11px; color: var(--accent-2); }
.form-section + .form-section { margin-top: 4px; }
.section-title { display: flex; align-items: baseline; gap: 14px; margin: 0 0 22px; font: 500 13px/1.3 var(--head); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); }
.section-number { font-size: 12px; letter-spacing: .1em; color: var(--accent); }
.opt { font-family: var(--body); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-2); font-size: 12.5px; }
.account-type-hint i { margin-right: 4px; }
#passwordStrength { display: none; }
.validation-message { margin: 0; }
.validation-message.show.success { color: var(--ok-ink); }
.validation-message.show.error { color: var(--alert-ink); }
.form-group.invalid input:not([type="checkbox"]) { border-color: var(--alert); }
.form-group.valid input:not([type="checkbox"]) { border-color: rgba(48,179,80,.7); }
.terms-group { margin: 4px 0 24px; align-items: flex-start; }
.terms-group .terms-checkbox { margin-top: 3px; }
.terms-text { font-size: 14.5px; line-height: 1.55; }
#registrationForm .btn, #waitlistState .btn { width: 100%; }
.trust-indicators { margin: 22px 0 0; justify-content: center; gap: 6px 18px; }
.trust-indicators li::before { content: none; }
.trust-indicators i { margin-right: 6px; color: var(--accent); }
.waitlist-state .btn, .verify-email-state .btn { width: 100%; }
#waitlistNote { min-height: 0; }

/* ---- phone ---- */
@media (max-width: 720px) {
  .auth-card { padding: 24px 20px; }
  .auth-main--wide { padding-top: 28px; }
  .plan-features { grid-template-columns: 1fr; }
  .plan-pricing { margin-left: 0; text-align: left; width: 100%; padding-top: 12px; border-top: 1px solid var(--hair-soft); display: flex; align-items: baseline; gap: 12px; }
  .plan-period { margin-top: 0; }
  .form-options { gap: 10px; }
  .auth-panel .brand span { letter-spacing: .24em; }
}
@media (max-width: 1100px) {
  .auth-panel { box-shadow: 0 1px 0 var(--band-edge); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-panel .panel-copy { display: none; }
  /* stacked layout: reserve a row for the floating theme toggle so it never overlaps the card or the progress line */
  .auth-main, .auth-main--wide { padding-top: 68px; padding-bottom: 40px; }
}
@media (min-width: 2200px) {
  .auth-card { max-width: 600px; padding: 52px; }
  .reg-wrap { max-width: 800px; }
  .state-card { max-width: 660px; }
  .auth-panel .panel-copy .h2 { font-size: clamp(40px, 2.4vw, 64px); }
  .auth-card .btn { height: 68px; }
  .state-lead, .state-subtitle, .terms-text { font-size: 18px; }
  .plan-features li { font-size: 17px; }
  .plan-price { font-size: 30px; }
}

/* ---- hero3d in the dark panel (js/hero3d.js; the CSS emblem inside is the no-WebGL fallback) ---- */
.auth-panel .hero-art[data-hero] { margin: auto; width: min(40vw, 560px); --h3-ar: 1.45; }
.auth-panel .hero-art[data-hero] > .emblem { margin: 0; --s: 100%; }
@media (min-width: 2200px) { .auth-panel .hero-art[data-hero] { width: min(32vw, 900px); } }
@media (max-width: 1100px) { .auth-panel .hero-art[data-hero] { width: 168px; margin: 0 0 0 auto; --h3-ar: 1.45; } .auth-panel .hero-art[data-hero] > .emblem { --s: 100%; margin: 0; } }
@media (max-width: 560px) { .auth-panel .hero-art[data-hero] { width: 150px; } }

/* theme toggle sits top-right of the form column (the dark panel is a different surface) */
.theme-btn--float { position: absolute; top: 18px; right: 18px; }
@media (min-width: 2200px) { .theme-btn--float { top: 28px; right: 32px; } }
