﻿/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos generales - Variables para modo claro/oscuro */
:root {
    /* Modo Oscuro (default) */
    --bg-gradient-start: #0a0f2a;
    --bg-gradient-end: #030617;
    --card-bg: rgba(10, 20, 40, 0.75);
    --card-border: rgba(0, 123, 255, 0.2);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --input-bg: rgba(20, 30, 55, 0.6);
    --input-border: rgba(0, 123, 255, 0.3);
    --label-color: #a0c0e0;
    --text-color: #ffffff;
    --link-color: #00d4ff;
    --link-hover: #ffffff;
    --modal-bg: linear-gradient(135deg, rgba(15, 25, 45, 0.95), rgba(5, 10, 25, 0.98));
    --modal-text: #c0d0e8;
    --particle-color: radial-gradient(circle, #007bff, #00d4ff);
    --particle-opacity: 0.3;
    --input-focus-effect: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

body.light {
    /* Modo Claro */
    --bg-gradient-start: #f0f9ff;
    --bg-gradient-end: #d9e6f5;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 123, 255, 0.2);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 123, 255, 0.3);
    --label-color: #1e3a5f;
    --text-color: #1e2a3a;
    --link-color: #007bff;
    --link-hover: #0056b3;
    --modal-bg: #ffffff;
    --modal-text: #4b5563;
    --particle-color: radial-gradient(circle, #007bff, #00a3ff);
    --particle-opacity: 0.4;
    --input-focus-effect: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 20% 50%, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    transition: background 0.4s ease;
}

/* Partículas de fondo animadas */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00d4ff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #007bff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80px 120px, #00d4ff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 40px, #007bff, rgba(0,0,0,0));
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: var(--particle-opacity);
    animation: drift 20s linear infinite;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

@keyframes drift {
    0% { transform: translateY(0px) translateX(0px); }
    100% { transform: translateY(-200px) translateX(100px); }
}

/* Botón Toggle Modo Claro/Oscuro - Estilo profesional con Font Awesome */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    font-weight: 500;
    letter-spacing: 0.3px;
    color: var(--text-color);
}

body:not(.light) .theme-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 123, 255, 0.5);
    background: var(--card-bg);
}

.theme-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: currentColor;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* Contenedor principal */
.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Tarjeta de login con efecto glassmorphism - Elegante y sutil */
.login-form {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 40px 35px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
    animation: floatIn 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.login-form:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo con efecto sutil */
.logo {
    max-height: 100px;
    width: auto;
    display: block;
    margin: 0 auto 15px;
    filter: drop-shadow(0 0 8px rgba(0, 123, 255, 0.3));
    transition: filter 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 0 12px rgba(0, 123, 255, 0.5));
}

/* Título con gradiente */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #ffffff, #00d4ff, #007bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

body.light h1 {
    background: linear-gradient(135deg, #0056b3, #007bff, #00a3ff);
    -webkit-background-clip: text;
    background-clip: text;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #007bff, #00d4ff, transparent);
    border-radius: 3px;
}

/* Grupos de input - Estilo elegante sin sombras agresivas */
.input-group {
    margin-bottom: 24px;
    text-align: left;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--label-color);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 16px;
    color: var(--text-color);
    transition: all 0.3s ease;
    outline: none;
}

/* Efecto de foco elegante y sutil - Reemplazo de sombras agresivas */
.input-group input:focus {
    border-color: #007bff;
    background: var(--input-bg);
    box-shadow: var(--input-focus-effect);
}

.input-group input::placeholder {
    color: rgba(160, 192, 224, 0.5);
    font-size: 13px;
}

.password-field {
    position: relative;
}

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

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--label-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus {
    color: #00d4ff;
    outline: none;
}

body.light .toggle-password:hover,
body.light .toggle-password:focus {
    color: #007bff;
}

/* Efecto de foco en label */
.input-group:focus-within label {
    color: #00d4ff;
}

body.light .input-group:focus-within label {
    color: #007bff;
}

/* Botón con efecto elegante */
.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(1px);
}

/* Texto inferior */
p {
    font-size: 14px;
    margin-top: 25px;
    color: var(--label-color);
}

/* Links con efecto elegante */
a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 5px;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--link-color), #007bff);
    transition: width 0.3s ease;
}

a:hover {
    color: var(--link-hover);
}

a:hover::after {
    width: 100%;
}

/* Modal mejorado */
.modal-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeInBackdrop 0.3s ease;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(12px);
    padding: 35px;
    border-radius: 32px;
    width: 380px;
    text-align: center;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

body.light .modal-content {
    background: var(--modal-bg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h3 {
    font-size: 26px;
    margin-bottom: 15px;
    font-weight: 700;
}

.modal-content.success {
    border-top: 3px solid #22c55e;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
}

.modal-content.success h3 {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-content.error {
    border-top: 3px solid #ef4444;
    border-top-left-radius: 32px;
    border-top-right-radius: 32px;
}

.modal-content.error h3 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-content p {
    color: var(--modal-text);
    margin: 20px 0;
    font-size: 15px;
}

.modal-content button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 40px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
}

/* Responsive */
@media (max-width: 500px) {
    .container {
        padding: 15px;
    }
    
    .login-form {
        padding: 30px 25px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .modal-content {
        width: 90%;
        padding: 25px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
    }
    
    .theme-toggle span {
        display: none;
    }
    
    .theme-toggle i {
        font-size: 18px;
    }
}

/* Efecto de partículas flotantes */
.particle {
    position: fixed;
    border-radius: 50%;
    background: var(--particle-color);
    opacity: 0;
    pointer-events: none;
    animation: floatParticle 8s ease-in-out infinite;
}

@keyframes floatParticle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}
