/* ── Auth Pages — Design System v2 ──────────────────────────────────────────
   Login + Register are skinned with the `nda-auth__*` family below (v2 tokens
   only — never a hardcoded hex; dark theme follows the token swap for free).

   The legacy `.auth-card / .form-* / .btn--* / .alert / .auth-divider`
   classes are KEPT and re-pointed to v2 tokens in place, because the still-v1
   auth flows (forgot/reset password, email-OTP, 2FA setup modal,
   change-password) share them. Migrating the values here re-skins those
   screens without touching their markup.
   --------------------------------------------------------------------------- */

/* ═══════════════════════════════════════════════════════════════════════════
   v2 — Login & Register
   ═══════════════════════════════════════════════════════════════════════════ */

.nda-auth {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}

.nda-auth__card {
    width: 100%;
    max-width: 440px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: 22px;
    box-shadow: 0 22px 60px -34px var(--v2-shadow);
    padding: 30px 26px;
}

.nda-auth__head {
    text-align: center;
    margin-bottom: 22px;
}

.nda-auth__title {
    font-family: var(--v2-font-title);
    font-weight: 400;
    font-size: 36px;
    line-height: 1.08;
    color: var(--v2-text);
    margin: 0 0 6px;
}

.nda-auth__subtitle {
    font-family: var(--v2-font-body);
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--v2-soft);
    margin: 0;
}

/* ── Form ───────────────────────────────────────────────────────────────── */

.nda-auth__form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nda-auth__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nda-auth__label {
    font-family: var(--v2-font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--v2-text);
}

.nda-auth__input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-family: var(--v2-font-body);
    font-size: 15px;
    color: var(--v2-text);
    background: var(--v2-surface2);
    border: 1px solid var(--v2-border);
    border-radius: 13px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.nda-auth__input::placeholder {
    color: var(--v2-soft);
    opacity: 0.7;
}

.nda-auth__input:focus-visible,
.nda-auth__input:focus {
    border-color: var(--v2-accent);
    background: var(--v2-bg2);
    box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.nda-auth__input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* TOTP / one-time code — centered, spaced digits */
.nda-auth__input--totp {
    text-align: center;
    letter-spacing: 0.45em;
    font-size: 22px;
    font-weight: 700;
    max-width: 220px;
    align-self: center;
    padding-right: 14px;
}

/* Invite code — uppercased, tracked, faint accent wash */
.nda-auth__field--referral {
    background: var(--v2-accent-soft);
    border: 1px solid var(--v2-border);
    border-radius: 16px;
    padding: 14px;
}

.nda-auth__input--referral {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    background: var(--v2-surface);
}

.nda-auth__hint {
    font-family: var(--v2-font-body);
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--v2-soft);
    margin: 0;
}

.nda-auth__error {
    font-family: var(--v2-font-body);
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--v2-accent-strong);
    background: var(--v2-accent-soft);
    border: 1px solid var(--v2-border);
    border-left: 3px solid var(--v2-accent);
    padding: 10px 12px;
    border-radius: 12px;
    margin: 0;
}

.nda-auth__alert {
    font-family: var(--v2-font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--v2-accent-strong);
    background: var(--v2-accent-soft);
    border: 1px solid var(--v2-border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.nda-auth__submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 18px;
    font-family: var(--v2-font-body);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--v2-accent);
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.nda-auth__submit:hover:not(:disabled) {
    background: var(--v2-accent-strong);
    box-shadow: 0 14px 30px -16px var(--v2-shadow);
}

.nda-auth__submit:active:not(:disabled) {
    transform: translateY(1px);
}

.nda-auth__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* OAuth — secondary surface buttons (Google / Apple) */
.nda-auth__oauth-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nda-auth__oauth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    font-family: var(--v2-font-body);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--v2-text);
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}

.nda-auth__oauth:hover {
    background: var(--v2-surface2);
    border-color: var(--v2-accent-soft);
}

.nda-auth__oauth-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--v2-soft);
}

/* Passkey / biometrics — quiet tertiary, accent on hover */
.nda-auth__passkey {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-family: var(--v2-font-body);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--v2-text);
    background: var(--v2-surface2);
    border: 1px solid var(--v2-border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nda-auth__passkey:hover:not(:disabled) {
    color: var(--v2-accent-strong);
    border-color: var(--v2-accent-soft);
}

.nda-auth__passkey:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Account-type toggle (Namorado / Namorada) ──────────────────────────── */

.nda-auth__toggle {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--v2-surface2);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-pill);
}

.nda-auth__toggle-btn {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--v2-font-body);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: var(--v2-soft);
    background: transparent;
    border: none;
    border-radius: var(--v2-radius-pill);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.nda-auth__toggle-btn:hover {
    color: var(--v2-text);
}

.nda-auth__toggle-btn--active {
    color: #fff;
    background: var(--v2-accent);
    box-shadow: 0 8px 18px -10px var(--v2-shadow);
}

