/**
 * Estilos completos para Login
 * /assets/css/login.css
 */

/* RESET Y BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --fg: #e7ecff;
    --muted: #aab3d6;
    --brand: #5c7cff;
    --brand2: #3f62ff;
    --bg: #070a14;
    --white: 14, 18, 36;
    --tint: 92, 124, 255;
    --shadow-glass: 0 24px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Cuadrícula de fondo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%) 0 0/84px 84px,
        linear-gradient(90deg, transparent 49%, rgba(255,255,255,.05) 50%, transparent 51%) 0 0/84px 84px,
        var(--bg);
    z-index: -2;
}

/* Decoración: Líneas curvas y círculos */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 700' preserveAspectRatio='none'%3E%3Cpath d='M100 520 C 260 320, 520 560, 720 340 S 980 140, 1100 340' fill='none' stroke='%235c7cff' stroke-width='1.5'/%3E%3Cpath d='M180 610 C 340 450, 560 520, 800 520 S 1000 420, 1140 600' fill='none' stroke='%235c7cff' stroke-width='1.5'/%3E%3Ccircle cx='180' cy='520' r='6' fill='%235c7cff' fill-opacity='0.4'/%3E%3Ccircle cx='300' cy='480' r='5' fill='%235c7cff' fill-opacity='0.3'/%3E%3Ccircle cx='740' cy='360' r='6' fill='%235c7cff' fill-opacity='0.4'/%3E%3Ccircle cx='860' cy='540' r='5' fill='%235c7cff' fill-opacity='0.3'/%3E%3Ccircle cx='1040' cy='320' r='6' fill='%235c7cff' fill-opacity='0.4'/%3E%3Ccircle cx='940' cy='420' r='5' fill='%235c7cff' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    opacity: .22;
    z-index: -1;
    pointer-events: none;
}

.top-sheen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    z-index: 1000;
}

/* NAVEGACIÓN FIJA - ESTANDARIZADA CON EL SITIO */
.main-nav {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1400px, 94vw);
    max-width: 1400px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    z-index: 1000;
}

.nav-container {
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--fg);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,.10);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--fg);
}

.sun-icon { display: block; }
.moon-icon { display: none; }

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* MAIN - Ajustado para el nav estandarizado */
.page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1rem 2rem; /* Ajustado para el nav top: 14px */
    width: min(1400px, 94vw);
    max-width: 1400px;
    margin: 0 auto;
}

.login-section {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: rgba(var(--white), 0.65);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-glass);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    width: 80px;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--muted);
}

.hint {
    background: rgba(var(--tint), 0.1);
    border: 1px solid rgba(var(--tint), 0.25);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--brand);
}

.hint code {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-family: monospace;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--fg);
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--fg);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(var(--tint), 0.15);
}

.form-group input::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand2));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Fredoka', sans-serif;
    box-shadow: 0 8px 20px rgba(var(--tint), 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(var(--tint), 0.4);
}

.links {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.links a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.links a:hover {
    text-decoration: underline;
}

.divider {
    margin: 0.75rem 0;
    opacity: 0.5;
}

/* FOOTER */
.main-footer {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.10);
    padding: 3rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-logo {
    margin-bottom: 1rem;
}

.footer-tagline {
    color: var(--muted);
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-family: 'Fredoka', sans-serif;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.10);
    color: var(--muted);
    font-size: 0.9rem;
}

/* LIGHT MODE - Cristal PRO Light REAL */
[data-theme="light"] {
    --fg: #0f172a;
    --muted: #475569;
    --bg: #eef1f5;
    --white: 255, 255, 255;
    --brand: #2744f8;
    --brand2: #1f37d6;
    --tint: 39, 68, 248;
    --shadow-glass: 0 24px 60px rgba(2,6,23,.18), inset 0 1px 0 rgba(255,255,255,.65);
}

[data-theme="light"]::before {
    background:
        linear-gradient(transparent 49%, rgba(0,0,0,.06) 50%, transparent 51%) 0 0/80px 80px,
        linear-gradient(90deg, transparent 49%, rgba(0,0,0,.06) 50%, transparent 51%) 0 0/80px 80px,
        var(--bg);
    opacity: .95;
}

/* Líneas curvas y círculos decorativos - EXACTO del diseño original */
[data-theme="light"]::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 700' preserveAspectRatio='none'%3E%3Cpath d='M100 520 C 260 320, 520 560, 720 340 S 980 140, 1100 340' fill='none' stroke='%23b0b6c1' stroke-width='1.2'/%3E%3Cpath d='M180 610 C 340 450, 560 520, 800 520 S 1000 420, 1140 600' fill='none' stroke='%23b0b6c1' stroke-width='1.2'/%3E%3Ccircle cx='180' cy='520' r='5' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3Ccircle cx='300' cy='480' r='4' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3Ccircle cx='740' cy='360' r='5' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3Ccircle cx='860' cy='540' r='4' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3Ccircle cx='1040' cy='320' r='5' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3Ccircle cx='940' cy='420' r='4' fill='%23ffffff' stroke='%23b0b6c1' stroke-width='.8'/%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    opacity: .45;
}

/* Nav con efecto glassmorphism REAL - Light Mode */
[data-theme="light"] .main-nav {
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    background:
        linear-gradient(to bottom right, rgba(var(--white),.42), rgba(var(--white),.20)),
        linear-gradient(to top left, rgba(var(--tint),.14), rgba(var(--tint),.06));
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--shadow-glass);
    /* Mantiene las mismas dimensiones que dark */
    top: 14px;
    border-radius: 18px;
}

[data-theme="light"] .nav-link:hover {
    background: rgba(39, 68, 248, 0.08);
}

[data-theme="light"] .theme-toggle {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Card con glassmorphism REAL */
[data-theme="light"] .login-card {
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    background:
        linear-gradient(to bottom right, rgba(var(--white),.42), rgba(var(--white),.20)),
        linear-gradient(to top left, rgba(var(--tint),.14), rgba(var(--tint),.06));
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: var(--shadow-glass);
}

[data-theme="light"] .form-group input {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--fg);
}

[data-theme="light"] .form-group input:focus {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--tint), 0.15);
}

[data-theme="light"] .hint {
    background: rgba(39, 68, 248, 0.08);
    border-color: rgba(39, 68, 248, 0.2);
    color: var(--brand);
}

/* Footer con glassmorphism */
[data-theme="light"] .main-footer {
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    background:
        linear-gradient(to bottom right, rgba(var(--white),.42), rgba(var(--white),.20)),
        linear-gradient(to top left, rgba(var(--tint),.14), rgba(var(--tint),.06));
    border-top: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 -10px 30px rgba(2,6,23,.08);
}

[data-theme="light"] .footer-links a {
    color: var(--muted);
}

[data-theme="light"] .footer-links a:hover {
    color: var(--brand);
}

@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .login-card {
        padding: 2rem;
    }
}
