/* css/signup_style.css */
/* ======================================== */
/*          1. ОБЩИЕ СТИЛИ СТРАНИЦЫ         */
/* ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #030005;
    --accent-orange: #f03c02;
    --accent-hover: #ff5e29;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --glass-bg: rgba(15, 15, 15, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --brand-purple: #8288dd;
    --brand-pink: #CF10EA;
}

body {
    width: 100%;
    height: 100%;
    background-color: #fff; /* Цвет на случай, если картинка долго грузится */
    color: #ffffff;
    overflow: hidden;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


.gateway-wrapper {
    display: flex;
    justify-content: center;
    align-items: center; /* Центрирует форму по вертикали */
    min-height: 100vh;   /* Позволяет скроллить, если экран по высоте маленький */
    
    /* Верхний отступ 60px защитит от прилипания к верху, 
       а нижний 100px оставит место для вашего футера */
    padding: 60px 20px 100px 20px; 
    
    background-color: #44494f; 
    background-image: url('../img/iptv-bg.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* ======================================== */
/*        2. ОСНОВНОЙ КОНТЕЙНЕР ФОРМЫ       */
/* ======================================== */

.container {
    width: 100%;
    max-width: 480px; /* Идеальная, не слишком широкая форма */
    padding: 50px 40px;
    
    /* ДОБАВЛЕНО: Безопасный внутренний скролл */
    max-height: calc(100vh - 160px); /* Высота экрана минус отступы враппера (60 + 100) */
    overflow-y: auto;
    
    /* Остальное ваше родное стекло (без изменений): */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    text-align: left;
    
    transform: translateY(30px);
    opacity: 0;
    animation: fadeUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
}

/* ДОБАВЛЕНО: Красивый полупрозрачный ползунок скролла, чтобы не портить "Стекло" */
.container::-webkit-scrollbar {
    width: 6px;
}
.container::-webkit-scrollbar-track {
    background: transparent; 
}
.container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 10px;
}
.container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); 
}

