
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    min-height: 100%;
    width: 100%;
    background: transparent;
}

.auth-card {
    position: relative;
    width: min(100%, 440px);
    background: white;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(7, 17, 30, 0.12), 0 6px 20px rgba(7, 17, 30, 0.06);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    padding: 24px 28px 0;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 12px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--ghost);
    cursor: pointer;
    transition: 0.15s;
    letter-spacing: -0.005em;
}

.auth-tab:hover { color: var(--ink2); }

.auth-tab.on {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.auth-pane {
    position: relative;
    display: none;
    padding: 22px 28px 26px;
}

.auth-pane.on { display: block; }

.auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ghost);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: 0.15s;
}

.auth-close:hover {
    background: var(--surface);
    color: var(--ink2);
}

.auth-eyebrow {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-eyebrow em {
    color: var(--blue);
    font-style: italic;
}

.auth-sub {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
    margin-bottom: 18px;
}

.auth-action-note {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink2);
    margin: -6px 0 14px;
}

.auth-eyebrow[hidden] {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.auth-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink2);
    letter-spacing: 0.01em;
}

.auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: white;
    outline: none;
    transition: 0.15s;
}

.auth-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 172, 232, 0.1);
}

.auth-input.bad {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.08);
}

.auth-input-wrap {
    position: relative;
    display: block;
}

.auth-input-wrap .auth-input {
    padding-right: 44px;
}

.auth-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ghost);
    cursor: pointer;
    transition: 0.15s;
}

.auth-eye:hover { color: var(--ink2); }

.auth-eye svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-eye .auth-eye-off { display: none; }
.auth-eye.on { color: var(--blue); }
.auth-eye.on .auth-eye-off { display: inline; }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 14px;
    font-size: 12.5px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    accent-color: var(--blue);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.auth-forgot {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.auth-forgot:hover {
    color: var(--blue-dk);
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: var(--blue);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: 0.18s;
    box-shadow: 0 2px 10px rgba(26, 172, 232, 0.25);
    letter-spacing: 0.005em;
}

.auth-submit:hover {
    background: var(--blue-dk);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 172, 232, 0.35);
}

.auth-submit[disabled],
.auth-secondary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-secondary {
    width: 100%;
    padding: 12px 18px;
    margin-top: 10px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink2);
    cursor: pointer;
    transition: 0.18s;
    letter-spacing: 0.005em;
}

.auth-secondary:hover {
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-1px);
}

#resetCodeResendBtn {
    margin-top: 10px;
}

.auth-field--readonly {
    margin-bottom: 18px;
}

.auth-readonly {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: var(--ink);
    min-height: 42px;
}

.auth-change-email {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
}

.auth-change-email:hover {
    color: var(--blue-dk);
    text-decoration: underline;
}

.auth-foot {
    padding: 14px 28px 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.auth-foot a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.auth-foot a:hover { text-decoration: underline; }

.auth-terms {
    font-size: 11px;
    color: var(--ghost);
    line-height: 1.55;
    margin-top: 8px;
}

.auth-terms a {
    color: var(--muted);
    text-decoration: underline;
}

.auth-req {
    color: #c0392b;
    font-weight: 700;
    margin-left: 2px;
}

.auth-fielderr {
    font-size: 11.5px;
    color: #c0392b;
    margin-top: 4px;
    min-height: 0;
    display: none;
}

.auth-fielderr.show { display: block; }

.auth-formerr {
    font-size: 12.5px;
    color: #c0392b;
    background: #fdecec;
    border: 1px solid #f5c2c0;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px 0 12px;
    line-height: 1.4;
    display: none;
}

.auth-formerr.show { display: block; }

.auth-formok {
    font-size: 12.5px;
    color: #1d6b3a;
    background: #e8f5ec;
    border: 1px solid #b8dec7;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px 0 12px;
    line-height: 1.4;
    display: none;
}

.auth-formok.show { display: block; }

.auth-expire {
    font-size: 12.5px;
    color: var(--muted);
    margin: -4px 0 12px;
    line-height: 1.4;
}

.auth-expire #verifyCodeExpireValue {
    color: #c0392b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.auth-resend {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin: 14px 0 0;
}

.auth-resend .auth-link.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.auth-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover { text-decoration: underline; }

.auth-state[hidden] { display: none; }

.auth-pwrules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 11.5px;
    color: var(--muted);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 12px;
}

.auth-pwrules li {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.auth-pwrules li::before {
    content: '\25CB';
    color: var(--ghost);
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
    width: 13px;
    text-align: center;
}

.auth-pwrules li.ok { color: var(--teal); }
.auth-pwrules li.ok::before { content: '\2713'; color: var(--teal); font-weight: 700; }
.auth-pwrules li.bad { color: #c0392b; }
.auth-pwrules li.bad::before { content: '\2715'; color: #c0392b; font-weight: 700; }

.auth-match {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    line-height: 1.3;
}

.auth-match.ok { color: var(--teal); }
.auth-match.ok::before { content: '\2713'; font-weight: 700; }
.auth-match.bad { color: #c0392b; }
.auth-match.bad::before { content: '\2715'; font-weight: 700; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 10px;
    cursor: pointer;
    letter-spacing: 0.005em;
}

.auth-back:hover { color: var(--blue); }

.auth-back svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

.auth-otp {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 6px 0 14px;
}

.auth-otp input {
    width: 100%;
    aspect-ratio: 1 / 1.15;
    text-align: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: white;
    outline: none;
    transition: 0.15s;
    padding: 0;
    letter-spacing: 0;
}

.auth-otp input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 172, 232, 0.12);
}

.auth-otp input.filled {
    background: var(--surface);
    border-color: var(--blue);
}

.auth-expire {
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
    line-height: 1.55;
    margin: 0 0 14px;
}

.auth-expire strong { color: var(--ink2); }

.auth-resend {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
}

.auth-resend:hover {
    color: var(--blue-dk);
    text-decoration: underline;
}

.auth-resend[disabled] {
    color: var(--ghost);
    cursor: default;
    text-decoration: none;
}

.auth-fperror {
    font-size: 12.5px;
    color: #c0392b;
    line-height: 1.5;
    margin: 0 0 12px;
    display: none;
}

.auth-fperror.on { display: block; }

/* iOS Safari zoom prevention: keep inputs >= 16px on mobile. */
@media (max-width: 899px) {
    .auth-input { font-size: 16px; }
}
