/* ===== БАЗА ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Тёмная тема (по умолчанию) */
:root {
    --bg-form: #060b19;
    --bg-card: #111a35;
    --text-primary: #e8e8f0;
    --text-secondary: #8a8a9e;
    --border-color: #232d4d;
    --input-bg: #111a35;
    --input-border: #232d4d;
    --error-color: #e74c3c;
}

/* Светлая тема */
[data-theme="light"] {
    --bg-form: #f4f7ff;
    --bg-card: #ffffff;
    --text-primary: #16162a;
    --text-secondary: #6b6b85;
    --border-color: #d8dce8;
    --input-bg: #ffffff;
    --input-border: #d8dce8;
}

/* ===== ПАЛИТРА СЕРВИСОВ ===== */

/* Aion — синий градиент (по умолчанию) */
body[data-service="aion"] {
    --service-gradient: linear-gradient(135deg, #08457E 0%, #3A5A8A 55%, #C0C0C0 100%);
    --service-accent: #C0C0C0;
    --service-accent-soft: rgba(192, 192, 192, 0.2);
    --service-glow: rgba(192, 192, 192, 0.5);
}

/* Aster — фиолетовый градиент */
body[data-service="aster"] {
    --service-gradient: linear-gradient(315deg, #A167F5 0%, #0F2872 100%);
    --service-accent: #A167F5;
    --service-accent-soft: rgba(161, 103, 245, 0.2);
    --service-glow: rgba(161, 103, 245, 0.55);
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-form);
    color: var(--text-primary);
    overflow: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ===== КОНТЕЙНЕР ===== */
.auth-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* ===== ЛЕВАЯ ПАНЕЛЬ (БРЕНДИНГ) ===== */
.brand-panel {
    width: 50%;
    height: 100%;
    background: var(--service-gradient);
    transition: background 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;

}

.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15), transparent 50%);
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.brand-headline h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1.1;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.brand-headline p {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* Логотип Aster в карточке */
.service-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

/* Кликабельная карточка Aster */
.service-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(161, 103, 245, 0.35);
    border-color: var(--amethyst);
}

.service-link:hover .service-name {
    color: var(--amethyst);
}

.service-item:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

.service-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 20px;
}

.service-name {
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
}

.service-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
}

/* ===== ПРАВАЯ ПАНЕЛЬ (ФОРМА) ===== */
.form-panel {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 48px;
    position: relative;
    transition: background 0.4s ease;
}

.form-header {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.theme-toggle:hover {
    transform: rotate(20deg);
    border-color: var(--accent);
}

.form-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ===== АНИМИРОВАННЫЙ ЗАГОЛОВОК ===== */
.auth-header {
    height: 56px;
    overflow: hidden;
    margin-bottom: 24px;
}

.auth-titles {
    display: flex;
    width: 200%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.auth-header.register-active .auth-titles {
    transform: translateX(-50%);
}

.title {
    width: 50%;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ===== ТАБЫ ===== */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.auth-tab {
    background: none;
    border: none;
    padding: 12px 4px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    margin-right: 20px;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
    transition: background 0.4s ease;
}

/* ===== ПОЛЯ ФОРМЫ ===== */
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-top: 16px;
}

.field-label:first-child {
    margin-top: 0;
}

.input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Поле пароля с глазом */
.password-field {
    position: relative;
}

.password-field .input {
    padding-right: 48px;
}

.eye-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    user-select: none;
}

.eye-icon:hover {
    opacity: 1;
}

/* ===== СТРОКА ЗАПОМНИТЬ/ЗАБЫЛИ ===== */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 24px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.link {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--accent);
}

.link-strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-strong:hover {
    text-decoration: underline;
}

/* ===== КНОПКА ===== */
.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--service-gradient);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(8, 69, 126, 0.35);
    margin-top: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(192, 192, 192, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== ОШИБКИ ===== */
.error {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* ===== ФУТЕР ФОРМЫ ===== */
.form-footer {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    transition: border-color 0.4s ease;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* ===== ТАБ-КОНТЕНТ ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== АДАПТИВ ===== */
@media (max-width: 900px) {
    .auth-container {
        flex-direction: column;
    }

    .brand-panel {
        width: 100%;
        height: auto;
        padding: 40px 24px;
    }

    .brand-headline h1 {
        font-size: 32px;
    }

    .form-panel {
        width: 100%;
        padding: 24px;
    }
}
/* ===== ЗВЁЗДНЫЙ ФОН (два canvas) ===== */
.stars-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}

/* ТЁМНАЯ ТЕМА: звёзды справа (форма), левая скрыта */
:root #starsLeft  { opacity: 0; }
:root #starsRight { opacity: 1; }

/* СВЕТЛАЯ ТЕМА: звёзды слева (градиент), правая скрыта */
[data-theme="light"] #starsLeft  { opacity: 1; }
[data-theme="light"] #starsRight { opacity: 0; }


/* ===== ВОССТАНОВЛЕНИЕ ===== */
.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.highlight {
    color: var(--accent);
    font-weight: 600;
}

/* Поля кода */
/* Поля кода */
.code-inputs {
    display: flex;
    gap: 8px;
    margin: 24px 0;
    justify-content: center;
}

.code-square {
    width: 48px;
    height: 56px;
    flex: 0 0 48px;              /* фиксированная ширина */
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    padding: 0;
    box-sizing: border-box;
}

.code-square:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    transform: translateY(-2px);
}

.code-square.filled {
    border-color: var(--accent);
}

/* Кнопка "Отправить заново" */
.resend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.link-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.link-btn:not(:disabled):hover {
    text-decoration: underline;
}

.timer-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Вторая кнопка */
.btn-secondary {
    width: 100%;
    height: 48px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* Иконка успеха */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--service-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #ffffff;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== СЕКЦИЯ ВЫБОРА СЕРВИСА ===== */
.services-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.services-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 4px;
}

.services-hint {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
}

.services-hint strong {
    color: #ffffff;
    font-weight: 700;
}

/* Логотип в карточке сервиса */
.service-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

/* Кликабельная карточка сервиса */
.service-link {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.service-link:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

/* Выделение выбранного сервиса — свечение + подсветка, без галочек */
.service-link.selected {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.4),
        0 0 24px var(--service-glow),
        0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px) scale(1.02);
}

.service-link.selected .service-name {
    color: #ffffff;
    font-weight: 700;
}

.service-link.selected .service-icon {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 12px var(--service-glow);
}