.nda-auth__toggle-btn--active:hover {
    color: #fff;
}

/* ── Password strength meter ────────────────────────────────────────────── */

.nda-auth__strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.nda-auth__strength-track {
    flex: 1;
    height: 6px;
    background: var(--v2-track);
    border-radius: 999px;
    overflow: hidden;
}

.nda-auth__strength-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--v2-accent);
    transition: width 300ms ease, background 300ms ease;
}

.nda-auth__strength-label {
    font-family: var(--v2-font-body);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Weak/fair lean on soft+gold; good/strong on accent — all token-driven. */
.nda-auth__strength.strength--weak .nda-auth__strength-bar { background: var(--v2-soft); }
.nda-auth__strength.strength--weak .nda-auth__strength-label { color: var(--v2-soft); }

.nda-auth__strength.strength--fair .nda-auth__strength-bar { background: var(--v2-gold); }
.nda-auth__strength.strength--fair .nda-auth__strength-label { color: var(--v2-gold); }

.nda-auth__strength.strength--good .nda-auth__strength-bar { background: var(--v2-accent); }
.nda-auth__strength.strength--good .nda-auth__strength-label { color: var(--v2-accent); }

.nda-auth__strength.strength--strong .nda-auth__strength-bar { background: var(--v2-accent-strong); }
.nda-auth__strength.strength--strong .nda-auth__strength-label { color: var(--v2-accent-strong); }

/* ── Divider ────────────────────────────────────────────────────────────── */

.nda-auth__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--v2-soft);
    font-family: var(--v2-font-body);
    font-size: 12.5px;
    margin: 16px 0;
}

.nda-auth__divider::before,
.nda-auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--v2-border);
}

/* ── Cross-links / footer ───────────────────────────────────────────────── */

.nda-auth__footer {
    text-align: center;
    font-family: var(--v2-font-body);
    font-size: 13.5px;
    color: var(--v2-soft);
    margin: 12px 0 0;
}

.nda-auth__link {
    color: var(--v2-accent);
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
}

.nda-auth__link:hover {
    color: var(--v2-accent-strong);
    text-decoration: underline;
}

.nda-auth__link:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
}

/* Visible focus ring for every interactive control in the card. */
.nda-auth__submit:focus-visible,
.nda-auth__oauth:focus-visible,
.nda-auth__passkey:focus-visible,
.nda-auth__toggle-btn:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
}

/* ── Responsive — full-bleed sheet on small screens ─────────────────────── */

