:root {
    --primary: #2d3748;
    --accent: #28a745;
    --danger: #e53e3e;
    --white: #ffffff;
    --text-muted: #718096;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    /* Imagen de fondo que cubre toda la pantalla */
    background: url('../img/Fondo.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Capa oscura sobre el fondo para que la tarjeta resalte */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.main-wrapper {
    position: relative;
    z-index: 1;
    width: 95vw;
    max-width: 1100px;
    height: 700px;
    display: flex;
}

.login-container {
    background: var(--white);
    width: 100%;
    height: 100%;
    display: flex;
    border-radius: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* DECORACIÓN LATERAL (Lado con imagen interna) */
.side-decoration {
    flex: 1;
    background: url('../img/el-hermoso-ala-de-mariposa-de-cerca.jpg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-decoration::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9) 0%, rgba(40, 167, 69, 0.8) 100%);
}

.side-decoration .overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px;
}

.side-decoration i { font-size: 5rem; margin-bottom: 20px; opacity: 0.9; }
.side-decoration h2 { font-size: 2.2rem; margin-bottom: 15px; font-weight: 700; }
.side-decoration p { font-size: 1rem; line-height: 1.6; margin-bottom: 30px; }

.ghost-btn {
    padding: 12px 35px;
    background: transparent;
    border: 2px solid white;
    color: white;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.ghost-btn:hover { background: white; color: var(--accent); }

/* CONTENIDO DEL FORMULARIO */
.form-content {
    flex: 1.2;
    padding: 60px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.form {
    width: 100%;
    max-width: 380px;
    display: none; /* Controlado por JS */
}

.form.active {
    display: block;
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.icon-box {
    width: 60px;
    height: 60px;
    background: #f0fdf4;
    color: var(--accent);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

.form-header { text-align: center; margin-bottom: 30px; }
.form-header h3 { color: var(--primary); font-size: 1.8rem; font-weight: 700; }
.form-header p { color: var(--text-muted); font-size: 0.9rem; }

/* INPUTS */
.input-group { position: relative; margin-bottom: 20px; }
.input-group i {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 14px 15px 14px 50px;
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

/* BOTÓN */
.primary-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.2);
}
.primary-btn:hover { background: #218838; transform: translateY(-2px); }

.forgot {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 15px;
}

.form-footer { margin-top: 25px; text-align: center; font-size: 0.9rem; }
.form-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* ALERTAS */
.alert {
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@media (max-width: 850px) {
    .side-decoration { display: none; }
    .main-wrapper { height: auto; max-width: 450px; }
    .form-content { padding: 40px 20px; }
}