:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Fondo Animado de la Noche Estrellada */
.night-sky {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
}

.stars {
    position: absolute;
    width: 100%; height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 160px 120px, #ffffff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 5s infinite linear;
    opacity: 0.6;
}

@keyframes twinkle {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

.light-beam {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 120vh;
    background: radial-gradient(ellipse at top, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Contenedor Principal (Glassmorphism) */
.login-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 400px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Logo Animado */
.logo-wrapper {
    width: 110px;
    height: 110px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.3);
    position: relative;
}

.street-lamp-icon {
    width: 80%;
    height: 80%;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

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

.login-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.login-header h1 span {
    color: var(--primary);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 300;
}

/* Formulario */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper svg {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.input-icon-wrapper input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1rem 1rem 3rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-icon-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.input-icon-wrapper input:focus + svg,
.input-icon-wrapper input:not(:placeholder-shown) ~ svg {
    color: var(--primary);
}

/* Opciones Extra */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    accent-color: var(--primary);
    width: 16px; height: 16px;
    cursor: pointer;
}

.forgot-pwd {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-pwd:hover {
    color: var(--primary-dark);
}

/* Boton de Login */
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 1.1rem;
    border-radius: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(14, 165, 233, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.error-msg {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

/* Loading State */
.btn-login.loading {
    color: transparent;
    pointer-events: none;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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