/* ==========================================================================
   ACCESO AL PANEL (js/acceso.js): la página de inicio de sesión (index.html), la ventana de inicio de sesión de las
   páginas del panel (#lgpop.acc-pop) y el aviso del modo superadmin. No depende de Bootstrap ni de sb-admin.
   ========================================================================== */

.acc,
.acc-pop,
.acc-sa {
    --acc-azul: #4682B4;
    --acc-azul-osc: #3b6f9a;
    --acc-azul-2: #4e73df;
    --acc-tinta: #1f2430;
    --acc-tinta-2: #5a6070;
    --acc-suave: #8a8f9c;
    --acc-borde: rgba(15, 23, 42, .12);
    --acc-fondo: #f8f9fc;
    --acc-error: #c0392b;
    --acc-ok: #0f7a3d;
    font-family: "Nunito", "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --------------------------------------------------------------------------
   Formulario (el mismo en la página y en la ventana)
   -------------------------------------------------------------------------- */
.acc-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--acc-tinta);
}

.acc-form[hidden] {
    display: none;
}

.acc-tit {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--acc-tinta);
}

.acc-sub {
    margin: -6px 0 2px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--acc-tinta-2);
}

.acc-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.acc-campo label {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--acc-tinta);
}

.acc-caja {
    position: relative;
    display: flex;
    align-items: center;
}

.acc-caja input {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--acc-borde);
    border-radius: 12px;
    background: #fff;
    color: var(--acc-tinta);
    font: inherit;
    font-size: 16px; /* 16 px: iOS no amplía la página al escribir */
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.acc-caja input::placeholder {
    color: #a3a8b4;
}

.acc-caja input:focus {
    outline: none;
    border-color: var(--acc-azul);
    box-shadow: 0 0 0 3px rgba(70, 130, 180, .2);
}

.acc-caja input[aria-invalid="true"] {
    border-color: var(--acc-error);
}

.acc-caja.con-ojo input {
    padding-right: 50px;
}

.acc-ojo {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--acc-tinta-2);
    cursor: pointer;
}

.acc-ojo:hover {
    background: rgba(15, 23, 42, .05);
    color: var(--acc-tinta);
}

.acc-ojo svg {
    width: 21px;
    height: 21px;
}

.acc-fila {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: -4px;
}

.acc-enlace {
    padding: 0;
    border: 0;
    background: none;
    color: var(--acc-azul);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.acc-enlace:hover {
    color: var(--acc-azul-osc);
    text-decoration: underline;
}

.acc-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--acc-azul);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.acc-btn:hover {
    background: var(--acc-azul-osc);
}

.acc-btn:active {
    transform: translateY(1px);
}

.acc-btn[disabled] {
    opacity: .7;
    cursor: default;
}

.acc-btn .acc-giro {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: acc-gira .8s linear infinite;
}

.acc-btn.cargando .acc-giro {
    display: inline-block;
}

.acc-btn-sec {
    background: #fff;
    color: var(--acc-tinta);
    border: 1px solid var(--acc-borde);
}

.acc-btn-sec:hover {
    background: var(--acc-fondo);
}

.acc-estado {
    min-height: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--acc-tinta-2);
}

.acc-estado:empty {
    display: none;
}

.acc-estado.error {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdecea;
    color: var(--acc-error);
    font-weight: 700;
}

.acc-estado.ok {
    padding: 10px 12px;
    border-radius: 10px;
    background: #e6f6ec;
    color: var(--acc-ok);
    font-weight: 700;
}

.acc-pie {
    margin: 4px 0 0;
    text-align: center;
    font-size: 14.5px;
    color: var(--acc-tinta-2);
}

.acc-pie a {
    color: var(--acc-azul);
    font-weight: 800;
}

