/**
 * pages/auth.css — вынесено 1:1 из style.css (этап C.3.4).
 * Pure .auth-* (+ потомки). Overrides pages-sys-wave6 / wave10 / adaptive не трогались.
 * @media и body.mobile-layout остаются в style.css до C.4.
 */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.auth-dialog {
    background: var(--va-bg, #1b2838);
    border: 1px solid var(--va-border, #2a475e);
    border-radius: 6px;
    width: min(460px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}

.auth-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.auth-tab {
    flex: 1;
    background: var(--va-border, #2a475e);
    color: var(--va-text, #c7d5e0);
    border: none;
    padding: 10px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
}

.auth-tab.active {
    background: var(--va-accent, #66c0f4);
    color: var(--va-bg, #1b2838);
    font-weight: 600;
}

.auth-panel label {
    display: block;
    margin: 10px 0 4px;
    color: var(--va-text-muted, #8f98a0);
    font-size: 0.85rem;
}

.auth-panel .search-input {
    width: 100%;
    margin-bottom: var(--space-1);
}

.auth-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--va-text, #c7d5e0);
}

.auth-error {
    color: #ff6b6b;
    min-height: 1.2em;
    margin: 8px 0;
    font-size: 0.9rem;
}

.auth-hint {
    color: var(--va-text-muted, #8f98a0);
    font-size: 0.85rem;
    min-height: 1.2em;
}

.auth-row {
    display: flex;
    gap: var(--space-2);
    margin: 8px 0;
}

.auth-close {
    width: 100%;
    margin-top: var(--space-3);
}

.auth-subview {
    margin-top: var(--space-1);
}

.auth-subview.hidden {
    display: none;
}

.auth-subview-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--va-text, #c7d5e0);
}

.auth-row-field {
    flex: 1;
    min-width: 0;
}

.auth-row-field label {
    margin-top: 0;
}

.auth-reset-send-btn {
    align-self: flex-end;
    flex-shrink: 0;
    white-space: nowrap;
    margin-bottom: var(--space-1);
}

.auth-dialog {
    position: relative;
    z-index: var(--z-base);
}

/* 2FA */
.auth-2fa-panel {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--va-border, #2a475e);
}

.auth-2fa-panel.hidden {
    display: none;
}

.auth-2fa-back {
    margin-top: var(--space-2);
}

.auth-forgot-btn {
    margin-top: var(--space-2);
    width: 100%;
}

.auth-password-wrap {
    display: flex;
    gap: var(--space-2);
    align-items: stretch;
}

.auth-password-wrap .auth-password-input {
    flex: 1;
    min-height: 36px;
    box-sizing: border-box;
    margin-bottom: 0;
}

.auth-pass-toggle {
    background: var(--va-border, #2a475e);
    border: 1px solid #417a9b;
    color: var(--va-text, #c7d5e0);
    border-radius: 6px;
    padding: 0 12px;
    min-height: 36px;
    min-width: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

/* Registration wizard */
.au-reg-wizard { display: flex; flex-direction: column; gap: 14px; }
.au-reg-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}
.au-reg-steps span {
    flex: 1;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--va-text-muted, #8f98a0);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--va-border, #2a475e);
}
.au-reg-steps span.on {
    color: #0b1220;
    background: color-mix(in srgb, var(--va-accent, #66c0f4) 75%, #fff);
    border-color: transparent;
}
.au-reg-steps span.current {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--va-accent, #66c0f4) 45%, transparent);
}
.au-tag-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.au-tag-prefix {
    padding: 0 10px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--va-border, #2a475e);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: rgba(0,0,0,0.25);
    color: var(--va-accent, #66c0f4);
    font-weight: 700;
}
.au-tag-row .search-input {
    border-radius: 0 6px 6px 0;
}
.au-reg-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}
.au-reg-nav .btn-buy { margin-left: auto; }

/* OTP digit cells */
.au-otp { position: relative; }
.au-otp-value {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    border: 0;
    padding: 0;
    margin: 0;
}
.au-otp-cells {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}
.au-otp-cell {
    width: 44px;
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--va-border, #2a475e);
    background: rgba(0, 0, 0, 0.28);
    color: var(--va-text, #c7d5e0);
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.au-otp-cell:focus {
    border-color: var(--va-accent, #66c0f4);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--va-accent, #66c0f4) 35%, transparent);
    background: rgba(102, 192, 244, 0.08);
}
@media (max-width: 480px) {
    .au-otp-cell { width: 38px; height: 44px; font-size: 1.2rem; }
    .au-otp-cells { gap: 6px; }
}
