/* ==========================================================================
   LOGIN.CSS — Página de Inicio de Sesión (Rediseño v2)
   Coherente con el sistema de diseño de styles.css
   ========================================================================== */

/* ── 1. Variables (hereda del sistema global) ── */
:root {
    --bg-page:            #f6f4ef;
    --bg-card:            #ffffff;
    --text-main:          #111111;
    --text-muted:         #6b7280;
    --border-color:       #e5e7eb;
    --accent-terracotta:  #bd593f;
    --accent-ocre:        #e4be6c;
    --input-border:       #d1d5db;
    --input-focus:        #bd593f;
    --input-bg:           #ffffff;
    --shadow-card:        0 20px 60px rgba(0, 0, 0, 0.08);
    --ease-out-expo:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:        cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-base:    0.25s ease;
    --radius-input:       12px;
    --radius-card:        22px;
    --topbar-height:      72px;
}

[data-theme="dark"] {
    --bg-page:            #0a0d1a;
    --bg-card:            #111629;
    --text-main:          #dde3f0;
    --text-muted:         #7a88aa;
    --border-color:       rgba(100, 130, 200, 0.1);
    --accent-terracotta:  #d4694d;
    --accent-ocre:        #c9a84c;
    --input-border:       rgba(100, 130, 200, 0.2);
    --input-focus:        #d4694d;
    --input-bg:           #161c35;
    --shadow-card:        0 20px 80px rgba(0, 0, 40, 0.5);
}

/* ── 2. Reset mínimo ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    min-height: 100%;
    overflow-y: auto;
}

body.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100dvh;
    min-height: 100vh; /* fallback */
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    transition: background-color 0.4s ease, color 0.3s ease;
    /* Fondo global */
    background-image: url('../Images/login-bg-v3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Overlay global para legibilidad — más fuerte a la derecha para suavizar el círculo naranja */
body.login-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(246, 244, 239, 0.35) 0%,
        rgba(246, 244, 239, 0.55) 40%,
        rgba(246, 244, 239, 0.78) 70%,
        rgba(246, 244, 239, 0.88) 100%
    );
    z-index: 0;
    pointer-events: none;
    transition: background 0.4s ease;
}

[data-theme="dark"] body.login-body::before {
    background: linear-gradient(
        to right,
        rgba(10, 13, 26, 0.75) 0%,
        rgba(10, 13, 26, 0.82) 40%,
        rgba(10, 13, 26, 0.90) 100%
    );
}

/* ========================================================
   3. TOPBAR — Barra superior con navegación + logos
   ======================================================== */
.login-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 4vw, 56px);
    z-index: 100;
    /* Glassmorphism sutil */
    background: rgba(246, 244, 239, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.4s ease, border-color 0.3s ease;
}

[data-theme="dark"] .login-topbar {
    background: rgba(10, 13, 26, 0.7);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ── Enlace "Volver al inicio" (dentro del topbar) ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color var(--transition-base), gap var(--transition-base);
    width: fit-content;
    position: relative;
    z-index: 2;
}

.back-link:hover {
    color: var(--accent-terracotta);
    gap: 12px;
}

.back-link svg {
    transition: transform var(--transition-base);
}

.back-link:hover svg {
    transform: translateX(-3px);
}

/* ── Logos institucionales (dentro del topbar) ── */
.left-logos {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 2;
}

.left-logo-puce {
    height: 58px;
    width: auto;
    object-fit: contain;
    display: block;
}

.left-logo-divider {
    width: 1.5px;
    height: 42px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--accent-terracotta),
        transparent
    );
    opacity: 0.45;
    flex-shrink: 0;
}