@media (max-width: 480px) {
    .nda-auth {
        align-items: flex-start;
        padding: 0;
    }

    .nda-auth__card {
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
        padding: 26px 18px 32px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Legacy shared classes — migrated to v2 tokens IN PLACE.
   Used by the still-v1 auth flows (forgot/reset password, email-OTP,
   2FA setup modal, change-password). Re-skinned here so those screens follow
   v2 without editing their markup. Do not delete — they are referenced
   outside this re-skin's scope.
   ═══════════════════════════════════════════════════════════════════════════ */

.page-login,
.page-register {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    background: var(--v2-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: 22px;
    box-shadow: 0 22px 60px -34px var(--v2-shadow);
    padding: 30px 26px;
}

.auth-card__title {
    font-family: var(--v2-font-title);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.1;
    color: var(--v2-text);
    text-align: center;
    margin-bottom: 8px;
}

.auth-card__subtitle {
    font-family: var(--v2-font-body);
    font-size: 14px;
    color: var(--v2-soft);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form__footer {
    text-align: center;
    font-family: var(--v2-font-body);
    font-size: 13.5px;
    color: var(--v2-soft);
    margin-top: 12px;
}

.auth-form__footer a {
    color: var(--v2-accent);
    text-decoration: none;
    font-weight: 700;
}

.auth-form__footer a:hover {
    color: var(--v2-accent-strong);
    text-decoration: underline;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-family: var(--v2-font-body);
    font-size: 13px;
    font-weight: 700;
    color: var(--v2-text);
}

.form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-family: var(--v2-font-body);
    font-size: 15px;
    color: var(--v2-text);
    background: var(--v2-surface2);
    border: 1px solid var(--v2-border);
    border-radius: 13px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.form-input:focus {
    border-color: var(--v2-accent);
    background: var(--v2-bg2);
    box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.form-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-input::placeholder {
    color: var(--v2-soft);
    opacity: 0.7;
}

.form-input--totp {
    text-align: center;
    letter-spacing: 0.45em;
    font-family: var(--v2-font-body);
    font-size: 22px;
    font-weight: 700;
    max-width: 220px;
    align-self: center;
    padding-right: 14px;
}

.form-group--referral {
    margin-top: 8px;
}

.form-label--referral {
    font-size: 12.5px;
    color: var(--v2-soft);
}

.form-input--referral {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.form-hint {
    font-family: var(--v2-font-body);
    font-size: 12.5px;
    color: var(--v2-soft);
    line-height: 1.4;
}

.form-hint--referral {
    font-size: 12px;
}

.form-error {
    font-family: var(--v2-font-body);
    font-size: 13.5px;
    color: var(--v2-accent-strong);
    background: var(--v2-accent-soft);
    padding: 10px 12px;
    border-radius: 12px;
    border-left: 3px solid var(--v2-accent);
}

/* ── Alerts ─────────────────────────────────────────────────────────────── */

.alert {
    font-family: var(--v2-font-body);
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.alert--error {
    background: var(--v2-accent-soft);
    color: var(--v2-accent-strong);
    border: 1px solid var(--v2-border);
}

.alert--success {
    background: var(--v2-surface2);
    color: var(--v2-text);
    border: 1px solid var(--v2-border);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    font-family: var(--v2-font-body);
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease, color 150ms ease, border-color 150ms ease;
    text-decoration: none;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--v2-accent);
    color: #fff;
}

.btn--primary:hover:not(:disabled) {
    background: var(--v2-accent-strong);
    box-shadow: 0 14px 30px -16px var(--v2-shadow);
}

.btn--full {
    width: 100%;
}

.btn--outline {
    background: transparent;
    color: var(--v2-accent);
    border: 1px solid var(--v2-accent);
}

.btn--outline:hover:not(:disabled) {
    background: var(--v2-accent-soft);
}

.btn--secondary {
    background: var(--v2-surface);
    color: var(--v2-text);
    border: 1px solid var(--v2-border);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--v2-surface2);
}

.btn--text,
.btn--link {
    background: transparent;
    color: var(--v2-accent);
    border: none;
    padding-left: 6px;
    padding-right: 6px;
}

.btn--text:hover:not(:disabled),
.btn--link:hover:not(:disabled) {
    color: var(--v2-accent-strong);
    text-decoration: underline;
}

/* Social / Passkey buttons — secondary surface treatment. */
.btn--google {
    background: var(--v2-surface);
    color: var(--v2-text);
    border: 1px solid var(--v2-border);
}

.btn--google:hover:not(:disabled) {
    background: var(--v2-surface2);
    border-color: var(--v2-accent-soft);
}

.btn--apple {
    background: var(--v2-surface);
    color: var(--v2-text);
    border: 1px solid var(--v2-border);
}

.btn--apple:hover:not(:disabled) {
    background: var(--v2-surface2);
    border-color: var(--v2-accent-soft);
}

.btn--passkey {
    background: var(--v2-surface2);
    color: var(--v2-text);
    border: 1px solid var(--v2-border);
}

.btn--passkey:hover:not(:disabled) {
    color: var(--v2-accent-strong);
    border-color: var(--v2-accent-soft);
}

.btn:focus-visible {
    outline: 2px solid var(--v2-accent);
    outline-offset: 2px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--v2-soft);
    font-family: var(--v2-font-body);
    font-size: 12.5px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--v2-border);
}

/* ── Social Buttons Container ───────────────────────────────────────────── */

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Radio Group (legacy user-type selector) ────────────────────────────── */

.radio-group {
    display: flex;
    gap: 10px;
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: block;
    padding: 11px 16px;
    text-align: center;
    font-family: var(--v2-font-body);
    font-size: 14px;
    font-weight: 700;
    color: var(--v2-soft);
    background: var(--v2-surface2);
    border: 1px solid var(--v2-border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.radio-option input[type="radio"]:checked + label {
    color: #fff;
    background: var(--v2-accent);
    border-color: var(--v2-accent);
}

.radio-option label:hover {
    border-color: var(--v2-accent-soft);
}

/* ── Password Strength Meter (legacy markup) ────────────────────────────── */

.strength-meter {
    height: 6px;
    background: var(--v2-track);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.strength-meter__bar {
    height: 100%;
    border-radius: 999px;
    transition: width 300ms ease, background 300ms ease;
}

.strength-meter__label {
    font-family: var(--v2-font-body);
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.strength-meter--weak .strength-meter__bar {
    width: 25%;
    background: var(--v2-soft);
}
.strength-meter--weak .strength-meter__label { color: var(--v2-soft); }

.strength-meter--fair .strength-meter__bar {
    width: 50%;
    background: var(--v2-gold);
}
.strength-meter--fair .strength-meter__label { color: var(--v2-gold); }

.strength-meter--good .strength-meter__bar {
    width: 75%;
    background: var(--v2-accent);
}
.strength-meter--good .strength-meter__label { color: var(--v2-accent); }

.strength-meter--strong .strength-meter__bar {
    width: 100%;
    background: var(--v2-accent-strong);
}
.strength-meter--strong .strength-meter__label { color: var(--v2-accent-strong); }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .auth-card {
        padding: 26px 18px 32px;
        box-shadow: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    .page-login,
    .page-register {
        padding: 0;
        align-items: flex-start;
    }
}
