:root {
    --red: #e50914;
    --purple: #7d1fff;
    --bg: linear-gradient(180deg, #0a0a0a, #1a001a 60%, #0a0a0a);
    --text: #fff;
    --muted: #bdbdbd;
    --card-bg: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s ease;
}

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

html, body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
    min-height: 100vh;
    height: 100%;
    overflow-x: hidden;
    position: relative;
}

/* 🔥 CORREÇÃO: Remove scroll extra e parte branca */
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #0a0a0a;
    z-index: 1000;
}

/* ===== CABEÇALHO ===== */
.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    transition: var(--transition);
}

.landing-header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--red);
    letter-spacing: 0.5px;
}

/* ===== NAV DESKTOP ===== */
.nav-desktop {
    display: flex;
    gap: 30px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-desktop a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-desktop a:hover {
    color: var(--text);
}

.nav-desktop a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: var(--transition);
}

.nav-desktop a:hover::after {
    width: 100%;
}

/* ===== MENU MOBILE ===== */
.menu-mobile {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 8px;
    z-index: 101;
}

.menu-mobile span {
    width: 25px;
    height: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 2px;
}

.menu-mobile:hover span {
    background: var(--red);
}

.menu-mobile.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-mobile.active span:nth-child(2) {
    opacity: 0;
}

.menu-mobile.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px 0;
    display: none;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-item {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 16px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--red);
}

.mobile-menu-item.criar-loveflix {
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: white;
    font-weight: 700;
    border: none;
    margin: 8px 20px;
    border-radius: 10px;
    padding: 14px 25px;
    order: -1;
}

.mobile-menu-item.criar-loveflix:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }
    
    .menu-mobile {
        display: flex !important;
    }
}

/* ===== WRAPPER PRINCIPAL ===== */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

/* ===== CONTAINER DO LOGIN ===== */
.login-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px 35px; /* 🔥 Ajustado para ficar mais compacto */
    width: 100%;
    max-width: 420px; /* 🔥 Ligeiramente menor */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden; /* 🔥 CORREÇÃO: muda de visible para hidden */
    margin-top: 70px;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--purple));
    border-radius: 16px 16px 0 0; /* 🔥 CORREÇÃO: mantém a borda arredondada */
}

/* ===== SEÇÃO DE LOGIN ===== */
.login-section {
    display: none;
}

.login-section.active {
    display: flex;
    flex-direction: column;
    gap: 25px; /* 🔥 Reduzido o gap */
    animation: fadeInUp 0.5s ease;
}

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

/* ===== HEADER DO LOGIN ===== */
.login-header {
    text-align: center;
    margin-bottom: 0;
}

.login-logo {
    font-size: 2.5rem; /* 🔥 Reduzido do tamanho original */
    font-weight: 800;
    color: var(--red);
    margin-bottom: 12px; /* 🔥 Reduzido */
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--red), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header h2 {
    font-size: 1.4rem; /* 🔥 Ajustado */
    margin-bottom: 10px; /* 🔥 Reduzido */
    font-weight: 600;
    color: var(--text);
}

.login-header p {
    color: var(--muted);
    font-size: 0.9rem; /* 🔥 Reduzido */
    line-height: 1.4; /* 🔥 Ajustado */
}

/* ===== FORMULÁRIO ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px; /* 🔥 Reduzido */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 🔥 Reduzido */
}