.acc-volver {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.acc-volver svg {
    width: 18px;
    height: 18px;
}

.acc-oculto {
    display: none !important;
}

.acc-entrando {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 0;
    text-align: center;
    color: var(--acc-tinta-2);
    font-weight: 700;
}

.acc-entrando .acc-giro {
    display: inline-block;
    width: 34px;
    height: 34px;
    border: 3.5px solid rgba(70, 130, 180, .25);
    border-top-color: var(--acc-azul);
    border-radius: 50%;
    animation: acc-gira .8s linear infinite;
}

.acc-btn:focus-visible,
.acc-enlace:focus-visible,
.acc-ojo:focus-visible,
.acc-sa a:focus-visible,
.acc-sa button:focus-visible {
    outline: 2px solid var(--acc-azul-2);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Página de inicio de sesión (index.html)
   -------------------------------------------------------------------------- */
html.acc-html,
body.acc {
    height: 100%;
}

body.acc {
    margin: 0;
    background: var(--acc-fondo);
    color: var(--acc-tinta);
    -webkit-font-smoothing: antialiased;
}

.acc-pagina {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100%;
}

/* Lado de la marca con la animación */
.acc-marca {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 40px 48px;
    overflow: hidden;
    background: linear-gradient(150deg, #4e73df 0%, #3d5fc4 45%, #224abe 100%);
    color: #fff;
}

.acc-marca::before,
.acc-marca::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.acc-marca::before {
    width: 520px;
    height: 520px;
    right: -180px;
    top: -160px;
    background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 65%);
}

.acc-marca::after {
    width: 420px;
    height: 420px;
    left: -160px;
    bottom: -170px;
    background: radial-gradient(circle, rgba(124, 196, 255, .28) 0%, rgba(124, 196, 255, 0) 65%);
}

.acc-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: 150px;
    height: auto;
}

.acc-marca-txt {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.acc-marca-txt h2 {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -.015em;
}

.acc-marca-txt p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .86);
}

/* Lado del formulario */
.acc-lado {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 24px;
}

.acc-tarjeta {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.acc-logo-osc {
    display: none;
    width: 128px;
    height: auto;
    margin: 0 0 24px;
    filter: brightness(0) saturate(100%) invert(12%) sepia(10%) saturate(1000%) hue-rotate(190deg);
}

.acc-legal {
    max-width: 400px;
    margin: 28px auto 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--acc-suave);
}

.acc-legal a {
    color: inherit;
}

/* --------------------------------------------------------------------------
   Animación del lado de la marca: un panel en miniatura (solo transform y opacity, sin JavaScript)
   -------------------------------------------------------------------------- */
.acc-ilus {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.acc-ven {
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 30px 60px rgba(10, 25, 80, .35);
    overflow: hidden;
    color: var(--acc-tinta);
    animation: acc-sube .7s cubic-bezier(.2, .8, .2, 1) both;
}

.acc-ven-barra {
    display: flex;
    gap: 6px;
    padding: 11px 14px;
    background: #eef1f8;
}

.acc-ven-barra i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff6159;
}

