/* Общие стили страниц входа и регистрации. */
.input-error {
        border-color: var(--toast-error) !important;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
    }
    .field-error {
        color: var(--toast-error);
        font-size: 13px;
        margin-top: 4px;
    }

    /* Стили для таймера (из 404.html) */
    .timer-display {
        font-weight: 600;
        color: var(--text-primary);
    }
    .timer-display.warning {
        color: #ef4444;
        animation: blink 0.8s ease-in-out infinite;
    }
    @keyframes blink {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.3; }
    }

    /* Фиксация кнопки */
    .send-code-btn {
        min-width: 140px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Остальные стили из оригинального файла */
    .auth-page .auth-field {
        width: 100%;
        margin-bottom: 18px;
    }
    .password-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
    }
    .password-wrapper input {
        width: 100%;
        padding-right: 48px;
        padding-left: 16px;
        height: 48px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-input);
        color: var(--text-primary);
        font-size: 16px;
        transition: border-color 0.2s, box-shadow 0.2s;
        outline: none;
        font-family: inherit;
    }
    .password-wrapper input:focus {
        border-color: var(--color-secondary);
        box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
    }
    .toggle-password {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent !important;
        border: none !important;
        color: var(--text-muted);
        cursor: pointer;
        padding: 8px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        transition: color 0.2s, background 0.2s;
        z-index: 2;
        line-height: 1;
        outline: none;
    }
    .toggle-password:hover {
        color: var(--text-primary);
        background: var(--bg-hover) !important;
    }
    .toggle-password:focus-visible {
        outline: 2px solid var(--color-secondary);
        outline-offset: 2px;
    }
    .toggle-password i {
        pointer-events: none;
        font-size: 20px;
        line-height: 1;
    }

    .code-inputs-wrapper {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    .code-inputs {
        display: flex;
        gap: 8px;
        flex: 1;
    }
    .code-input {
        width: 44px;
        height: 52px;
        text-align: center;
        font-size: 24px;
        font-weight: 600;
        border: 2px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-input);
        color: var(--text-primary);
        transition: border-color 0.2s, box-shadow 0.2s;
        outline: none;
        font-family: inherit;
        caret-color: var(--color-primary);
    }
    .code-input:focus {
        border-color: var(--color-secondary);
        box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.15);
    }
    .code-input.filled {
        border-color: var(--color-primary);
        background: var(--bg-hover);
    }
    .send-code-btn {
        white-space: nowrap;
        padding: 10px 18px;
        height: 52px;
        font-size: 14px;
        flex-shrink: 0;
        background: var(--bg-hover);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        cursor: pointer;
        transition: background 0.2s;
        color: var(--text-primary);
        font-weight: 500;
    }
    .send-code-btn:hover {
        background: var(--border-color);
    }
    .send-code-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }
    .social-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        margin-top: 10px;
    }
    .btn-social {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border-radius: 30px;
        border: 1px solid var(--border-color);
        background: var(--bg-hover);
        color: var(--text-primary);
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s;
        font-size: 14px;
    }
    .btn-social:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        color: white;
    }
    .btn-social.vk:hover { background: #4a76a8; border-color: #4a76a8; }
    .btn-social.yandex:hover { background: #ff0000; border-color: #ff0000; }
    .btn-social.telegram:hover { background: #0088cc; border-color: #0088cc; }
    .btn-social.discord:hover { background: #5865f2; border-color: #5865f2; }
    .btn-social.github:hover { background: #333; border-color: #333; }
    .btn-social i { font-size: 18px; }

    @media (max-width: 480px) {
        .code-inputs-wrapper {
            flex-direction: column;
            align-items: stretch;
        }
        .code-input {
            width: 100%;
            height: 48px;
            font-size: 20px;
        }
        .code-inputs {
            gap: 6px;
        }
        .send-code-btn {
            height: 44px;
            width: 100%;
            min-width: unset;
        }
        .social-buttons {
            flex-direction: column;
            align-items: stretch;
        }
        .btn-social {
            justify-content: center;
        }
    }

    .forgot-password-link {
        display: inline-block;
        margin-top: 6px;
        font-size: 14px;
        color: var(--color-secondary-text);
        text-decoration: none;
        transition: color 0.2s;
    }
    .forgot-password-link:hover {
        color: var(--color-primary-text);
        text-decoration: underline;
    }

    /* Вторая колонка .auth-container - сам класс в style.css не определён.
       Держим высоту и вертикальное центрирование, чтобы блок не "прилипал" к верху. */
    .auth-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 20px;
        min-width: 0;
        padding: 8px 4px;
    }


/* Второй фактор: формы входа и страница настройки. */
.btn-block {
    width: 100%;
    display: inline-flex;
    justify-content: center;
}

.auth-footnote {
    margin-top: 18px;
    font-size: 13px;
    color: var(--color-secondary-text);
    text-align: center;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.recovery-codes code,
.totp-secret {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 14px;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.totp-qr {
    margin: 12px 0;
    text-align: center;
}
