/* =========================================
   VARIABLES Y ESTILOS BASE
   ========================================= */
:root {
    --color-primario: #3b82f6;
    --color-oscuro: #0f172a;
    --fondo-suave: #f1f5f9;
    --blanco: #ffffff;
    --texto-titulos: #1e293b;
    --texto-oscuro: #64748b;
    --borde-tarjeta: #cbd5e1;
}

/* Variables de Modo Oscuro */
.dark-mode {
    --color-primario: #58a6ff;
    --color-oscuro: #010409;
    --fondo-suave: #0d1117;
    --blanco: #161b22;
    --texto-titulos: #e6edf3;
    --texto-oscuro: #8b949e;
    --borde-tarjeta: #30363d;
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background-color: var(--fondo-suave);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s;
}

.main-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* =========================================
   PANEL IZQUIERDO: PAISAJE ABSTRACTO (60%)
   ========================================= */
.left-panel {
    width: 60%;
    background: linear-gradient(180deg, #bbdefb 0%, #e3f2fd 40%, #c8e6c9 100%);
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    position: relative; 
    color: #1e293b; 
    overflow: hidden;
    transition: background 0.3s ease;
}

body.dark-mode .left-panel {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #064e3b 100%);
    color: white;
}

.left-panel::before, .left-panel::after {
    content: ""; position: absolute; width: 200%; height: 100%;
    top: 65%; left: -50%; border-radius: 42%; z-index: 1;
}
.left-panel::before { background-color: rgba(34, 197, 94, 0.4); animation: wave 20s infinite linear; }
.left-panel::after { background-color: rgba(59, 130, 246, 0.3); top: 70%; animation: wave 25s infinite linear; }

@keyframes wave {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sun-glow {
    position: absolute; top: 10%; left: 10%;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.6) 0%, rgba(253, 224, 71, 0) 70%);
    filter: blur(30px);
}

.welcome-content { position: relative; z-index: 10; text-align: center; }
.welcome-content h1 { font-size: 3.5rem; margin: 0; font-weight: 800; line-height: 1.1; }
.welcome-content p { font-size: 1.2rem; margin-top: 15px; opacity: 0.9; }

/* =========================================
   PANEL DERECHO: FORMULARIO (40%)
   ========================================= */
.right-panel {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--blanco);
    padding: 40px 35px;
    border-radius: 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 2px solid var(--color-oscuro);
    text-align: center;
    z-index: 20;
    transition: background 0.3s, border-color 0.3s;
}

.mini-logo { width: 70px; margin-bottom: 0.5rem; }
.login-card h2 { color: var(--texto-titulos); font-size: 1.8rem; margin-bottom: 1.5rem; margin-top: 0; }

/* MENSAJES */
.msg { padding: 10px; border-radius: 8px; margin-bottom: 20px; font-size: 0.85rem; border: 1px solid; }
.msg.error { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
body.dark-mode .msg.error { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.5); }

/* INPUTS BRUTALISTAS */
.input-group { margin-bottom: 1.2rem; text-align: left; }
.input-group label {
    display: block; font-size: 0.85rem; font-weight: 700;
    margin-bottom: 0.4rem; color: var(--texto-titulos);
}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper i { position: absolute; left: 1rem; color: var(--texto-oscuro); }

.input-wrapper input {
    width: 100%; padding: 0.8rem 1rem 0.8rem 2.5rem; font-size: 0.95rem;
    background: var(--blanco); border: 2px solid var(--color-oscuro);
    border-radius: 0.8rem; color: var(--texto-titulos);
    box-shadow: 3px 3px 0 var(--color-oscuro); outline: none;
    box-sizing: border-box; transition: all 0.2s;
}

.input-wrapper input:focus { transform: translate(-2px, -2px); box-shadow: 5px 6px 0 var(--color-primario); }
.toggle-password { position: absolute; right: 1rem; cursor: pointer; color: var(--texto-oscuro); left: auto !important; }

/* BOTONES */
.btn-submit {
    width: 100%; padding: 0.9rem; background: var(--color-oscuro); color: white;
    border: none; border-radius: 40px; font-weight: 700; font-size: 1rem;
    cursor: pointer; margin-top: 1rem; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-submit:hover { background: var(--color-primario); transform: translateY(-2px); }
body.dark-mode .btn-submit { color: #e6edf3; }

.divider { text-align: center; margin: 1.5rem 0; position: relative; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--borde-tarjeta); }
.divider span { position: relative; background: var(--blanco); padding: 0 10px; color: var(--texto-oscuro); font-size: 0.8rem; }

.btn-google {
    width: 100%; padding: 0.8rem; background: var(--blanco); border: 2px solid var(--borde-tarjeta);
    border-radius: 40px; display: flex; align-items: center; justify-content: center; gap: 10px;
    font-weight: 600; cursor: pointer; transition: 0.3s; color: var(--texto-titulos); font-size: 0.95rem;
    text-decoration: none;
}
.btn-google i { font-size: 1.2rem; color: #ea4335; }
.btn-google:hover { background: var(--fondo-suave); }

.footer-text { margin-top: 20px; font-size: 0.9rem; color: var(--texto-oscuro); text-align: center; }
.footer-text a { color: var(--color-primario); text-decoration: none; font-weight: 700; }
.footer-text a:hover { text-decoration: underline; }

/* RESPONSIVO */
@media (max-width: 900px) {
    .left-panel { display: none; } 
    .right-panel { width: 100%; }
}