/* 
   Стили для страниц авторизации (Вход, Регистрация, Восстановление)
   Подключается только на соответствующих страницах.
*/

/* --- 1. Основная сетка страницы --- */
.auth-page {
    background-color: #f1f5f9; /* Светлый фон */
    min-height: 80vh; /* Высота, чтобы центрировать по вертикали */
    width: 100%;
    
    /* Flexbox для центровки формы по центру экрана */
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Ограничитель ширины формы */
.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto !important;
    position: relative;
    z-index: 10;
}

/* Карточка формы (Белая плашка) */
.auth-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
}

/* Заголовки */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px 0 !important;
    line-height: 1.2;
}
.auth-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0 !important;
}

/* --- 2. Поля ввода (Inputs) --- */
.auth-form-group {
    margin-bottom: 20px;
    width: 100%;
}

.auth-form-group label {
    display: block;
    margin-bottom: 8px !important;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* Иконка внутри поля */
.input-wrapper i,
.input-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    z-index: 5;
    pointer-events: none; /* Чтобы клик проходил сквозь */
}

/* Стилизация самого инпута */
.auth-box input:not([type="radio"]):not([type="checkbox"]) {
    display: block !important;
    width: 100% !important;
    height: 50px !important;
    padding: 0 15px 0 48px !important; /* Отступ слева под иконку */
    margin: 0 !important;
    
    font-size: 16px !important;
    color: #1e293b !important;
    font-family: inherit;
    
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    
    box-shadow: none !important;
    outline: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

/* Фокус */
.auth-box input:not([type="radio"]):not([type="checkbox"]):focus {
    background-color: #fff !important;
    border-color: #2563eb !important; /* var(--primary) */
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

/* Красим иконку при фокусе */
.input-wrapper:focus-within i,
.input-wrapper:focus-within svg {
    color: #2563eb;
}

/* --- 3. Кнопка отправки --- */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    margin-top: 25px !important;
    
    background-color: #2563eb !important; /* var(--primary) */
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: transform 0.1s ease, background-color 0.2s ease !important;
}
.auth-submit-btn:hover {
    background-color: #1d4ed8 !important; /* var(--primary-hover) */
    transform: translateY(-1px);
}

/* --- 4. Выбор роли (Плитки) --- */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.role-option {
    margin: 0 !important;
    position: relative;
    cursor: pointer;
}

.role-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    height: 100%;
    min-height: 100px;
    
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    
    color: #64748b;
    box-sizing: border-box;
}

.role-card i,
.role-card svg {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    color: #94a3b8;
}

.role-card span {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Активная роль */
.role-option input:checked + .role-card {
    border-color: #2563eb;
    background-color: #eff6ff;
    color: #2563eb;
}
.role-option input:checked + .role-card i,
.role-option input:checked + .role-card svg {
    color: #2563eb;
}

/* --- 5. Подвал и Алерты --- */
.auth-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}
.auth-footer a {
    color: #2563eb;
    font-weight: 600;
}

.auth-alert {
    background: #fef2f2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #fee2e2;
}
.auth-alert i, 
.auth-alert svg { width: 18px; height: 18px; }

/* Адаптив */
@media (max-width: 480px) {
    .auth-page { padding: 15px; background-color: #fff; } /* Убираем фон на моб */
    .auth-box { padding: 25px 20px; border: none; box-shadow: none; }
    .role-selector { gap: 10px; }
}


/* Ссылка "Забыли пароль?" */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Убираем отступ у самого лейбла, так как отступ теперь задает .label-row */
.label-row label {
    margin-bottom: 0 !important;
}

.forgot-link {
    font-size: 0.85rem;
    color: #0C5EDA; /* Наш Primary */
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #0a4cb3; /* Primary hover */
    text-decoration: underline;
}



/* --- CLEANUP: Авторизация (Итерация 3) --- */

/* Контейнер Яндекс.Капчи */
.captcha-box {
    height: 100px;
    width: 100%;
}

/* Описание под полем (в регистрации) */
.input-hint-text {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 5px;
}

/* Алерт восстановления пароля (JS) */
#recovery-alert {
    display: none;
    align-items: center;
    gap: 10px;
}
