/* =========================================================================
   login.css — Pantalla de acceso del panel

   Splash deliberado: mantiene su identidad de marca en ambos temas y no
   comparte tokens con el panel interior. Extraído sin cambios desde
   AdminPanelProvider::estilosPersonalizados() al mover el CSS a archivos.
   ========================================================================= */

:root {
    --uncp-azul:     #1a3a6b;
    --uncp-azul-10:  rgba(26,58,107,0.08);
    --uncp-azul-20:  rgba(26,58,107,0.15);
}

/* ── Animaciones ───────────────────────────────────────── */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-12px); }
}
@keyframes spinRing {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Layout split-screen ───────────────────────────────── */
body:has(.fi-simple-layout) {
    background: #0d1f42 !important;
    overflow: hidden !important;
}

/* Panel izquierdo: blanco, 50% */
.fi-simple-layout {
    width: 50% !important;
    max-width: 50% !important;
    min-height: 100vh !important;
    background: #ffffff !important;
    flex-direction: column !important;
    align-items: stretch !important;
    animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

.fi-simple-main-ctn {
    flex: 1 !important;
    width: 100% !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 3rem 3.5rem !important;
}

/* Card sin sombra ni borde — el panel blanco es la "card" */
.fi-simple-main {
    max-width: 22rem !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.fi-simple-header {
    padding: 0 !important;
    margin-bottom: 2.25rem !important;
    align-items: center !important;
    width: 100% !important;
}

/* ── Encabezado del formulario ─────────────────────────── */
.fi-login-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.375rem;
    width: 100%;
}

.fi-login-logo {
    height: 3.75rem;
    width: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.25s forwards;
}

.fi-login-titulo {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: 0;
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.35s forwards;
}

.fi-login-subtitulo {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 400;
    margin: 0;
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.45s forwards;
}

/* ── Formulario ────────────────────────────────────────── */
.fi-simple-page {
    opacity: 0;
    animation: fadeUp 0.5s ease 0.5s forwards;
}

.fi-simple-main label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    letter-spacing: 0.005em !important;
}

.fi-simple-main .fi-input {
    border-radius: 0.625rem !important;
    border-color: #e2e8f0 !important;
    background: #f8fafc !important;
    font-size: 0.9rem !important;
    padding: 0.65rem 0.875rem !important;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s !important;
}
.fi-simple-main .fi-input:focus {
    border-color: #1a3a6b !important;
    box-shadow: 0 0 0 3px rgba(26,58,107,0.1) !important;
    background: #ffffff !important;
    outline: none !important;
}

/* Botón Iniciar sesión */
.fi-simple-main .fi-btn[data-color="primary"],
.fi-simple-main .fi-btn.fi-color-primary {
    width: 100% !important;
    justify-content: center !important;
    padding-top: 0.8rem !important;
    padding-bottom: 0.8rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    border-radius: 0.75rem !important;
    background: #1a3a6b !important;
    box-shadow: 0 4px 16px rgba(26,58,107,0.3) !important;
    letter-spacing: 0.01em !important;
    transition: all 0.2s ease !important;
    margin-top: 0.375rem !important;
}
.fi-simple-main .fi-btn[data-color="primary"]:hover,
.fi-simple-main .fi-btn.fi-color-primary:hover {
    background: #163166 !important;
    box-shadow: 0 6px 22px rgba(26,58,107,0.4) !important;
    transform: translateY(-1px) !important;
}

/* ── Panel decorativo derecho ──────────────────────────── */
.fi-login-panel-derecho {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: 50%; height: 100%;
    background: linear-gradient(150deg, #0a1832 0%, #1a3a6b 55%, #1e4d8c 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body:has(.fi-simple-layout) .fi-login-panel-derecho {
    display: flex !important;
}

/* Orbs */
.fi-rp-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.fi-rp-orb-1 {
    width: 380px; height: 380px;
    top: -100px; right: -80px;
    background: radial-gradient(circle, rgba(37,99,235,0.28) 0%, transparent 65%);
}
.fi-rp-orb-2 {
    width: 280px; height: 280px;
    bottom: -60px; left: -50px;
    background: radial-gradient(circle, rgba(96,165,250,0.18) 0%, transparent 65%);
}
.fi-rp-orb-3 {
    width: 160px; height: 160px;
    top: 38%; left: 8%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

/* Anillos giratorios */
.fi-rp-ring {
    position: absolute;
    pointer-events: none;
}
.fi-rp-ring-1 {
    width: 300px; height: 300px;
    top: -50px; right: -50px;
    transform-origin: center;
    animation: spinRing 40s linear infinite;
}
.fi-rp-ring-2 {
    width: 440px; height: 440px;
    bottom: -80px; left: -80px;
    transform-origin: center;
    animation: spinRing 55s linear infinite reverse;
}

/* Contenido central */
.fi-rp-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    max-width: 20rem;
}

.fi-rp-logo-wrap {
    margin-bottom: 1.75rem;
    animation: floatY 5s ease-in-out infinite;
    display: flex;
    justify-content: center;
    width: 100%;
}

.fi-rp-logo {
    height: 8rem;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 28px rgba(0,0,0,0.45)) brightness(1.08);
}

.fi-rp-logo-placeholder {
    width: 7rem; height: 7rem;
    border-radius: 2rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
}
.fi-rp-logo-placeholder svg {
    width: 3.5rem; height: 3.5rem;
    stroke: rgba(255,255,255,0.8);
}

.fi-rp-titulo {
    font-size: 1.625rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 0.5rem;
    text-align: center;
    width: 100%;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.4s forwards;
}

.fi-rp-sub {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.55;
    margin: 0 0 2rem;
    text-align: center;
    width: 100%;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.5s forwards;
}

.fi-rp-divider {
    width: 2.5rem;
    height: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 9999px;
    margin-bottom: 1.75rem;
    opacity: 0;
    animation: fadeUp 0.4s ease 0.55s forwards;
}

.fi-rp-features {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    width: 100%;
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0;
}

.fi-rp-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}
.fi-rp-feature:nth-child(1) { animation-delay: 0.6s; }
.fi-rp-feature:nth-child(2) { animation-delay: 0.72s; }
.fi-rp-feature:nth-child(3) { animation-delay: 0.84s; }