label {
    font-size: 0.85rem; /* 🔥 Reduzido */
    color: var(--muted);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 14px 16px; /* 🔥 Reduzido */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px; /* 🔥 Reduzido */
    color: var(--text);
    font-size: 0.95rem; /* 🔥 Reduzido */
    transition: var(--transition);
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

input::placeholder {
    color: #8c8c8c;
}

/* ===== OPÇÕES DO FORMULÁRIO ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3px 0 8px 0; /* 🔥 Reduzido */
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px; /* 🔥 Reduzido */
    font-size: 0.85rem; /* 🔥 Reduzido */
    color: var(--muted);
    cursor: pointer;
    font-weight: 400;
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 16px; /* 🔥 Reduzido */
    height: 16px; /* 🔥 Reduzido */
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remember-me input:checked + .checkmark {
    background: var(--red);
    border-color: var(--red);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 10px; /* 🔥 Reduzido */
    font-weight: bold;
}

.forgot-password {
    color: var(--muted);
    font-size: 0.85rem; /* 🔥 Reduzido */
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password:hover {
    color: var(--red);
}

/* ===== BOTÃO ENTRAR ===== */
.submit-btn {
    width: 100%;
    padding: 14px; /* 🔥 Reduzido */
    background: linear-gradient(135deg, var(--red), var(--purple));
    color: white;
    border: none;
    border-radius: 10px; /* 🔥 Reduzido */
    font-size: 0.95rem; /* 🔥 Reduzido */
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* 🔥 Reduzido */
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.3);
    margin-top: 8px; /* 🔥 Reduzido */
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(229, 9, 20, 0.4);
    background: linear-gradient(135deg, #f40612, #9d3fff);
}

.arrow {
    font-weight: bold;
    transition: transform 0.3s ease;
}

.submit-btn:hover .arrow {
    transform: translateX(3px);
}

/* ===== FOOTER DO LOGIN ===== */
.login-footer {
    text-align: center;
    margin-top: 15px; /* 🔥 Reduzido */
    padding-top: 15px; /* 🔥 Reduzido */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    color: var(--muted);
    font-size: 0.85rem; /* 🔥 Reduzido */
}

.create-account {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.create-account:hover {
    color: #ff6b6b;
    text-decoration: underline;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 25px; /* 🔥 Mais compacto no mobile */
        margin: 0 15px; /* 🔥 Menos margem lateral */
        margin-top: 70px;
        max-width: 380px; /* 🔥 Menor no mobile */
    }
    
    .login-logo {
        font-size: 2.2rem; /* 🔥 Ajustado para mobile */
        margin-bottom: 10px;
    }
    
    .login-header h2 {
        font-size: 1.2rem; /* 🔥 Ajustado para mobile */
        margin-bottom: 8px;
    }
    
    .login-header p {
        font-size: 0.85rem; /* 🔥 Ajustado para mobile */
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px; /* 🔥 Reduzido */
        align-items: flex-start;
    }
    
    .login-form {
        gap: 16px; /* 🔥 Reduzido para mobile */
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 20px; /* 🔥 Mais compacto em telas pequenas */
        margin: 0 12px; /* 🔥 Menos margem lateral */
        margin-top: 70px;
        max-width: 100%; /* 🔥 Usa toda a largura disponível */
    }
    
    .login-logo {
        font-size: 2rem; /* 🔥 Menor em telas pequenas */
        margin-bottom: 8px;
    }
    
    .login-header h2 {
        font-size: 1.1rem; /* 🔥 Menor em telas pequenas */
        margin-bottom: 6px;
    }
    
    .login-header p {
        font-size: 0.8rem; /* 🔥 Menor em telas pequenas */
        line-height: 1.3;
    }
    
    input {
        padding: 12px 14px; /* 🔥 Mais compacto */
        font-size: 0.9rem;
    }
    
    .submit-btn {
        padding: 12px; /* 🔥 Mais compacto */
        font-size: 0.9rem;
    }
    
    .login-form {
        gap: 14px; /* 🔥 Mais compacto */
    }
}

/* ===== ESTADOS DE LOADING ===== */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px; /* 🔥 Reduzido */
    height: 18px; /* 🔥 Reduzido */
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== MENSAGENS DE ERRO ===== */
.error-message {
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #ff6b6b;
    padding: 10px 14px; /* 🔥 Reduzido */
    border-radius: 8px;
    font-size: 0.85rem; /* 🔥 Reduzido */
    margin-bottom: 12px; /* 🔥 Reduzido */
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 🔥 CORREÇÕES CRÍTICAS: Remove scroll extra e parte branca */
html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* Garante que o gradiente cubra toda a área */
.login-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: -1;
}

@supports (-webkit-touch-callout: none) {
    body {
        background-attachment: scroll;
        height: -webkit-fill-available;
    }
    
    .login-wrapper {
        min-height: -webkit-fill-available;
    }
}