/* ============================================================
   LOGIN — страница входа ТукДом
   Палитра: тёмно-зелёный #0d3b3a, персиковый #f0a080, кремовый #faf8f5
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* === Брендовая палитра ТукДом === */
    --brand-dark:    #0d3b3a;
    --brand-dark-2:  #15524f;
    --brand-peach:   #f0a080;
    --brand-peach-2: #e88b68;
    --brand-cream:   #faf8f5;
    --brand-mint:    #7fb8a8;

    /* Семантические переменные — тёмная тема (по умолчанию) */
    --primary: var(--brand-peach);
    --primary-hover: var(--brand-peach-2);
    --accent: var(--brand-mint);

    --bg: #0a1f1e;
    --bg-card: rgba(19, 49, 47, 0.7);
    --border: rgba(255,255,255,0.1);
    --text: #f1f5f9;
    --text-muted: #94a3b8;

    --gradient: linear-gradient(135deg, #0d3b3a 0%, #1a5a56 40%, #f0a080 100%);
    --input-bg: rgba(255,255,255,0.04);
    --input-bg-focus: rgba(255,255,255,0.06);
}

html[data-theme="light"] {
    --primary: var(--brand-dark);
    --primary-hover: var(--brand-dark-2);
    --accent: var(--brand-peach);

    --bg: var(--brand-cream);
    --bg-card: rgba(255, 255, 255, 0.85);
    --border: rgba(13, 59, 58, 0.10);
    --text: #0d3b3a;
    --text-muted: #4a6b69;

    --input-bg: rgba(13, 59, 58, 0.03);
    --input-bg-focus: rgba(13, 59, 58, 0.05);
}

html {
    background: #0a1f1e;
}
html[data-theme="light"] {
    background: var(--brand-cream);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.7; }
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: background .3s ease;
}

/* Свечения на фоне */
.login-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    animation: float 8s ease-in-out infinite, pulse-glow 4s ease-in-out infinite;
}

.login-glow-1 {
    width: 500px;
    height: 500px;
    background: #0d3b3a;
    top: -150px;
    left: -150px;
    opacity: 0.7;
}

.login-glow-2 {
    width: 600px;
    height: 600px;
    background: #f0a080;
    bottom: -200px;
    right: -200px;
    opacity: 0.3;
    animation-delay: -4s;
}

/* Переключатель темы */
.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .15s, border-color .2s;
    z-index: 100;
}
.login-theme-toggle:hover {
    background: var(--input-bg-focus);
    border-color: rgba(240, 160, 128, 0.5);
}
.login-theme-toggle:active {
    transform: scale(0.94);
}
.login-theme-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Карточка входа */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.05);
    animation: fadeIn .6s cubic-bezier(.16,1,.3,1);
}

html[data-theme="light"] .login-container {
    box-shadow:
        0 20px 60px rgba(13, 59, 58, 0.10),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

/* Логотип + название */
.login-brand {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 32px;
    color: inherit;
    transition: opacity .15s;
}
.login-brand:hover { opacity: 0.9; }

.login-brand .logo-icon-img {
    height: 50px;
    width: auto;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(13, 59, 58, 0.15));
    content: url('../icons/logo-icon.svg');
}

html[data-theme="dark"] .login-brand .logo-icon-img {
    content: url('../icons/logo-icon-light.svg');
}

.login-brand .logo-text-img {
    height: 50px;
    width: auto;
    max-width: 180px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    /* Светлая тема — тёмная надпись */
    content: url('../icons/logo-text.png');
}

/* Тёмная тема — светлая надпись, чтобы читалось на тёмном фоне */
html[data-theme="dark"] .login-brand .logo-text-img {
    content: url('../icons/logo-text-light.png');
}

/* Ошибка */
.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
    animation: fadeIn .4s ease;
}

html[data-theme="light"] .login-error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* Поля ввода */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 4px;
}

