/* resources/css/styles.css */

/* --- Global Reset --- */
* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

/* --- Layout --- */
.login-container {
    width: 100%; max-width: 440px;
    padding: 20px;
    display: flex; flex-direction: column; align-items: center;
}

.login-header { margin-bottom: 32px; text-align: center; }

/* Логотип */
.logo {
    width: 240px;
    height: auto;
    display: block;
}

/* Карточка */
.login-card {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 40px;
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Заголовок (строго 24px) */
.login-title {
    font-size: 24px !important;
    line-height: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px 0;
    text-align: left;
    letter-spacing: -0.01em;
}

/* --- Alerts & Messages --- */

/* Ошибка (Красная) */
.alert-error, .alert-warning {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
    display: flex; align-items: flex-start;
}

/* Успех (Зеленая) */
.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
    display: flex; align-items: flex-start;
}

/* Инфо (Синяя) */
.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
    display: flex; align-items: flex-start;
}

/* --- Form Elements --- */
form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
    font-size: 14px; font-weight: 500; color: #374151;
}

/* Поля ввода (Input) */
input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px; color: #111827;
    transition: all 0.2s;
    height: 48px;
}

input:focus {
    outline: none; border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Состояние ошибки для поля */
input.input-error {
    border-color: #ef4444 !important;
    background-color: #fffafa;
}

input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Текст ошибки под полем */
.field-error-msg {
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

/* --- Password Eye & Wrappers --- */
.password-wrapper { position: relative; width: 100%; }

/* Убираем нативные иконки IE/Edge */
input::-ms-reveal, input::-ms-clear { display: none; }

.toggle-password {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    padding: 4px; color: #9ca3af;
    display: flex; align-items: center; justify-content: center;
}
.toggle-password:hover { color: #6366f1; }
.toggle-password svg { width: 20px; height: 20px; }

/* --- Checkbox & Options --- */
.form-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: -4px;
}

.checkbox-wrapper {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
    margin: 0;
}

.checkbox-label {
    font-size: 14px; color: #374151; user-select: none;
}

/* --- Links & Buttons --- */
.forgot-link {
    font-size: 14px; color: #6366f1; text-decoration: none; font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

/* Основная кнопка (Primary) */
.btn-primary, input[type="submit"].btn-primary {
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    height: 48px;
    text-align: center;
    font-family: inherit;
    display: block;
}
.btn-primary:hover, input[type="submit"].btn-primary:hover {
    background-color: #4f46e5;
}

.login-footer {
    position: absolute;
    bottom: 32px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 0;
    pointer-events: none;
}

.alert-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* --- Registration Link --- */
.register-link {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.register-link span {
    color: #6b7280;
}

.register-link a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.register-link a:hover {
    text-decoration: underline;
    color: #4f46e5;
}

/* --- Social Providers (Google, etc.) --- */
.social-providers-container {
    margin-top: 24px;
    text-align: center;
}

.social-divider {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.social-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0; /* Сбрасываем дефолтный отступ браузера */
}

.social-divider span {
    padding: 0 16px;
    color: #6b7280;
    font-size: 14px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    background-color: #ffffff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-social:hover {
    background-color: #f9fafb;
    border-color: #c0c4cc;
}