.acc-ven-barra i:nth-child(2) { background: #ffbd2e; }
.acc-ven-barra i:nth-child(3) { background: #28c940; }

.acc-ven-cuerpo {
    padding: 16px;
}

.acc-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.acc-kpi {
    padding: 9px 10px;
    border-radius: 11px;
    background: #f4f6fb;
}

.acc-kpi small {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--acc-suave);
}

.acc-kpi b {
    display: block;
    margin-top: 2px;
    font-size: 17px;
    font-weight: 900;
    color: var(--acc-tinta);
}

.acc-graf {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    height: 120px;
    margin-top: 14px;
    padding-top: 6px;
    border-bottom: 1px solid #e3e6ee;
}

.acc-graf span {
    flex: 1 1 0;
    height: var(--h);
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #6f93ec 0%, #4e73df 100%);
    transform-origin: bottom;
    animation: acc-crece 1s cubic-bezier(.2, .8, .2, 1) both, acc-respira 6s ease-in-out 1.2s infinite;
}

.acc-graf span:nth-child(2) { animation-delay: .08s, 1.5s; }
.acc-graf span:nth-child(3) { animation-delay: .16s, 1.8s; }
.acc-graf span:nth-child(4) { animation-delay: .24s, 2.1s; }
.acc-graf span:nth-child(5) { animation-delay: .32s, 2.4s; }
.acc-graf span:nth-child(6) { animation-delay: .40s, 2.7s; }
.acc-graf span:nth-child(7) { animation-delay: .48s, 3s; background: linear-gradient(180deg, #48c78e 0%, #1baf7a 100%); }

/* Avisos de venta que aparecen sobre el panel */
.acc-aviso {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(10, 25, 80, .3);
    color: var(--acc-tinta);
    font-size: 13px;
    line-height: 1.25;
    opacity: 0;
    animation: acc-aviso 9s ease-in-out infinite;
}

.acc-aviso b {
    display: block;
    font-size: 13.5px;
}

.acc-aviso small {
    color: var(--acc-suave);
    font-weight: 700;
}

.acc-aviso-i {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e3f6ec;
    color: #0c8a5e;
}

.acc-aviso-i svg {
    width: 18px;
    height: 18px;
}

.acc-aviso.a1 {
    right: -26px;
    top: 47%;
    animation-delay: 1.4s;
}

.acc-aviso.a2 {
    left: -22px;
    bottom: -18px;
    animation-delay: 5.9s;
}

.acc-aviso.a2 .acc-aviso-i {
    background: #eef2fd;
    color: #4e73df;
}

@keyframes acc-gira { to { transform: rotate(360deg); } }
@keyframes acc-sube { from { opacity: 0; transform: translateY(18px); } }
@keyframes acc-crece { from { transform: scaleY(0); } }
@keyframes acc-respira { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.86); } }
@keyframes acc-aviso {
    0% { opacity: 0; transform: translateY(10px) scale(.96); }
    6%, 38% { opacity: 1; transform: none; }
    46%, 100% { opacity: 0; transform: translateY(-6px) scale(.98); }
}

/* Ordenador: el texto de la marca arriba, debajo del logo, lejos del botón flotante de WhatsApp (abajo a la
   izquierda); el panel en miniatura en el centro */
@media (min-width: 901px) {
    .acc-marca {
        justify-content: flex-start;
        padding-bottom: 110px;
    }

    .acc-marca-txt {
        order: 1;
    }

    .acc-ilus {
        order: 2;
        margin-top: auto;
        margin-bottom: auto;
    }
}

/* Móvil y tablet: todo el fondo azul, la marca arriba (sin el panel en miniatura) y el formulario en una tarjeta clara
   con las esquinas redondeadas. Abajo queda sitio para los botones flotantes (WhatsApp e idioma) */
@media (max-width: 900px) {
    body.acc {
        background: #2a4fc4;
    }

    .acc-pagina {
        position: relative;
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        align-content: start;
        min-height: 100%;
        overflow: hidden;
        background: linear-gradient(165deg, #4e73df 0%, #3d5fc4 40%, #224abe 100%);
    }

    .acc-marca {
        gap: 12px;
        padding: 26px 22px 24px;
        background: none;
        overflow: visible;
    }

    .acc-marca::before {
        right: -220px;
        top: -260px;
    }

    .acc-marca::after {
        display: none;
    }

    .acc-ilus {
        display: none;
    }

    .acc-logo {
        width: 118px;
    }

    .acc-marca-txt h2 {
        font-size: 1.45rem;
    }

    .acc-marca-txt p {
        font-size: 14.5px;
    }

    .acc-lado {
        justify-content: flex-start;
        padding: 0 12px 104px;
    }

    .acc-tarjeta {
        max-width: 480px;
        padding: 26px 20px 22px;
        border-radius: 24px;
        background: var(--acc-fondo);
        box-shadow: 0 24px 60px rgba(10, 25, 80, .35);
        box-sizing: border-box;
    }

    .acc-tit {
        font-size: 1.4rem;
    }

    .acc-legal {
        margin-top: 20px;
        color: rgba(255, 255, 255, .8);
    }

    .acc-legal a {
        color: #fff;
    }
}

/* --------------------------------------------------------------------------
   Ventana de inicio de sesión en las páginas del panel (las páginas la abren con style.display = "block")
   -------------------------------------------------------------------------- */
.lgpop.acc-pop {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    z-index: 100001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(15, 23, 42, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.acc-pop-centro {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.acc-pop-caja {
    width: 100%;
    max-width: 420px;
    padding: 28px 26px 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    box-sizing: border-box;
    animation: acc-sube .3s cubic-bezier(.2, .8, .2, 1) both;
}

.acc-pop-caja .acc-logo-osc {
    display: block;
    width: 112px;
    margin-bottom: 18px;
}

.acc-pop-caja .acc-tit {
    font-size: 1.35rem;
}

/* Con la ventana abierta no se ve lo de debajo ni las burbujas flotantes (idioma, WhatsApp) */
body.acc-pop-abierta {
    overflow: hidden;
}

body.acc-pop-abierta #gt_float_wrapper,
body.acc-pop-abierta .gtranslate_wrapper,
body.acc-pop-abierta .gt_float_switcher,
body.acc-pop-abierta #wa-evt-container {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Modo superadmin: aviso fijo arriba en las páginas del panel
   -------------------------------------------------------------------------- */
.acc-sa {
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: #1f2430;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.35;
}

.acc-sa-i {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fab219;
    color: #1f2430;
}

.acc-sa-i svg {
    width: 15px;
    height: 15px;
}

.acc-sa-txt {
    flex: 1 1 220px;
    min-width: 0;
}

.acc-sa-txt b {
    color: #ffd166;
}

.acc-sa a,
.acc-sa button {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.acc-sa a:hover,
.acc-sa button:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    text-decoration: none;
}

@media (max-width: 575px) {
    .acc-pop-caja {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .acc-sa {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acc *,
    .acc-pop *,
    .acc-sa * {
        animation: none !important;
        transition: none !important;
    }

    .acc-aviso.a1 {
        opacity: 1;
    }

    .acc-btn .acc-giro,
    .acc-entrando .acc-giro {
        animation: acc-gira 1.6s linear infinite !important;
    }
}