.fi-rp-feature-icon {
    width: 2rem; height: 2rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
}
.fi-rp-feature-icon svg {
    width: 0.9375rem; height: 0.9375rem;
    fill: rgba(255,255,255,0.8);
}
.fi-rp-feature span:last-child {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}

/* Footer del panel */
.fi-rp-footer {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.01em;
}

/* ── Notificación error SSO ────────────────────────────── */
.fi-sso-error {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.25rem;
    animation: fadeUp 0.35s ease both;
}
.fi-sso-error-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: #ef4444;
    margin-top: 1px;
}
.fi-sso-error-icon svg {
    width: 100%;
    height: 100%;
}
.fi-sso-error-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.fi-sso-error-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0;
}
.fi-sso-error-email {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #7f1d1d;
    background: rgba(239,68,68,0.08);
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    margin: 0.25rem 0 0;
    display: inline-block;
    font-family: 'Inter', monospace;
}
.fi-sso-error-msg {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin: 0;
    line-height: 1.45;
}
.fi-sso-error-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
    text-decoration: none;
    margin-top: 0.25rem;
    display: inline-block;
}
.fi-sso-error-link:hover {
    text-decoration: underline;
}

/* ── Botón Microsoft ───────────────────────────────────── */
.fi-ms-wrap {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.fi-ms-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.fi-ms-divider-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.fi-ms-divider-text {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.fi-ms-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 0.75rem;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.fi-ms-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Responsive ≤ 1024px ──────────────────────────────────── */
@media (max-width: 1024px) {

    body:has(.fi-simple-layout) {
        background: transparent !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 100vh !important;
    }

    /* Panel decorativo: fullscreen como fondo animado */
    body:has(.fi-simple-layout) .fi-login-panel-derecho {
        display: flex !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 0 !important;
        animation: none !important;
    }

    /* Ocultar solo el contenido de texto del panel */
    .fi-rp-content,
    .fi-rp-footer {
        display: none !important;
    }

    /* Layout: encima del panel, pantalla completa */
    .fi-simple-layout {
        position: relative !important;
        z-index: 1 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-height: 100vh !important;
        background: transparent !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 1.5rem !important;
        animation: none !important;
        box-sizing: border-box !important;
    }

    /* Contenedor interno */
    .fi-simple-main-ctn {
        width: 100% !important;
        max-width: 26rem !important;
        min-height: unset !important;
        flex: unset !important;
        padding: 0 !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* Card blanca con sombra profunda */
    .fi-simple-main {
        width: 100% !important;
        max-width: 100% !important;
        background: #ffffff !important;
        border-radius: 1.5rem !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
        --tw-ring-shadow: none !important;
        padding: 2rem !important;
        margin: 0 !important;
    }

    /* Header centrado */
    .fi-simple-header {
        align-items: center !important;
        margin-bottom: 1.5rem !important;
        padding: 0 !important;
    }

    .fi-login-heading {
        align-items: center !important;
        text-align: center !important;
    }
    .fi-login-titulo,
    .fi-login-subtitulo {
        text-align: center !important;
    }
    .fi-login-subtitulo {
        color: #64748b !important;
    }

    /* Sin animaciones de opacidad residual en el form */
    .fi-simple-page,
    .fi-login-logo,
    .fi-login-titulo,
    .fi-login-subtitulo {
        opacity: 1 !important;
        animation: none !important;
    }

    .fi-ms-btn {
        background: #f8fafc !important;
    }
}

/* ── Móvil pequeño ≤ 480px ─────────────────────────────── */
@media (max-width: 480px) {
    .fi-simple-layout {
        padding: 1rem !important;
    }
    .fi-simple-main {
        padding: 1.5rem 1.25rem !important;
        border-radius: 1.25rem !important;
    }
    .fi-login-logo {
        height: 3rem !important;
    }
    .fi-login-titulo {
        font-size: 1.5rem !important;
    }
    .fi-login-subtitulo {
        font-size: 0.8125rem !important;
    }
}
