/* ============================================================
   Login — Glassmorphism (estilos propios del proyecto)
   ============================================================ */
:root {
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --text-primary: #ffffff;
    --text-secondary: rgba(232, 228, 217, 0.75);
    --accent: #f2cb02;
    --accent-hover: #d4b102;
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.2);
    --radius: 20px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 45%, #0d0d0d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}
body::before {
    width: 500px;
    height: 500px;
    background: #f2cb02;
    top: -150px;
    left: -150px;
    animation: float 18s ease-in-out infinite;
}
body::after {
    width: 400px;
    height: 400px;
    background: #b8860b;
    bottom: -120px;
    right: -100px;
    animation: float 22s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    min-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
}

/* ============ FORMULARIO (Mobile First) ============ */
.form-side {
    flex: 1 1 100%;
    padding: 16px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
    overflow-y: auto;
    min-height: 0;
}

.form-side .brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: var(--accent);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    align-self: flex-start;
}
.form-side .brand i {
    font-size: 1.6rem;
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(242, 203, 2, 0.6));
}
.form-side .brand img {
    height: 60px;
    width: auto;
    display: block;
    margin-top: 0;
    /* El logo es negro; sobre el fondo dorado se ve con buen contraste. */
    /*filter: invert(1);*/
}

.form-side h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -1px;
    text-align: center;
}
.form-side .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 18px;
    font-weight: 300;
    text-align: center;
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 4px rgba(242, 203, 2, 0.2);
}
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--input-border);
    border-right: none;
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 10px 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.input-group .form-control {
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-group:focus-within .input-group-text {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(242, 203, 2, 0.15);
}
.input-group:focus-within .form-control {
    border-color: var(--accent);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: all 0.3s;
}
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(242, 203, 2, 0.3);
    border-color: var(--accent);
}
.form-check-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.btn-login {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-weight: 700;
    font-size: 1rem;
    color: #000;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(242, 203, 2, 0.35);
}
.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(242, 203, 2, 0.5);
    color: #000;
}
.btn-login:active { transform: translateY(0); }
.btn-login i { margin-right: 8px; }

.forgot-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s;
}
.forgot-link:hover { color: var(--accent); text-decoration: underline; }

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0 14px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    text-transform: uppercase;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.btn-google {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    color: #fff;
    width: 100%;
    backdrop-filter: blur(10px);
}
.btn-google:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    border-color: #4285F4;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}
.btn-google .google-icon {
    display: flex;
    align-items: center;
    gap: 2px;
}
.btn-google .google-icon span {
    font-size: 1.3rem;
    font-weight: 600;
}
.btn-google .google-icon .g { color: #4285F4; }
.btn-google .google-icon .o1 { color: #EA4335; }
.btn-google .google-icon .o2 { color: #FBBC05; }
.btn-google .google-icon .l { color: #34A853; }
.btn-google .google-icon .e { color: #EA4335; }

.signup-text {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.signup-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.signup-text a:hover { color: #ffe066; text-decoration: underline; }

/* ============ LADO DERECHO: IMAGEN (Desktop más ancha) ============ */
.image-side {
    flex: 1 1 100%;
    position: relative;
    background: url('../img/fondo-desktop-login.webp') center/cover no-repeat;
    display: none; /* Oculto por defecto (Mobile First) */
    align-items: flex-end;
    justify-content: flex-start;
    padding: 32px 32px;
    overflow: hidden;
    min-height: 0;
}

.image-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,13,13,0.3) 0%, rgba(13,13,13,0.55) 45%, rgba(13,13,13,0.85) 100%);
    z-index: 1;
}
.image-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(242, 203, 2, 0.08);
    z-index: 1;
    mix-blend-mode: overlay;
}

.image-content {
    position: relative;
    z-index: 2;
    color: #fff;
    max-width: 480px;
    /* Sube el bloque ~5 líneas respecto al borde inferior */
    margin-bottom: 5rem;
}
.image-content .badge-system {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    margin-bottom: 18px;
}
.image-content h2 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.image-content p {
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.image-content .feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.image-content .feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    font-weight: 300;
}
.image-content .feature-list li i {
    color: #f2cb02;
    font-size: 1rem;
    filter: drop-shadow(0 0 6px rgba(0,206,201,0.6));
}

/* ============ RESPONSIVE ============ */
/* Tablet y móvil: imagen oculta, formulario al 100% */
@media (max-width: 991.98px) {
    .login-container { max-width: 550px; }
    .form-side { padding: 16px 24px; }
    .form-side h1 { font-size: 1.6rem; }
    .image-side { display: none !important; }
}

/* Desktop: imagen más ancha que el formulario (60% / 40%) */
@media (min-width: 992px) {
    .login-container { max-width: 1300px; }
    .form-side {
        flex: 0 0 40%; /* 40% del ancho */
        padding: 20px 44px;
    }
    .image-side {
        flex: 0 0 60%; /* 60% del ancho → más ancha */
        display: flex !important;
    }
    .form-side h1 { font-size: 2rem; }
    .image-content h2 { font-size: 2.4rem; }
}

@media (max-width: 480px) {
    .login-container { border-radius: 16px; }
    .form-side { padding: 12px 18px; }
    .form-side h1 { font-size: 1.5rem; }
}

/* Animaciones */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Validación */
.form-control.is-valid {
    border-color: #00b894 !important;
    box-shadow: 0 0 0 4px rgba(0,184,148,0.15) !important;
}
.form-control.is-invalid {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 4px rgba(255,107,107,0.15) !important;
}
.invalid-feedback { display: none; font-size: 0.8rem; margin-top: 4px; color: rgba(255,255,255,0.7); }
.input-group:has(.form-control.is-invalid) .input-group-text {
    border-color: #ff6b6b;
    color: #ff6b6b;
}
.input-group:has(.form-control.is-valid) .input-group-text {
    border-color: #00b894;
    color: #00b894;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