.login-field input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: background .2s, border-color .2s, box-shadow .2s;
}
.login-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
.login-field input:focus {
    outline: none;
    background: var(--input-bg-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(240, 160, 128, 0.18);
}
html[data-theme="light"] .login-field input:focus {
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 4px rgba(13, 59, 58, 0.12);
}

/* ============================================================
   Выбор режима при регистрации: «Обычный» / «Аренда»
   ============================================================ */

.auth-mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input-bg);
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

/* Радиокнопка: общее правило .login-field input растянуло бы её на всю
   ширину и добавило бы ей паддинги полей ввода */
.login-field .auth-mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
    cursor: pointer;
    box-shadow: none;
    background: none;
    border: none;
}

.login-field .auth-mode-option input[type="radio"]:focus {
    box-shadow: none;
    background: none;
}

.auth-mode-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.auth-mode-option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.auth-mode-option-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.auth-mode-option:hover {
    border-color: var(--primary);
}

.auth-mode-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(240, 160, 128, 0.15);
}

html[data-theme="light"] .auth-mode-option:has(input[type="radio"]:checked) {
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 3px rgba(13, 59, 58, 0.10);
}

/* Чекбокс согласия */
.register-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}
.register-consent input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}
.register-consent a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.register-consent a:hover {
    text-decoration: underline;
}
html[data-theme="light"] .register-consent a {
    color: var(--brand-dark);
}

/* Кнопки */
.login-buttons {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    align-items: stretch;
}

.login-buttons button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    white-space: normal;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-login {
    background: var(--gradient);
    background-size: 200% 200%;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(13, 59, 58, 0.4);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(240, 160, 128, 0.45);
    animation: gradient-shift 3s ease infinite;
}
.btn-login:active {
    transform: translateY(0);
}

.btn-register {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 14px;
}
.btn-register:hover {
    background: var(--input-bg-focus);
    border-color: rgba(240, 160, 128, 0.5);
    color: var(--primary);
}
.btn-register:active {
    transform: scale(0.98);
}
html[data-theme="light"] .btn-register:hover {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
}

/* Футер карточки */
.field-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding-left: 4px;
    line-height: 1.4;
}

.login-footer {
    display: flex;
    justify-content: left;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .2s;
}
.login-footer a:hover {
    color: var(--primary);
}
html[data-theme="light"] .login-footer a:hover {
    color: var(--brand-dark);
}

/* Забыли пароль */
.forgot-password-row {
    text-align: right;
    margin: -4px 0 4px;
    padding-right: 4px;
}
.forgot-password-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s;
}
.forgot-password-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
html[data-theme="light"] .forgot-password-link:hover {
    color: var(--brand-dark);
}

/* Мобильная версия */
@media (max-width: 480px) {
    body.login-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 72px;
    }

    .login-theme-toggle {
        top: 14px;
        right: 14px;
        padding: 8px;
    }

    .login-container {
        padding: 28px 22px;
        border-radius: 20px;
    }

    .login-brand .logo-icon-img {
        height: 52px;
    }
    .login-brand .logo-text-img {
        height: 60px;
        max-width: 150px;
    }

    .login-field input {
        padding: 12px 14px;
        font-size: 15px;
    }

    .login-buttons {
        flex-direction: column;
    }

    .login-buttons button {
        padding: 13px 20px;
        min-height: 50px;
        width: 100%;
    }

    .login-glow-1 {
        width: 300px;
        height: 300px;
    }
    .login-glow-2 {
        width: 350px;
        height: 350px;
    }

    .login-footer {
        flex-wrap: wrap;
    }
}
/* ============================================================
   ГАЛОЧКА «ЗАПОМНИТЬ МЕНЯ»
   ============================================================ */
.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 0 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
    transition: background .15s, border-color .15s;
}
.remember-me:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}
.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.remember-me span {
    flex: 1;
    min-width: 0;
}

html[data-theme="light"] .remember-me {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.8);
}
html[data-theme="light"] .remember-me:hover {
    background: rgba(0, 0, 0, 0.05);
}