.left-logo-veredict {
    height: 52px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* ========================================================
   4. LAYOUT PRINCIPAL — Grid 2 columnas con max-width
   ======================================================== */
.login-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: 1fr; /* una sola fila que crece con el contenido */
    gap: 0;
    min-height: calc(100dvh - var(--topbar-height));
    min-height: calc(100vh - var(--topbar-height)); /* fallback */
    margin-top: var(--topbar-height);
    padding: 20px 0 32px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

/* ========================================================
   5. PANEL INFORMATIVO (Izquierda)
   ======================================================== */
.login-panel-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 40px 20px 48px;
    position: relative;
    /* Inicialmente invisible para animación de entrada */
    opacity: 0;
    transform: translateX(-30px);
    z-index: 1;
}

/* Centrado seguro: margin auto centra sin clipear */
.login-panel-left .left-hero-text {
    margin-top: auto;
    margin-bottom: auto;
}

/* ── Texto Hero (tarjeta con glassmorphism) ── */
.left-hero-text {
    z-index: 2;
    position: relative;
    max-width: 480px;
    width: 100%;
    /* Glassmorphism card */
    background: rgba(246, 244, 239, 0.6);
    padding: 36px 36px;
    border-radius: var(--radius-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .left-hero-text {
    background: rgba(17, 22, 41, 0.6);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.left-welcome {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent-terracotta);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.left-title {
    font-size: clamp(1.85rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.18;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* Texto cursiva "jurisprudencia" — usa Playfair Display Italic */
.left-title-em {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-style: italic;
    font-weight: 700;
    color: var(--accent-terracotta);
}

/* Barra naranja bajo el título */
.left-title-bar {
    width: 48px;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--accent-terracotta),
        var(--accent-ocre)
    );
    border-radius: 2px;
    margin-bottom: 20px;
    transform-origin: left;
}

.left-description {
    font-size: 0.94rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 400px;
}

/* Reforzar contraste del texto en modo claro */
.left-welcome {
    text-shadow: 0 1px 4px rgba(246, 244, 239, 0.5);
}

.left-title {
    text-shadow: 0 1px 6px rgba(246, 244, 239, 0.4);
}

.left-description {
    text-shadow: 0 1px 3px rgba(246, 244, 239, 0.3);
}

[data-theme="dark"] .left-welcome,
[data-theme="dark"] .left-title,
[data-theme="dark"] .left-description {
    text-shadow: none;
}

/* Elementos eliminados — mantenemos selectores para evitar errores en JS */
.left-image-wrap,
.left-scales-img,
.left-deco-shape {
    display: none;
}

/* ========================================================
   6. PANEL DE LOGIN (Derecha)
   ======================================================== */
.login-panel-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 48px 20px 40px;
    /* Inicialmente invisible para animación de entrada */
    opacity: 0;
    transform: translateX(30px);
    z-index: 1;
}

/* Centrado seguro: margin auto centra verticalmente pero si el
   contenido es más alto que el panel, se desborda hacia abajo
   (nunca se corta arriba) y permite scroll natural */
.login-panel-right .login-card {
    margin-top: auto;
    margin-bottom: auto;
}

/* ── Card blanca con Glassmorphism ── */
.login-card {
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-card);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: clamp(28px, 3.5vw, 40px) clamp(26px, 3vw, 40px);
    width: 100%;
    max-width: 460px;
    max-height: none; /* nunca recortar */
    /* Transiciones de tema */
    transition:
        background-color 0.4s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    transform: translateY(0);
}

/* ── Encabezado de la card ── */
.login-card-header {
    margin-bottom: 22px;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 10px;
    line-height: 1.1;
}

/* Barra naranja bajo el título */
.login-title-bar {
    width: 44px;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--accent-terracotta),
        var(--accent-ocre)
    );
    border-radius: 2px;
    margin-bottom: 10px;
    transform-origin: left;
    /* Animación de entrada */
    transform: scaleX(0);
    transition: transform 0.6s var(--ease-out-expo) 0.5s;
}

.login-card.is-ready .login-title-bar {
    transform: scaleX(1);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================================================
   7. FORMULARIO
   ======================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Grupo de campo ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
    transition: color var(--transition-base);
}