h2 {
    margin-bottom: 30px;
    color: var(--brand-white);
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* ======================================== */
/*           3. ЭЛЕМЕНТЫ ФОРМЫ              */
/* ======================================== */

.form-group {
    position: relative;
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0a0; /* Приглушенный текст */
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 15px;
    box-sizing: border-box;
    /* Стеклянные инпуты */
    background-color: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    transition: all 0.3s ease;
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-input:focus {
    border-color: #8288dd;
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(130, 136, 221, 0.2);
    outline: none;
}

button {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    font-family: 'Comfortaa', cursive;
    background: rgba(130, 136, 221, 0.1);
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid #8288dd;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

button:hover {
    background: transparent;
    box-shadow: 0 0 15px rgba(240, 60, 2, 0.3);
    border: 1px solid #CF10EA; /* Фирменный розовый при наведении */
    transform: translateY(-1px);
}

/* ======================================== */
/*        4. СТИЛИ И ИНДИКАТОРЫ ВАЛИДАЦИИ   */
/* ======================================== */

/* --- Подсветка полей (с легким неоновым эффектом для стекла) --- */
.email-valid,
.name-valid,
.password-valid {
    border-color: #38c172 !important;
    box-shadow: 0 0 12px rgba(56, 193, 114, 0.25) !important;
}

.email-invalid,
.name-invalid,
.password-invalid {
    border-color: #f05060 !important;
    box-shadow: 0 0 12px rgba(240, 80, 96, 0.25) !important;
}

/* --- Индикатор статуса E-mail --- */
.email-status {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 1.2em;
    z-index: 10;
}

/* --- Кнопка "глаз" для пароля --- */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    z-index: 10;
    color: #8288dd; /* Заменил серый на фирменный */
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #CF10EA;
}

/* --- Текстовые подсказки под полями --- */
.validation-hint {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.5); /* Полупрозрачный белый вместо серого */
    font-size: 12px;
    line-height: 1.4;
    font-family: 'Comfortaa', sans-serif;
}

/* ======================================== */
/*        5. СООБЩЕНИЯ И УВЕДОМЛЕНИЯ        */
/* ======================================== */

.message {
    padding: 12px;
    /* Идеальные отступы, чтобы сообщение стояло по центру между элементами */
    margin: 20px 0 25px 0;
    border-radius: 7px;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

.success {
	background: linear-gradient(180deg, rgba(10, 30, 15, 0.2) 0%, rgba(5, 10, 8, 0.3) 100%);
    color: #a8f0c3;
    border: 1px solid rgba(56, 193, 114, 0.4);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.error {
	background: linear-gradient(180deg, rgba(30, 10, 15, 0.2) 0%, rgba(10, 5, 8, 0.3) 100%);
    color: #ffb8bd;
    border: 1px solid rgba(240, 80, 96, 0.4);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

#footer {
    font-family: system-ui, -apple-system, sans-serif;
    position: fixed;
    text-align: center; 
    bottom: 0;
    left: 0;
    padding: 0; 
    line-height: 1.2; 
    background: #303338;
    color: #fff;
    font-size: small;
    width: 100%;
    z-index: 100;
}

/* ======================================== */
/*        6. АНИМАЦИИ И АДАПТИВНОСТЬ        */
/* ======================================== */

@keyframes fadeUpIn { 
    to { opacity: 1; transform: translateY(0); } 
}

/* Планшеты и телефоны */
@media (max-width: 768px) {
    .container {
        padding: 40px 25px;
    }
    h2 {
        font-size: 26px;
    }
    .form-input, button {
        padding: 12px;
        font-size: 14px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 380px) {
    .container {
        padding: 30px 20px;
    }
    h2 {
        font-size: 22px;
    }
}

/* ======================================== */
/*        7. ЧЕКБОКС И СОГЛАШЕНИЕ           */
/* ======================================== */

.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 5px;
    margin-bottom: 25px;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important; /* Защита от сплющивания */
    min-height: 18px !important; /* Защита от сплющивания */
    flex-shrink: 0; /* Запрещаем Flexbox'у сжимать чекбокс */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.25);
    margin: 0 12px 0 0;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}   transition: all 0.3s ease;


.checkbox-group input[type="checkbox"]:checked {
    background-color: rgba(130, 136, 221, 0.2);
    border-color: var(--brand-purple);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    color: var(--brand-purple);
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group label {
    margin-bottom: 0;
    text-transform: none;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-group a {
    color: var(--brand-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

.checkbox-group a:hover {
    color: var(--brand-pink);
    text-decoration: underline;
}

/* Стили неактивной кнопки */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

button:disabled:hover {
    box-shadow: none;
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ======================================== */
/*             8. МОДАЛЬНОЕ ОКНО            */
/* ======================================== */

.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    /* Мы удалили opacity: 0; и animation: fadeInModal ... */
}

@keyframes fadeInModal {
    to { opacity: 1; }
}

.modal-content {
    /* Точная копия Liquid Glass от основной формы регистрации с приоритетом !important */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
    border-radius: 20px !important;
    
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    padding: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-modal {
    /* Удаляем position, top и right, чтобы шапка нормально обхватывала крестик */
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #ec4899;
}

.modal-content > h2 {
    text-align: center;
    font-size: 18px; 
    color: #ffffff;
    letter-spacing: 2px; 
    margin-top: 0;
    padding-bottom: 20px; 
    margin-bottom: 20px;  
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    width: 100%;
}

/* 2. Запрещаем появление любых линий под заголовками внутри самого текста */
.terms-text h1, 
.terms-text h2, 
.terms-text h3 {
    color: #ffffff !important;
    border-bottom: none !important; /* Убиваем лишнюю черту */
    padding-bottom: 0 !important;   /* Убираем лишний отступ для черты */
}

/* ======================================== */
/*   10. ШАПКА ОКНА И ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ  */
/* ======================================== */

.glass-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px; /* Отступ от кнопок до ПЕРВОЙ линии */
    margin-bottom: 20px;  /* Отступ от ПЕРВОЙ линии до заголовка h2 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* ПЕРВАЯ ЛИНИЯ */
    z-index: 10;
    width: 100%;
}

/* Переключатель языков */
.glass-lang-switcher {
    display: flex;
    gap: 0.5rem;
}

.glass-lang-btn {
    padding: 0.4rem 1.2rem; 
    border-radius: 999px;
    font-size: 0.85rem; 
    font-weight: 500;
    text-transform: uppercase; 
    color: rgba(255, 255, 255, 0.4); 
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.03), 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-lang-btn:hover {
    color: #f14692 !important; 
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    transform: translateY(-2px); 
    box-shadow: none !important; /* Убиваем глобальную красную тень */
}

/* Активное состояние кнопки языка */
.glass-lang-btn.active {
    color: #f14692 !important; 
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.15) !important; 
    box-shadow: none !important; /* Убиваем глобальную красную тень */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Немного осветлим текст соглашения, чтобы он хорошо читался на стекле */
.terms-text {
    flex-grow: 1;
    overflow-y: auto;
    color: #ffffff !important; 
    font-size: 15px;
    line-height: 1.6;
    padding-right: 15px;
    text-align: justify;
}

.terms-text h1, .terms-text h2, .terms-text h3 {
    color: #ffffff !important;
}

/* Стилизация скроллбара в модальном окне */
.terms-text::-webkit-scrollbar {
    width: 6px;
}
.terms-text::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.terms-text::-webkit-scrollbar-thumb {
    background: var(--brand-purple);
    border-radius: 3px;
}

.loader-text {
    text-align: center;
    color: var(--brand-purple);
    font-style: italic;
    margin-top: 20px;
}

/* =========================================
   КАСТОМНЫЙ СКРОЛЛБАР В СТИЛЕ "СТЕКЛО"
   ========================================= */

/* Для Firefox: задаем тонкий скролл и цвета (бегунок / фон) */
.terms-text {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Для Webkit-браузеров (Chrome, Safari, Edge) */

/* 1. Задаем ширину всей полосы прокрутки */
.terms-text::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 2. Убираем фон дорожки (трека), делаем его невидимым */
.terms-text::-webkit-scrollbar-track {
    background: transparent;
}

/* 3. Стилизуем сам бегунок (thumb) */
.terms-text::-webkit-scrollbar-thumb {
    /* Полупрозрачный матовый цвет */
    background-color: rgba(255, 255, 255, 0.25); 
    /* Делаем его в форме пилюли */
    border-radius: 10px;
    /* Тончайшая граница для эффекта стекла */
    border: 1px solid rgba(255, 255, 255, 0.1); 
}

/* 4. Делаем бегунок чуть ярче при наведении */
.terms-text::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* 5. Полностью скрываем уродливые кнопки-стрелки */
.terms-text::-webkit-scrollbar-button {
    display: none;
}