/**
 * Estilos para Login — Carrusel estilo "Slim Layout" + Layout 70/30
 * Paleta: Forest Green #3CA54F / #4CAF50 / #388E3C / #A5D6A7
 */

body, html {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: 'Open Sans', sans-serif;
}

.login-main-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;  /* necesario para el right-panel-wrapper absoluto */
}

/* ============================================================
   SECCIÓN IZQUIERDA — CARRUSEL (70%)
   ============================================================ */

.login-left-section {
    flex: 0 0 70%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Barra de progreso del carrusel ───────────────────────── */
@keyframes progressRun {
    from { width: 0%; }
    to   { width: 100%; }
}

.carousel-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(to right, rgba(129, 199, 132, 0.5), rgba(255, 255, 255, 0.35));
    z-index: 5;
    border-radius: 0 1px 1px 0;
    pointer-events: none;
    opacity: 1;
}

.carousel-progress.running {
    animation: progressRun 8s linear forwards;
}

/* ── Carrusel base ────────────────────────────────────────── */
#loginCarousel {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

#loginCarousel .carousel-inner {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* Todos los items absolutamente posicionados = mismo tamaño */
#loginCarousel .carousel-inner .item {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

#loginCarousel .carousel-inner .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform-origin: center center;
}

/* ── Ken Burns por slide ──────────────────────────────────── */
@keyframes kenBurns {
    0%   { transform: scale(1.00) translate(  0%,    0%); }
    100% { transform: scale(1.10) translate(-1.5%, -0.8%); }
}

@keyframes kenBurnsAlt {
    0%   { transform: scale(1.00) translate( 0%,   0%); }
    100% { transform: scale(1.10) translate( 1.2%, 0.6%); }
}

#loginCarousel .carousel-inner .item:nth-child(odd).active  img { animation: kenBurns    7s ease-out forwards; }
#loginCarousel .carousel-inner .item:nth-child(even).active img { animation: kenBurnsAlt 7s ease-out forwards; }

/* ── Fade transition Bootstrap 3 ─────────────────────────── */
#loginCarousel.carousel-fade .carousel-inner .item {
    opacity: 0;
    -webkit-transition: opacity 1.1s ease-in-out;
    transition:         opacity 1.1s ease-in-out;
}

#loginCarousel.carousel-fade .carousel-inner .active.item      { opacity: 1; }

#loginCarousel.carousel-fade .carousel-inner .active.left,
#loginCarousel.carousel-fade .carousel-inner .active.right     { left: 0; opacity: 0; z-index: 1; }

#loginCarousel.carousel-fade .carousel-inner .next.left,
#loginCarousel.carousel-fade .carousel-inner .prev.right       { opacity: 1; z-index: 2; }

#loginCarousel.carousel-fade .carousel-inner .next,
#loginCarousel.carousel-fade .carousel-inner .prev,
#loginCarousel.carousel-fade .carousel-inner .active.left,
#loginCarousel.carousel-fade .carousel-inner .active.right {
    left: 0;
    -webkit-transform: translate3d(0, 0, 0);
    transform:         translate3d(0, 0, 0);
}

/* ── Overlay cinematográfico (vignette oscuro) ────────────── */
.carousel-gradient-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        /* viñeta inferior oscura (para caption y dots) */
        linear-gradient(to top,
            rgba(5, 20, 8, 0.92)  0%,
            rgba(5, 20, 8, 0.55) 22%,
            rgba(5, 20, 8, 0.10) 50%,
            rgba(5, 20, 8, 0.00) 70%
        ),
        /* viñeta superior suave */
        linear-gradient(to bottom,
            rgba(5, 20, 8, 0.55)  0%,
            rgba(5, 20, 8, 0.00) 35%
        );
    z-index: 1;
}

/* Delays de animación (compartidos) */
.anim-delay-1 { animation-delay: 0.40s; }
.anim-delay-2 { animation-delay: 0.60s; }
.anim-delay-3 { animation-delay: 0.80s; }

/* ============================================================
   FLECHAS DE NAVEGACIÓN (aparecen al hover)
   ============================================================ */

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.30s ease,
                background 0.25s ease,
                transform 0.25s ease,
                border-color 0.25s ease;
    text-decoration: none;
    line-height: 1;
    user-select: none;
}

