/* accounts/static/css/style.css */
@import url('colors.css');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-white);
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.logo {
    position: absolute;
    top: 40px;
    text-align: center;
    width: 100%;
}

.logo img {
    max-width: min(400px, 80vw);
    height: auto;
}

.auth-container {
    background-color: var(--bg-dark);
    border-radius: 12px;
    padding: 30px;
    width: min(400px, 90vw);
    box-shadow: 0 8px 20px var(--shadow-medium);
    margin-top: 120px;
}

.auth-title {
    color: var(--text-white);
    text-align: center;
    font-size: clamp(20px, 5vw, 24px);
    font-weight: bold;
    margin-bottom: 25px;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-white);
}

/* ВОССТАНАВЛИВАЕМ СТИЛИ ДЛЯ ПОЛЕЙ ВВОДА */
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: var(--bg-white);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 3, 168, 0.2);
}

/* Стили для полей с ошибками от Django */
.form-group input.error-field {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
}

/* Стили для успешных полей */
.form-group input.success-field {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
    background-color: rgba(40, 167, 69, 0.05) !important;
}

/* Основная кнопка */
.login-button {
    width: 100%;
    padding: 14px;
    background: var(--bg-white);
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.login-button:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

.login-button:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
    transform: none;
}

/* Второстепенная кнопка */
.secondary-button {
    width: 100%;
    padding: 10px;
    background: var(--gray-light);
    color: var(--text-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    text-decoration: none;
    display: block;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
    font-weight: 500;
}

.secondary-button:hover {
    background: var(--gray-dark);
    transform: translateY(-1px);
}

/* Сообщения об ошибках */
.error-message {
    color: #ffcccc;
    margin-bottom: 15px;
    text-align: center;
    background-color: rgba(255, 0, 0, 0.1);
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.field-error {
    color: var(--error-color);
    font-size: 0.875em;
    margin-top: 5px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--error-color);
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out;
}

/* Убедимся, что ошибки Django всегда видны */
.field-error[style*="display: block"] {
    display: block !important;
}

.field-error:not([style]) {
    display: block;
}

.form-text {
    color: var(--text-light);
    font-size: 0.875em;
    margin-top: 5px;
    display: block;
}

/* Уведомление о cookies */
.cookie-notification {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-white);
    padding: 15px 20px;
    z-index: 1000;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-content p {
    margin: 0;
    flex: 1;
    font-size: 14px;
}

.cookie-button {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.cookie-button:hover {
    background: var(--primary-dark);
}

/* ДОБАВЬТЕ ЭТИ СТИЛИ В CSS */
.privacy-checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 100%;
    margin: 0;
    position: relative;
    min-height: 50px;
}

.privacy-checkbox-container:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Скрываем стандартный чекбокс */
.privacy-checkbox-real {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Кастомный визуальный чекбокс */
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-white);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: transparent;
}

/* Состояние отмеченного чекбокса */
.privacy-checkbox-real:checked + .checkbox-custom {
    background: var(--text-white);
    border-color: var(--text-white);
}

.privacy-checkbox-real:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: bold;
}

.privacy-text {
    color: var(--text-white);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    margin: 0;
    flex: 1;
    user-select: none;
}

.privacy-section.error {
    border-color: var(--error-color);
    background: rgba(220, 53, 69, 0.1);
}

.privacy-error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--error-color);
    font-weight: 500;
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 8px;
    display: none;
}

/* Анимации */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

.field-warning {
    color: var(--warning-color);
    font-size: 0.875em;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
    animation: fadeIn 0.3s ease-out;
}

/* Система уведомлений */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: var(--text-white);
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    box-shadow: 0 4px 12px var(--shadow-medium);
    cursor: pointer;
}

.notification.error {
    background: var(--error-color);
    border-left: 4px solid var(--error-dark);
}

.notification.warning {
    background: var(--warning-color);
    color: #212529;
    border-left: 4px solid var(--warning-dark);
}

.notification.success {
    background: var(--success-color);
    border-left: 4px solid var(--success-dark);
}

.notification.info {
    background: var(--info-color);
    border-left: 4px solid var(--info-dark);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification.hiding {
    animation: slideOut 0.3s ease-in;
}

/* УПРАВЛЯЕМ АНИМАЦИЕЙ ОШИБОК ТОЛЬКО ПРИ НАЛИЧИИ КЛАССА error */
.form-group.error input {
    border-color: var(--error-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    /* Убираем анимацию пульсации для серверных ошибок, чтобы не отвлекать */
    animation: none !important;
}

.form-group.success input {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-group.validated input {
    transition: all 0.3s ease;
}

/* Анимация пульсации только при ошибках (оставляем для клиентских ошибок) */
@keyframes pulseError {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Убедимся, что ошибки при отправке формы видны */
.form-group.error .field-error {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Стили для состояний валидации в реальном времени */
.form-group.validated.error input {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: var(--bg-white) !important;
    color: var(--text-dark) !important;
}

.form-group.validated.success input {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        justify-content: flex-start;
        padding-top: 100px;
    }

    .logo {
        top: 20px;
    }

    .logo img {
        max-width: 250px;
    }

    .auth-container {
        padding: 25px 20px;
        margin-top: 80px;
        width: 95vw;
    }

    .form-group input {
        padding: 10px;
        font-size: 16px;
    }

    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .logo img {
        max-width: 200px;
    }

    .auth-container {
        padding: 20px 15px;
        margin-top: 60px;
    }

    .auth-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input {
        padding: 10px;
        font-size: 14px;
    }

    .privacy-checkbox-simple {
        padding: 8px;
    }

    .checkbox-simple-visual {
        width: 18px;
        height: 18px;
        margin-right: 10px;
    }

    .privacy-text {
        font-size: 13px;
    }

    .field-error {
        font-size: 0.8em;
        padding: 6px 10px;
    }

    .privacy-error {
        font-size: 0.8em;
        padding: 6px 10px;
    }

    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
        font-size: 14px;
    }
}

/* Анимация для появления статуса */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 50px;
    }
}

/* Стили для уведомления об устаревшей сессии */
.notification.session-expired {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.notification.session-expired .notification-content {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px var(--shadow-strong);
}

.notification.session-expired .notification-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--error-color);
    margin-bottom: 10px;
}

.notification.session-expired .notification-message {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.4;
}

.notification.session-expired .notification-close {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.notification.session-expired .notification-close:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Стили для контейнера поля пароля */
.password-field-container {
    position: relative;
    width: 100%;
}

/* Стили для кнопки переключения видимости пароля */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #1003a8;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .password-toggle {
        right: 8px;
        padding: 4px;
    }
}

/* Дополнительные стили для переключателя пароля */
.password-field-container {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 2;
    font-weight: normal;
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #1003a8;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Убедимся, что поле ввода не перекрывается кнопкой */
.password-field-container input {
    padding-right: 70px !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .password-toggle {
        right: 8px;
        padding: 4px 6px;
        font-size: 11px;
    }

    .password-field-container input {
        padding-right: 60px !important;
    }
}

@media (max-width: 480px) {
    .password-toggle {
        right: 6px;
        padding: 3px 5px;
        font-size: 10px;
    }

    .password-field-container input {
        padding-right: 55px !important;
    }
}