/**
 * Стили форм авторизации FireFlame
 * Файл: assets/css/auth-forms.css
 */

/* ===============================
   ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ
   =============================== */

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #F5E6D3 0%, #E8D5C4 50%, #D4A574 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.auth-card {
    background: white;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 
        0 20px 60px rgba(139, 111, 71, 0.15),
        0 5px 20px rgba(139, 111, 71, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #8B6F47 0%, #D4A574 50%, #8B6F47 100%);
}

/* ===============================
   ШАПКА ФОРМЫ
   =============================== */

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 600;
    color: #3A3A3A;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.auth-subtitle {
    color: #8B6F47;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    margin: 0;
}

/* ===============================
   ФОРМЫ
   =============================== */

.auth-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B6B6B;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #E8D5C4;
    background: #FAFAFA;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #8B6F47;
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
}

.form-input::placeholder {
    color: #999;
    font-size: 14px;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}

/* ===============================
   ОПЦИИ ФОРМЫ
   =============================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.form-remember {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B6F47;
    cursor: pointer;
}

.form-remember label {
    font-size: 14px;
    color: #6B6B6B;
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    font-size: 14px;
    color: #8B6F47;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: #6B5637;
    text-decoration: underline;
}

/* ===============================
   СОГЛАСИЕ С УСЛОВИЯМИ
   =============================== */

.form-agreement {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 30px;
    padding: 15px;
    background: #F9F9F9;
    border-radius: 8px;
    border-left: 4px solid #8B6F47;
}

.form-agreement input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #8B6F47;
    cursor: pointer;
}

.form-agreement label {
    font-size: 13px;
    color: #6B6B6B;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
}

.form-agreement a {
    color: #8B6F47;
    text-decoration: none;
    font-weight: 500;
}

.form-agreement a:hover {
    text-decoration: underline;
}

/* ===============================
   КНОПКИ
   =============================== */

.auth-button {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
}

.auth-button-primary {
    background: linear-gradient(135deg, #8B6F47 0%, #6B5637 100%);
    color: white;
}

.auth-button-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6B5637 0%, #5A4A2F 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 111, 71, 0.3);
}

.auth-button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-button:hover::before {
    width: 300px;
    height: 300px;
}

/* ===============================
   ПРОВЕРКА СИЛЫ ПАРОЛЯ
   =============================== */

.password-strength {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.password-strength.weak {
    color: #e74c3c;
}

.password-strength.medium {
    color: #f39c12;
}

.password-strength.strong {
    color: #27ae60;
}

/* ===============================
   СООБЩЕНИЯ
   =============================== */

.auth-messages {
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border-left: 4px solid #e53935;
}

.auth-error ul {
    margin: 0;
    padding-left: 20px;
}

.auth-error li {
    margin-bottom: 5px;
}

.auth-success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border-left: 4px solid #4caf50;
    text-align: center;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.auth-success h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.auth-success p {
    margin: 0;
    opacity: 0.9;
}

/* ===============================
   ПОДВАЛ ФОРМЫ
   =============================== */

.auth-footer {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #E8D5C4;
}

.auth-footer p {
    margin: 0;
    font-size: 14px;
    color: #6B6B6B;
}

.auth-footer a {
    color: #8B6F47;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-footer a:hover {
    color: #6B5637;
    text-decoration: underline;
}

/* ===============================
   ССЫЛКА НАЗАД НА ГЛАВНУЮ
   =============================== */

.auth-back {
    position: absolute;
    top: -60px;
    left: 0;
}

.auth-back a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8B6F47;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.auth-back a:hover {
    transform: translateX(-5px);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 5px 15px rgba(139, 111, 71, 0.2);
}

/* ===============================
   АНИМАЦИИ ЗАГРУЗКИ
   =============================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.6s ease-out;
}

.form-group {
    animation: fadeIn 0.6s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

/* ===============================
   АДАПТИВНОСТЬ
   =============================== */

@media (max-width: 768px) {
    .auth-page {
        padding: 15px;
    }
    
    .auth-card {
        padding: 30px;
    }
    
    .auth-logo {
        font-size: 32px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .auth-back {
        position: relative;
        top: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px;
    }
    
    .auth-logo {
        font-size: 28px;
    }
    
    .auth-subtitle {
        font-size: 12px;
        letter-spacing: 1.5px;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .auth-button {
        padding: 15px 20px;
        font-size: 13px;
    }
    
    .form-agreement {
        padding: 12px;
    }
}

/* ===============================
   ТЕМЫ И ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   =============================== */

/* Улучшенный фокус для доступности */
.form-input:focus,
.form-remember input:focus,
.form-agreement input:focus {
    outline: 2px solid #8B6F47;
    outline-offset: 2px;
}

/* Стили для автозаполнения браузера */
.form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #FAFAFA inset !important;
    -webkit-text-fill-color: #3A3A3A !important;
}

.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

/* Плавные переходы для всех интерактивных элементов */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Убираем стандартные стили для чекбоксов в старых браузерах */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: #8B6F47;
    width: 18px;
    height: 18px;
    border: 2px solid #E8D5C4;
    border-radius: 3px;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #8B6F47;
    border-radius: 1px;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}