/* ============================================================
   BOLIVIA HOME — LOGIN PREMIUM
   Glassmorphism split-panel, colores Bolivia Home
   ============================================================ */

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

img { max-width: 100%; height: auto; }

body.login-page {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    overflow: hidden;
    position: relative;
}

/* ── FONDO ─────────────────────────────────────────────────── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('/images/FONDO%20HOME.jpg');
    background-size: cover;
    background-position: center;
    filter: blur(3px) brightness(0.50);
    transform: scale(1.06);
}
.login-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(8, 16, 8, 0.78) 0%,
        rgba(15, 28, 12, 0.68) 50%,
        rgba(5, 12, 5, 0.85) 100%);
}

/* ── TARJETA PRINCIPAL ─────────────────────────────────────── */
.login-card {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    width: calc(100% - 3rem);
    max-width: 860px;
    min-height: 520px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 8px 24px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.13);
    animation: cardIn 0.55s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── PANEL BASE ────────────────────────────────────────────── */
.login-panel {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── PANEL IZQUIERDO — FORMULARIO ──────────────────────────── */
.login-form-panel {
    flex: 1 1 55%;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(22px) saturate(1.8);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    border-right: 1px solid rgba(255,255,255,0.12);
}

.login-header {
    margin-bottom: 28px;
}
.login-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}
.login-header p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.62);
    line-height: 1.55;
}

/* Alertas */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.83rem;
    margin-bottom: 18px;
}
.login-alert-error {
    background: rgba(220,53,69,0.16);
    border: 1px solid rgba(220,53,69,0.30);
    color: #ffb3bb;
}
.login-alert-success {
    background: rgba(34,197,94,0.14);
    border: 1px solid rgba(34,197,94,0.28);
    color: #d4ff7a;
}

/* Campos */
.login-field {
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 0.80rem;
    font-weight: 600;
    color: rgba(255,255,255,0.80);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.field-label-row label { margin-bottom: 0; }
.forgot-link {
    font-size: 0.78rem;
    color: #22c55e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.forgot-link:hover { color: #c6f030; }

.login-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 11px;
    font-size: 0.875rem;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}
.login-field input::placeholder { color: rgba(255,255,255,0.38); }
.login-field input:focus {
    border-color: #22c55e;
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
.login-field input.is-invalid {
    border-color: rgba(220,53,69,0.65);
}
.field-error {
    display: block;
    font-size: 0.78rem;
    color: #ffb3bb;
    margin-top: 5px;
}

/* Password con toggle */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.pw-toggle:hover { color: #22c55e; }

/* Recuérdame */
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 20px;
}
.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #22c55e;
    cursor: pointer;
}
.login-remember label {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.70);
    cursor: pointer;
    font-weight: 500;
    margin: 0;
}

/* Botón login */
.btn-login {
    width: 100%;
    height: 46px;
    background: #22c55e;
    border: none;
    border-radius: 11px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-login:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34,197,94,0.32);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; }

.login-register {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    margin-top: 16px;
}
.login-register a {
    color: #22c55e;
    font-weight: 600;
    text-decoration: none;
}
.login-register a:hover { color: #c6f030; }

/* ── PANEL DERECHO — BRANDING ──────────────────────────────── */
.login-brand-panel {
    flex: 0 0 42%;
    background: rgba(20, 35, 15, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.brand-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
}
.brand-logo {
    width: 110px;
    max-width: 110px;
    height: auto;
    display: block;
    filter: none;
    animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
.brand-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1.2;
}
.brand-tagline {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.3px;
}
.brand-sub {
    font-size: 0.79rem;
    color: rgba(255,255,255,0.52);
    line-height: 1.55;
    max-width: 220px;
}

/* ── REGISTER: grid 2 columnas para contraseñas ─────────────── */
.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}
@media (max-width: 500px) {
    .register-grid { grid-template-columns: 1fr; }
}

/* ── LOADING OVERLAY ───────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,10,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-inner {
    text-align: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(34,197,94,0.20);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-inner p {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 680px) {
    .login-card {
        max-width: 420px;
        min-height: 480px;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    .login-brand-panel {
        display: none;
    }
    .login-form-panel {
        flex: 1 1 100%;
        border-right: none;
    }
    .login-panel { padding: 36px 28px; }
}

@media (max-width: 400px) {
    .login-card {
        margin: 0.5rem;
        width: calc(100% - 1rem);
        border-radius: 20px;
    }
    .login-panel { padding: 28px 20px; }
    .login-header h1 { font-size: 1.45rem; }
}