/* ── Input wrapper con ícono ── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-input);
    background-color: var(--input-bg);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.4s ease;
    overflow: hidden;
}

/* Hover del input-wrapper — sutil, NO indica error */
.input-wrapper:hover {
    border-color: color-mix(in srgb, var(--accent-terracotta) 35%, var(--input-border));
}

/* Focus del input-wrapper (clase añadida por JS) — terracota suave, sin parecer error */
.input-wrapper.is-focused {
    border-color: color-mix(in srgb, var(--accent-terracotta) 60%, var(--input-border));
    box-shadow: 0 0 0 3px rgba(189, 89, 63, 0.08);
}

/* Estado de error — solo cuando hay error real */
.input-wrapper.has-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Estado válido */
.input-wrapper.is-valid {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

/* Ícono del campo */
.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 0 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color var(--transition-base);
    pointer-events: none;
}

.input-wrapper.is-focused .input-icon {
    color: var(--accent-terracotta);
}

/* Input en sí */
.form-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.93rem;
    color: var(--text-main);
    padding: 14px 14px 14px 0;
    line-height: 1;
    -webkit-text-fill-color: var(--text-main);
    caret-color: var(--accent-terracotta);
}

/* Sobrescribir color de autocompletado del browser */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-input::placeholder {
    color: var(--input-border);
    opacity: 1;
}

/* ── Botón mostrar/ocultar contraseña ── */
.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 14px;
    color: var(--text-muted);
    transition: color var(--transition-base);
    flex-shrink: 0;
    outline: none;
    min-width: 44px;
    min-height: 44px;
}

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

.password-toggle:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: -2px;
    border-radius: 6px;
}

/* Manejo de los íconos del ojo */
.eye-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.eye-off { opacity: 1; transform: scale(1); }
.eye-on  { opacity: 0; transform: scale(0.7); position: absolute; }

/* Cuando se muestra la contraseña */
.password-toggle[aria-pressed="true"] .eye-off {
    opacity: 0;
    transform: scale(0.7);
}
.password-toggle[aria-pressed="true"] .eye-on {
    opacity: 1;
    transform: scale(1);
    position: static;
}

/* ── Mensajes de error de campo ── */
.field-error {
    font-size: 0.8rem;
    color: #ef4444;
    min-height: 0;
    display: block;
    font-weight: 500;
    line-height: 1.4;
}

/* Solo mostrar espacio y animar cuando hay contenido real */
.field-error:not(:empty) {
    min-height: 16px;
    animation: errorIn 0.25s var(--ease-out-expo) both;
}

@keyframes errorIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Fila Recordarme + Olvidé contraseña ── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -2px;
}

/* Checkbox personalizado */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

/* Checkmark SVG con pseudoelemento */
.checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 8px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.checkbox-input:checked + .checkbox-custom {
    background-color: var(--accent-terracotta);
    border-color: var(--accent-terracotta);
}

.checkbox-input:checked + .checkbox-custom::after {
    opacity: 1;
}

.checkbox-input:focus-visible + .checkbox-custom {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 2px;
}

.checkbox-text {
    font-size: 0.87rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Enlace "¿Olvidaste tu contraseña?" */
.forgot-link {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--accent-terracotta);
    text-decoration: none;
    transition: color var(--transition-base), opacity var(--transition-base);
    white-space: nowrap;
}

.forgot-link:hover {
    color: color-mix(in srgb, var(--accent-terracotta) 80%, black);
    text-decoration: underline;
}

.forgot-link:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── Error global del formulario ── */
.form-global-error {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #dc2626;
    font-weight: 500;
    display: none;
    animation: errorIn 0.3s var(--ease-out-expo);
}

.form-global-error.visible {
    display: block;
}