.carousel-arrow.prev { left: 22px; }
.carousel-arrow.next { right: 22px; }

/* Mostrar flechas al hacer hover sobre la sección */
.login-left-section:hover .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
}

.carousel-arrow:hover {
    background: rgba(60, 165, 79, 0.55);
    border-color: rgba(165, 214, 167, 0.55);
    transform: translateY(-50%) scale(1.10);
    color: #ffffff;
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.96);
}

/* ============================================================
   CAPTION BOX — ESQUINA INFERIOR IZQUIERDA
   ============================================================ */

/* ── Animaciones del caption ──────────────────────────────── */
@keyframes captionFadeIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes captionLabelIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Contenedor del caption ───────────────────────────────── */
.slide-caption-bar {
    position: absolute;
    bottom: 44px;
    left: 40px;
    z-index: 3;
    pointer-events: none;
    /* Línea de acento vertical izquierda */
    border-left: 3px solid;
    border-image: linear-gradient(to bottom, #A5D6A7, rgba(129,199,132,0.25)) 1;
    padding-left: 18px;
    max-width: 400px;
    /* Degradado de fondo sutil para legibilidad en imágenes claras */
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.35));
}

/* .slide-caption-box ya no tiene estilos visuales propios */
.slide-caption-box {
    display: block;
}

/* Etiqueta superior — overline style */
.slide-caption-label {
    display: block;
    color: #A5D6A7;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 4.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0;
    animation: captionLabelIn 0.50s cubic-bezier(0.22, 1, 0.36, 1) 0.10s forwards;
}

/* Título principal del slide */
.slide-caption-text {
    display: block;
    color: #ffffff;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.30;
    text-shadow:
        0 1px 3px  rgba(0, 0, 0, 0.70),
        0 4px 16px rgba(0, 0, 0, 0.40);
    opacity: 0;
    animation: captionFadeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}

.slide-caption-text.animate-in {
    opacity: 0;
    animation: captionFadeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}

/* ============================================================
   DOTS — ESTILO INVERTIDO (relleno = inactivo, hueco = activo)
   ============================================================ */

.carousel-dots {
    position: absolute;
    bottom: 44px;
    right: 40px;
    z-index: 3;
    display: flex;
    gap: 9px;
    align-items: center;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(165, 214, 167, 0.55);   /* relleno cuando inactivo */
    border: 2px solid rgba(165, 214, 167, 0.55);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.carousel-dots .dot.active {
    background: transparent;                  /* hueco cuando activo */
    border-color: #A5D6A7;
    width: 13px;
    height: 13px;
    box-shadow: 0 0 0 2.5px rgba(165, 214, 167, 0.22);
}

.carousel-dots .dot:hover:not(.active) {
    background: rgba(165, 214, 167, 0.85);
    border-color: rgba(165, 214, 167, 0.85);
    transform: scale(1.25);
}

/* ============================================================
   SECCIÓN DERECHA — WRAPPER DIAGONAL + DUAL ZONE
   ============================================================ */

/*
 * El wrapper tiene position:absolute para poder extenderse 60px
 * hacia la izquierda y aplicar el clip diagonal sin romper el flex.
 * filter:drop-shadow sigue la forma del clip-path del hijo.
 */
.right-panel-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    z-index: 3;
    filter: drop-shadow(-12px 0 35px rgba(0, 0, 0, 0.22));
}

