/* =========================================
   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, html {
    width: 100%;
    height: 100%;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    background-color: #fff;
    color: var(--text-main);
    overflow: hidden;
}

/* =========================================
   3. ОБЩИЙ ФОН И КОНТЕЙНЕР (GLASSMORPHISM)
   ========================================= */
.gateway-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 40px 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;
}

/* Переделанный .container под стиль .glass-panel */
.container {
    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;
    padding: 50px 40px;
    width: 100%;
    max-width: 450px; /* Оптимальная ширина для формы входа */
    text-align: left; /* Возвращаем выравнивание текста для формы */
    transform: translateY(30px);
    opacity: 0;
    animation: fadeUpIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    display: flex;
    flex-direction: column;
}

h2 {
    margin-bottom: 30px;
    color: var(--brand-white); /* Фирменный сиреневый вместо старого оранжевого */
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
}

p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 25px;
    font-family: 'Comfortaa', sans-serif;
    font-size: 14px;
}

/* ======================================== */
/*           4. ЭЛЕМЕНТЫ ФОРМЫ              */
/* ======================================== */

.form-group {
    position: relative;
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    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: var(--text-main);
    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: var(--brand-purple);
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 15px rgba(130, 136, 221, 0.2);
    outline: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    z-index: 10;
    color: var(--brand-purple);
    cursor: pointer;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--brand-pink);
}

/* Стилизация кнопки отправки под .btn-outline из Liquid Glass */
button {
    width: 100%;
    padding: 14px;
    margin-top: 15px;
    font-family: 'Comfortaa', cursive;
    background: rgba(130, 136, 221, 0.1); /* Легкая заливка для выделения */
    color: var(--text-main);
    font-size: 16px;
    font-weight: 400;
    border: 1px solid var(--brand-purple);
    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 var(--brand-pink);
    transform: translateY(-1px);
}

/* ======================================== */
/*        5. СООБЩЕНИЯ И УВЕДОМЛЕНИЯ        */
/* ======================================== */

.message {
    padding: 12px;
    /* Убрали margin-top и задали равномерные отступы: 20px сверху и 25px снизу */
    margin: 20px 0 25px 0; 
    border-radius: 7px;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

.success {
    background-color: rgba(56, 193, 114, 0.2);
    color: #7DDD51;
    border: 1px solid #38c172;
}

.error {
    background-color: rgba(240, 80, 96, 0.2);
    color: #FFCECE;
    border: 1px solid #f05060;
}

/* ======================================== */
/*            6. ССЫЛКИ И УТИЛИТЫ           */
/* ======================================== */

.links-group {
    margin-top: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.links-group a {
    color: var(--brand-purple);
    font-size: 0.9em;
    text-decoration: none;
    font-family: 'Comfortaa', sans-serif;
    transition: all 0.3s ease;
}

.links-group a:hover {
    color: var(--brand-pink);
    text-shadow: 0 0 8px rgba(207, 16, 234, 0.4);
}

.hidden {
    display: none !important;
}

/* Перекрашиваем ТОЛЬКО ссылку регистрации в бледно-серый */
.links-group a.reg-link {
    color: var(--text-muted); 
}

/* (По желанию) Чтобы при наведении она не становилась розовой, а просто чуть светлела */
.links-group a.reg-link:hover {
    color: var(--text-main); /* Становится белой */
    text-shadow: none; /* Убираем розовое свечение */
}
/* =========================================
   7. ФУТЕР
   ========================================= */
#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;
}

/* =========================================
   8. АНИМАЦИИ И АДАПТИВНОСТЬ
   ========================================= */
@-webkit-keyframes spin { 
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } 
}
@keyframes spin { 
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } 
}

@-webkit-keyframes pulseText { 
    0%, 100% { opacity: 0.5; } 
    50% { opacity: 1; } 
}
@keyframes pulseText { 
    0%, 100% { opacity: 0.5; } 
    50% { opacity: 1; } 
}

@keyframes fadeUpIn { 
    to { opacity: 1; transform: translateY(0); } 
}

/* Планшеты и телефоны */
@media (max-width: 768px) {
    .container {
        padding: 40px 25px;
        margin: 15px;
    }
    
    h2 {
        font-size: 26px;
    }

    .form-input, button {
        padding: 12px;
        font-size: 14px;
    }
}

/* Совсем маленькие экраны */
@media (max-width: 380px) {
    .container {
        padding: 30px 20px;
    }
    
    h2 {
        font-size: 22px;
    }
}