/* ========================================================
   8. BOTÓN PRINCIPAL — "Iniciar sesión"
   ======================================================== */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 24px;
    /* Fondo negro sólido fijo en modo claro — siempre visible */
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid transparent;
    border-radius: var(--radius-input);
    cursor: pointer;
    letter-spacing: 0.01em;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s var(--ease-spring),
        box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    outline: none;
    margin-top: 4px;
    z-index: 0;
}

/* Efecto brillo en hover */
.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:hover:not([data-loading="true"]) {
    background-color: var(--accent-terracotta) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(189, 89, 63, 0.40);
}

.btn-login:active:not([data-loading="true"]) {
    transform: translateY(0);
    box-shadow: none;
}

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

/* Estado de carga */
.btn-login[data-loading="true"] {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-login-text {
    position: relative;
    z-index: 2;
    transition: opacity 0.2s ease;
    color: inherit;
}

.btn-login[data-loading="true"] .btn-login-text {
    opacity: 0;
}

/* Spinner */
.btn-login-spinner {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-login[data-loading="true"] .btn-login-spinner {
    opacity: 1;
}

.btn-login-spinner svg {
    animation: spinnerRotate 0.8s linear infinite;
    stroke-dasharray: 50;
    stroke-dashoffset: 14;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

/* ========================================================
   9. DIVISOR SOCIAL
   ======================================================== */
.social-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
    transition: background-color 0.4s ease;
}

.divider-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ========================================================
   10. BOTONES SOCIAL LOGIN
   ======================================================== */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--bg-card);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-input);
    cursor: pointer;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s var(--ease-spring),
        box-shadow 0.25s ease;
    outline: none;
}

