/* ==========================================
   SENA Panel - Login
   ========================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --verde-oscuro: #1b5e20;
    --verde: #2e7d32;
    --verde-claro: #4caf50;
    --texto: #2b3a2e;
    --texto-suave: #5f6b62;
    --borde-input: #c9d8cc;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;

    /* Fondo panorámico 16:9: llena la pantalla sin deformarse */
    background: var(--verde-oscuro) url('../img/fondo_sena.png') center center / cover no-repeat;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
}

/* ---------- Tarjeta ---------- */
.login-card {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid rgba(76, 175, 80, 0.6);
    border-radius: 30px;
    padding: 40px 44px 40px;
    text-align: center;
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.35),
        0 0 28px rgba(76, 175, 80, 0.45),
        0 22px 50px rgba(0, 0, 0, 0.28);
}

/* Hojita decorativa en la esquina */
.hoja-decorativa {
    position: absolute;
    top: -26px;
    left: -22px;
    width: 46px;
    height: 46px;
    transform: rotate(-20deg);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.25));
}

/* ---------- Encabezado ---------- */
.logo-container {
    margin-bottom: 6px;
}

.sena-logo {
    width: 140px;
    height: auto;
    mix-blend-mode: multiply; /* disimula el fondo blanco del PNG */
}

.login-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--verde-oscuro);
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--texto);
    margin-bottom: 12px;
}

.login-regional {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--verde);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 26px;
}

.login-regional::before,
.login-regional::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--verde);
    opacity: 0.7;
    border-radius: 2px;
}

/* ---------- Alerta ---------- */
.alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c62828;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-bottom: 18px;
    text-align: left;
}

/* ---------- Formulario ---------- */
.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 10px;
}

.label-icono {
    width: 26px;
    height: 26px;
    color: var(--verde-oscuro);
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
}

.input-icono {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: #37563b;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 56px;
    padding: 0 50px 0 58px;
    border: 1.5px solid var(--borde-input);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--texto);
    background: rgba(255, 255, 255, 0.85);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrapper input::placeholder {
    color: #8a9a8d;
}

.input-wrapper input:focus {
    border-color: var(--verde);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.15);
    background: #fff;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #37563b;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--verde);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--verde);
}

/* ---------- Botón ---------- */
.btn-login {
    width: 100%;
    height: 62px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(180deg, #2e7d32 0%, #1b5e20 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(27, 94, 32, 0.35);
    transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-login svg {
    width: 28px;
    height: 28px;
}

.btn-login:hover {
    filter: brightness(1.1);
    box-shadow: 0 10px 22px rgba(27, 94, 32, 0.45);
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login:focus-visible {
    outline: 3px solid var(--verde-claro);
    outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
    .login-card {
        padding: 34px 22px 26px;
        border-radius: 24px;
    }

    .login-title {
        font-size: 1.8rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .sena-logo {
        width: 110px;
    }

    .hoja-decorativa {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