/* Panel con borde izquierdo recto */
.login-right-section {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ── ZONA SUPERIOR: Header verde con título + stats ──────── */

.right-header {
    background: linear-gradient(160deg, #1b5e20 0%, #2e7d32 55%, #388e3c 100%);
    padding: 30px 28px 0;
    flex-shrink: 0;
    position: relative;
}

.right-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.right-badge i { color: #A5D6A7; font-size: 0.88rem; }

.right-title {
    color: #ffffff;
    font-size: 1.50rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin: 0 0 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.right-divider {
    width: 38px;
    height: 2.5px;
    background: linear-gradient(to right, #81C784, #A5D6A7);
    border-radius: 2px;
    margin: 0 0 16px;
}

/* Stats en fila horizontal */
.right-stats-row {
    display: flex;
    gap: 8px;
}

.right-stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 12px 6px 12px;
    text-align: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background 0.30s ease, transform 0.30s ease;
    cursor: default;
}

.right-stat-card:hover {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-3px);
}

.right-stat-icon {
    display: block;
    font-size: 1.3rem;
    color: rgba(165, 214, 167, 0.80);
    margin-bottom: 6px;
}

.right-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #A5D6A7;
    line-height: 1;
    margin-bottom: 5px;
    letter-spacing: -0.3px;
}

.right-stat-label {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
    line-height: 1.3;
}

/* ── Ola SVG separando header del formulario ─────────────── */
.right-header-wave {
    position: relative;
    margin: 16px -28px 0;
    height: 48px;
    overflow: hidden;
}

.right-header-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── ZONA INFERIOR: Formulario de acceso ─────────────────── */

.right-form-zone {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 22px 32px 65px;
    background: #ffffff;
    position: relative;
}

.login-box-custom {
    width: 100%;
    max-width: 340px;
}

.box-title {
    color: #333b3f;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

.logo-container {
    text-align: center;
    margin-bottom: 28px;
}

.logo-container img {
    max-width: 200px;
    height: auto;
}

/* Formulario Material */
.form-material .form-group { margin-bottom: 24px; }

.form-material .form-control {
    background-color: transparent;
    background-image:
        linear-gradient(#3CA54F, #3CA54F),
        linear-gradient(#d9d9d9, #d9d9d9);
    background-size: 0 2px, 100% 1px;
    background-repeat: no-repeat;
    background-position: center bottom, center calc(100% - 1px);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 10px 0;
    font-size: 1.18rem;
    transition: background-size 0.35s ease;
}

.form-material .form-control:focus {
    background-size: 100% 2px, 100% 1px;
    outline: none;
    box-shadow: none;
}

.form-material label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #555;
}

/* Botón Ingresar */
.btn-custom-login {
    background: linear-gradient(135deg, #3CA54F 0%, #4CAF50 100%);
    border: none;
    color: #ffffff;
    padding: 14px;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-top: 16px;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 16px rgba(60, 165, 79, 0.25);
}

.btn-custom-login:hover,
.btn-custom-login:focus {
    background: linear-gradient(135deg, #2e823d 0%, #388E3C 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(60, 165, 79, 0.40);
    color: #ffffff;
    outline: none;
}

.btn-custom-login:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(60, 165, 79, 0.30);
}

.footer-text {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #b8bec2;
    font-size: 0.78rem;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 1400px) {
    .right-panel-wrapper { width: 32%; }
    .right-title         { font-size: 1.38rem; }
    .right-stat-value    { font-size: 1.25rem; }
}

@media (max-width: 1200px) {
    .login-left-section  { flex: 0 0 58%; }
    .right-panel-wrapper { width: 42%; }
    .carousel-dots       { right: 24px; }
    .slide-caption-bar   { left: 24px; max-width: 280px; }
}

@media (max-width: 992px) {
    .login-left-section  { display: none; }
    .right-panel-wrapper {
        position: relative;
        width: 100%;
        height: 100vh;
        filter: none;
    }
    .login-right-section {
        position: relative;
        width: 100%;
        height: 100%;
    }
    .right-header        { padding: 28px 28px 0; }
    .right-stats-row     { gap: 12px; }
    .right-stat-card     { padding: 14px 10px; }
    .right-stat-value    { font-size: 1.5rem; }
    .right-form-zone     { padding: 22px 40px 65px; }
    .login-box-custom    { max-width: 440px; }
}

@media (max-width: 480px) {
    .right-header        { padding: 22px 20px 0; }
    .right-title         { font-size: 1.3rem; }
    .right-stat-value    { font-size: 1.2rem; }
    .right-header-wave   { margin: 12px -20px 0; }
    .right-form-zone     { padding: 18px 20px 60px; }
    .box-title           { font-size: 1.55rem; }
}

/* ============================================================
   FORMULARIO — FLOATING LABELS, ÍCONOS, TOGGLE, SHAKE
   ============================================================ */

/* ── Grupo de campo con espacio para la etiqueta flotante ─── */
.lf-field-group { margin-bottom: 28px !important; }

/* ── Wrapper posicionador ─────────────────────────────────── */
.lf-input-wrapper {
    position: relative;
}

/* ── Ícono izquierdo del campo ────────────────────────────── */
.lf-field-icon {
    position: absolute;
    left: 0;
    bottom: 9px;
    font-size: 1rem;
    color: #bdbdbd;
    pointer-events: none;
    transition: color 0.25s ease;
    z-index: 1;
    line-height: 1;
}

.lf-input-wrapper:focus-within .lf-field-icon {
    color: #3CA54F;
}

/* ── Input con espacio para ícono, label flotante y toggle ── */
.lf-input {
    padding-left: 26px !important;
    padding-right: 34px !important;
    padding-top: 20px !important;
    padding-bottom: 6px !important;
}

/* ── Etiqueta flotante ────────────────────────────────────── */
.lf-floating-label {
    position: absolute;
    left: 26px;
    bottom: 8px;
    font-size: 1.05rem;
    font-weight: 400;
    color: #9e9e9e;
    pointer-events: none;
    transition:
        bottom    0.22s cubic-bezier(0.4, 0, 0.2, 1),
        font-size 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        color     0.22s ease;
    white-space: nowrap;
    line-height: 1;
    margin-bottom: 0;
}

/* Flota al enfocar o cuando el campo tiene valor */
.lf-input:focus ~ .lf-floating-label,
.lf-input:not(:placeholder-shown) ~ .lf-floating-label {
    bottom: 36px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #3CA54F;
    letter-spacing: 0.2px;
}

/* Color rojo cuando hay error de validación */
.lf-input.lf-error ~ .lf-floating-label {
    color: #d32f2f;
}

/* ── Botón de toggle (mostrar/ocultar contraseña) ─────────── */
.lf-toggle-pwd {
    position: absolute;
    right: 0;
    bottom: 7px;
    background: none;
    border: none;
    padding: 3px 5px;
    cursor: pointer;
    color: #bdbdbd;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.20s ease;
    z-index: 2;
    outline: none;
}

.lf-toggle-pwd:hover,
.lf-toggle-pwd:focus {
    color: #3CA54F;
}

/* ── Indicador de Bloq. Mayús ─────────────────────────────── */
.lf-capslock-hint {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: #e65100;
    margin-top: 5px;
    padding: 3px 10px;
    background: rgba(255, 152, 0, 0.09);
    border-radius: 4px;
    border-left: 2px solid #f57c00;
}

.lf-capslock-hint.lf-caps-visible {
    display: flex;
}

/* ── Subrayado rojo en campos con error ───────────────────── */
.lf-input.lf-error {
    background-image:
        linear-gradient(#d32f2f, #d32f2f),
        linear-gradient(#d9d9d9, #d9d9d9) !important;
    background-size: 100% 2px, 100% 1px !important;
}

/* ── Animación de sacudida al fallo de login ──────────────── */
@keyframes lfShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-7px); }
    35%       { transform: translateX( 6px); }
    55%       { transform: translateX(-5px); }
    75%       { transform: translateX( 4px); }
    90%       { transform: translateX(-2px); }
}

.lf-shake {
    animation: lfShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ── Estado de carga del botón ────────────────────────────── */
.btn-custom-login.lf-loading {
    opacity: 0.82;
    pointer-events: none;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(60, 165, 79, 0.25) !important;
}

.btn-label-loading {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

/* Spinner CSS puro (sin dependencia de íconos) */
.lf-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: lfBtnSpin 0.55s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}

@keyframes lfBtnSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   FILA DE OPCIONES — Recordarme + Olvidaste tu contraseña
   ============================================================ */

.lf-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -10px;
    margin-bottom: 20px;
}

.lf-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.93rem;
    color: #666;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
    user-select: none;
}

.lf-remember-check {
    accent-color: #3CA54F;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.lf-forgot-link {
    font-size: 0.93rem;
    color: #3CA54F;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.20s ease;
}

.lf-forgot-link:hover,
.lf-forgot-link:focus {
    color: #2e823d;
    text-decoration: underline;
    outline: none;
}