.btn-social:hover {
    background-color: var(--bg-page);
    border-color: color-mix(in srgb, var(--text-main) 25%, transparent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.btn-social:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-social:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 2px;
}

[data-theme="dark"] .btn-social:hover {
    background-color: var(--bg-card-alt, #161c35);
    box-shadow: 0 6px 20px rgba(0, 0, 40, 0.3);
}

/* ========================================================
   11. ENLACE DE REGISTRO
   ======================================================== */
.register-link-text {
    text-align: center;
    font-size: 0.87rem;
    color: var(--text-muted);
}

.register-link {
    color: var(--accent-terracotta);
    text-decoration: none;
    font-weight: 700;
    transition: color var(--transition-base);
}

.register-link:hover {
    color: color-mix(in srgb, var(--accent-terracotta) 80%, black);
    text-decoration: underline;
}

.register-link:focus-visible {
    outline: 2px solid var(--accent-terracotta);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ========================================================
   12. TOAST (notificación no bloqueante)
   ======================================================== */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--text-main);
    color: var(--bg-card);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.3s ease,
        transform 0.3s var(--ease-out-expo);
    z-index: 9999;
    white-space: nowrap;
    max-width: calc(100vw - 40px);
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-error {
    background-color: #ef4444;
    color: #ffffff;
}

.toast.toast-success {
    background-color: #22c55e;
    color: #ffffff;
}

/* ========================================================
   13. DARK MODE — Adaptaciones específicas login
   ======================================================== */
[data-theme="dark"] .login-panel-left {
    background-color: transparent;
}

[data-theme="dark"] .login-panel-right {
    background-color: transparent;
}

[data-theme="dark"] .login-card {
    background-color: rgba(17, 22, 41, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* DARK MODE: Botón terracotta */
[data-theme="dark"] .btn-login {
    background-color: #d4694d !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(212, 105, 77, 0.35);
    border-color: transparent;
}

[data-theme="dark"] .btn-login:hover:not([data-loading="true"]) {
    background-color: #b8452e !important;
    color: #ffffff !important;
    box-shadow: 0 8px 28px rgba(184, 69, 46, 0.5);
    transform: translateY(-2px);
}

[data-theme="dark"] .left-logo-puce {
    content: url('../Images/logoPUCE-blanco.png');
}

[data-theme="dark"] .left-logo-veredict {
    content: url('../Images/veredict-logo-white.png');
}

/* ========================================================
   14. RESPONSIVE
   ======================================================== */

/* ── Tablets y pantallas medianas ── */
@media (max-width: 1024px) {
    .login-layout {
        grid-template-columns: 1fr 1fr;
        max-width: 960px;
    }

    .login-panel-left {
        padding: 40px 32px 40px 40px;
    }

    .login-panel-right {
        padding: 40px 40px 40px 32px;
    }
}

/* ── Móvil: colapsar a 1 columna ── */
@media (max-width: 768px) {
    .login-topbar {
        height: 60px;
        padding: 0 20px;
    }

    .left-logo-puce {
        height: 38px;
    }

    .left-logo-veredict {
        height: 34px;
    }

    .left-logo-divider {
        height: 28px;
    }

    .login-layout {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin-top: 60px;
        padding: 16px 0;
        min-height: auto;
        gap: 0;
    }

    /* En móvil, formulario primero */
    .login-panel-right {
        order: -1;
        padding: 32px 20px 16px;
        opacity: 1;
        transform: none;
    }

    .login-panel-left {
        padding: 16px 20px 40px;
        opacity: 1;
        transform: none;
    }

    .left-hero-text {
        padding: 28px 24px;
        max-width: 100%;
    }

    .left-title {
        font-size: 1.5rem;
    }

    .left-description {
        font-size: 0.9rem;
        max-width: 100%;
    }

    .login-card {
        max-width: 100%;
    }
}

/* ── Móvil pequeño ── */
@media (max-width: 480px) {
    .login-topbar {
        padding: 0 16px;
    }

    .back-link span {
        /* Ocultar texto en pantallas muy pequeñas, dejar solo ícono */
        display: none;
    }

    .left-logos {
        gap: 12px;
    }

    .left-logo-puce {
        height: 34px;
    }

    .left-logo-veredict {
        height: 30px;
    }

    .left-logo-divider {
        height: 24px;
    }

    .login-panel-right {
        padding: 24px 16px 12px;
    }

    .login-panel-left {
        padding: 12px 16px 32px;
    }

    .left-hero-text {
        padding: 24px 20px;
    }

    .left-title {
        font-size: 1.35rem;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

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

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ========================================================
   15. PANTALLAS CON POCA ALTURA — Compactar formulario
   ======================================================== */
@media (max-height: 820px) {
    .login-layout {
        padding: 12px 0 24px;
    }

    .login-panel-left {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .login-panel-right {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .left-hero-text {
        padding: 28px 30px;
    }

    .login-card {
        padding: 24px 26px;
    }

    .login-card-header {
        margin-bottom: 16px;
    }

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

    .login-form {
        gap: 16px;
    }

    .form-input {
        padding: 12px 12px 12px 0;
    }

    .btn-login {
        padding: 13px 24px;
        margin-top: 2px;
    }

    .social-divider {
        margin: 14px 0 12px;
    }

    .social-buttons {
        gap: 8px;
        margin-bottom: 14px;
    }

    .btn-social {
        padding: 10px 20px;
    }
}

@media (max-height: 700px) {
    .login-card {
        padding: 20px 22px;
    }

    .login-card-header {
        margin-bottom: 12px;
    }

    .login-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

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

    .login-form {
        gap: 12px;
    }

    .form-input {
        padding: 10px 10px 10px 0;
    }

    .btn-login {
        padding: 11px 20px;
        font-size: 0.93rem;
    }

    .social-divider {
        margin: 10px 0 8px;
    }

    .social-buttons {
        gap: 6px;
        margin-bottom: 10px;
    }

    .btn-social {
        padding: 9px 16px;
        font-size: 0.88rem;
    }
}

/* ========================================================
   16. REDUCCIÓN DE MOVIMIENTO
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .login-panel-left,
    .login-panel-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   MODAL DE RECUPERAR CONTRASEÑA
============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 420px;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { transform: scale(0.95) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-title);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-title);
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}
