@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Variables - Dark Mode (Default) */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: #6366f1;
    --btn-bg: #4f46e5;
    --btn-hover: #4338ca;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --status-bg: rgba(0,0,0,0.4);
    --accent-color: #6366f1;
}

[data-theme="light"] {
    /* Variables - Light Mode */
    --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus: #4f46e5;
    --btn-bg: #4f46e5;
    --btn-hover: #4338ca;
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    --status-bg: rgba(255,255,255,0.6);
    --accent-color: #4f46e5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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

/* Decoraciones de fondo (Burbujas difuminadas) */
body::before, body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}
body::before {
    background: rgba(99, 102, 241, 0.4);
    top: -100px;
    left: -100px;
}
body::after {
    background: rgba(236, 72, 153, 0.3);
    bottom: -100px;
    right: -100px;
}

/* Botón flotante para cambiar tema */
.theme-toggle {
    position: absolute;
    top: 30px;
    right: 30px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}
.theme-toggle:hover {
    transform: translateY(-2px);
}

/* Indicador de Estado DB */
.db-status {
    position: absolute;
    top: 30px;
    left: 30px;
    background: var(--status-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow);
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b; /* Gris por defecto (cargando) */
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}
.status-dot.connected {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-green 2s infinite;
}
.status-dot.error {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: pulse-red 2s infinite;
}

/* Tarjeta Principal de Login */
.login-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}
.login-logo-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-logo-title i {
    font-size: 34px;
    color: var(--accent-color);
}
.logo-img-login {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
}
.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Formulario */
.input-group {
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}
.input-group input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Botón de Submit */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}
.btn-submit:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--btn-bg);
}
.btn-submit:active {
    transform: translateY(0);
}

/* Mensajes de Error/Éxito */
.message-box {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: none;
}
.message-box.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.message-box.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Animaciones */
@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Footer de la página de Login */
.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}
