/* ============================================================
   AGRO-DATA · Login page (F3 design) — v2 robusta
   Estrategia: hero como overlay fixed en mitad izquierda,
   contenido de Filament empujado a mitad derecha.
   No depende de :has() ni del orden del DOM interno.
   ============================================================ */

/* Solo aplica en /admin/login (donde existe .agro-login-hero) */
body:has(.agro-login-hero) {
    background: #fafaf5 !important;
}

/* El layout simple de Filament: forzar a ocupar solo la mitad derecha */
body:has(.agro-login-hero) .fi-simple-layout {
    background: #fafaf5;
    margin-left: 50vw;
    width: 50vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

body:has(.agro-login-hero) .fi-simple-page {
    width: 100%;
    max-width: 28rem;
}

/* Ocultar logo de Filament (tenemos branding en hero) */
body:has(.agro-login-hero) .fi-simple-main .fi-logo,
body:has(.agro-login-hero) .fi-simple-page > .fi-logo {
    display: none;
}

/* Heading del form */
body:has(.agro-login-hero) .fi-simple-header .fi-header-heading {
    font-size: 1.75rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.025em;
    text-align: left;
}
body:has(.agro-login-hero) .fi-simple-header .fi-header-subheading {
    font-size: 0.925rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: left;
}
body:has(.agro-login-hero) .fi-simple-header {
    text-align: left;
}

/* ============================================================
   HERO panel (overlay fixed en mitad izquierda)
   ============================================================ */

.agro-login-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 50vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(140deg, #14532d 0%, #166534 50%, #15803d 100%);
    padding: 3rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    font-family: 'Poppins', system-ui, sans-serif;
    z-index: 1;
}

.agro-login-hero__sun {
    position: absolute;
    top: 80px;
    right: 80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 230, 138, 0.45), rgba(253, 230, 138, 0));
    pointer-events: none;
    animation: agro-sun-pulse 8s ease-in-out infinite;
}

@keyframes agro-sun-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.agro-login-hero__hills {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 280px;
    pointer-events: none;
}

.agro-login-hero__top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.agro-login-hero__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.agro-login-hero__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: #86efac;
}

.agro-login-hero__headline {
    position: relative;
    z-index: 1;
    max-width: 32rem;
    animation: agro-fade-up 0.8s ease-out 0.15s both;
}

@keyframes agro-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agro-login-hero__headline h2 {
    font-size: 2.625rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.agro-login-hero__headline p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 1rem;
    line-height: 1.55;
    max-width: 27.5rem;
}

.agro-login-hero__headline b {
    color: #bef264;
    font-weight: 600;
}

.agro-login-hero__fox-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.agro-login-hero__fox-avatar {
    width: 110px;
    height: 110px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
}

.agro-login-hero__fox-avatar img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    animation: agro-fox-blink 6s ease-in-out infinite;
    transform-origin: center 60%;
}

/* Parpadeo sutil: scaleY rápido en el medio del ciclo */
@keyframes agro-fox-blink {
    0%, 45%, 50%, 95%, 100% {
        transform: scaleY(1);
    }
    47% {
        transform: scaleY(0.1);
    }
    /* Doble parpadeo ocasional */
    72% {
        transform: scaleY(1);
    }
    74% {
        transform: scaleY(0.1);
    }
    76% {
        transform: scaleY(1);
    }
}

/* Respeto preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .agro-login-hero__sun,
    .agro-login-hero__headline,
    .agro-login-hero__fox-avatar img {
        animation: none;
    }
}

.agro-login-hero__fox-bubble {
    position: relative;
    padding: 0.875rem 1.125rem;
    background: #fff;
    color: #0f172a;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
    max-width: 20rem;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.agro-login-hero__fox-bubble-label {
    font-size: 0.6875rem;
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 0.1875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.agro-login-hero__fox-bubble b {
    font-weight: 600;
}

/* ============================================================
   Responsive: en pantallas chicas, hero arriba y form abajo
   ============================================================ */

@media (max-width: 900px) {
    body:has(.agro-login-hero),
    body:has(.agro-login-hero) .fi-body {
        background: #fafaf5 !important;
    }

    body:has(.agro-login-hero) {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    /* Anular CUALQUIER padding/max-width/centrado del wrapper de Filament */
    body:has(.agro-login-hero) .fi-simple-layout,
    body:has(.agro-login-hero) .fi-simple-main-ctn,
    body:has(.agro-login-hero) .fi-simple-main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }

    body:has(.agro-login-hero) .fi-simple-layout {
        flex: 1;
    }

    body:has(.agro-login-hero) .fi-simple-page {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    /* Form bajo el hero — recuperar el padding lateral */
    body:has(.agro-login-hero) .fi-simple-page > *:not(.agro-login-hero) {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    body:has(.agro-login-hero) .fi-simple-header {
        padding-top: 1.75rem;
    }

    .agro-login-hero {
        position: relative;
        width: 100% !important;
        height: auto;
        min-height: 320px;
        padding: 1.75rem 1.5rem 2rem;
        flex-shrink: 0;
        border-radius: 0;
        margin: 0;
    }

    .agro-login-hero__headline h2 {
        font-size: 1.5rem;
    }

    .agro-login-hero__headline p {
        display: none;
    }

    .agro-login-hero__fox-avatar {
        width: 64px;
        height: 64px;
    }

    .agro-login-hero__fox-avatar img {
        width: 52px;
        height: 52px;
    }

    .agro-login-hero__fox-bubble {
        font-size: 0.8125rem;
        padding: 0.625rem 0.875rem;
    }
}
