/* ============================================================
   GEOPLOT — VENTANA DE ACCESO AL DASHBOARD IROE-1
   Archivo:
   /assets/css/iroe_dashboard.css

   Este bloque corresponde al archivo JavaScript:
   /assets/js/iroe-dashboard-access.js
============================================================ */


/* ============================================================
   1. VARIABLES DE DISEÑO
============================================================ */

:root {
    --iroe-access-navy-950: #020b14;
    --iroe-access-navy-900: #061321;
    --iroe-access-navy-850: #091a2a;
    --iroe-access-navy-800: #0c2032;
    --iroe-access-navy-700: #12324a;

    --iroe-access-blue-600: #087fae;
    --iroe-access-blue-500: #0f9dcc;
    --iroe-access-cyan-500: #22c5f6;
    --iroe-access-cyan-400: #38d2ff;
    --iroe-access-cyan-300: #75e4ff;

    --iroe-access-white: #ffffff;
    --iroe-access-gray-50: #f7fafc;
    --iroe-access-gray-100: #edf3f7;
    --iroe-access-gray-200: #d8e3ea;
    --iroe-access-gray-300: #bdccd6;
    --iroe-access-gray-500: #647b8d;
    --iroe-access-gray-600: #475e70;
    --iroe-access-gray-700: #2d4354;

    --iroe-access-success: #16804a;
    --iroe-access-success-bg: #ecfdf3;
    --iroe-access-success-border: #b8eccf;

    --iroe-access-error: #a52833;
    --iroe-access-error-bg: #fff1f2;
    --iroe-access-error-border: #fecdd3;

    --iroe-access-info: #075e82;
    --iroe-access-info-bg: #edf9fe;
    --iroe-access-info-border: #b7e7f7;

    --iroe-access-radius-small: 9px;
    --iroe-access-radius-medium: 13px;
    --iroe-access-radius-large: 20px;

    --iroe-access-shadow:
        0 28px 85px rgba(0, 0, 0, 0.48);

    --iroe-access-transition:
        160ms ease;
}


/* ============================================================
   2. BLOQUEO DEL DASHBOARD
============================================================ */

/*
 * Mientras JavaScript comprueba la sesión, el documento queda
 * visualmente protegido para evitar que aparezca el dashboard
 * durante una fracción de segundo.
 */

html.iroe-access-checking,
html.iroe-access-locked,
body.iroe-access-locked {
    overflow: hidden !important;
}

/*
 * El atributo inert impide interacción por teclado y puntero.
 * Estas reglas agregan una protección visual complementaria.
 */

html.iroe-access-checking #layout,
html.iroe-access-locked #layout,
body.iroe-access-locked #layout {
    pointer-events: none !important;
    user-select: none !important;
}

/*
 * Suaviza el dashboard detrás de la ventana sin ocultarlo
 * totalmente, manteniendo el contexto cartográfico.
 */

body.iroe-access-locked #layout {
    filter: blur(3px);
    transform: scale(1.004);
}


/* ============================================================
   3. FONDO OSCURO DE LA VENTANA
============================================================ */

.iroe-access-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;

    display: grid;
    place-items: center;

    width: 100%;
    min-height: 100%;
    padding: 24px;

    box-sizing: border-box;

    overflow-x: hidden;
    overflow-y: auto;

    background:
        radial-gradient(
            circle at 76% 18%,
            rgba(34, 197, 246, 0.16),
            transparent 32%
        ),
        radial-gradient(
            circle at 12% 86%,
            rgba(8, 127, 174, 0.15),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            rgba(2, 11, 20, 0.93),
            rgba(5, 19, 33, 0.96)
        );

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    opacity: 1;

    animation:
        iroeAccessOverlayIn 240ms ease both;
}

.iroe-access-overlay[hidden] {
    display: none !important;
}


/* ============================================================
   4. TARJETA PRINCIPAL
============================================================ */

.iroe-access-modal {
    position: relative;

    width: min(100%, 520px);
    max-height: calc(100vh - 48px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    color: var(--iroe-access-gray-700);
    background: var(--iroe-access-white);

    border:
        1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--iroe-access-radius-large);

    box-shadow: var(--iroe-access-shadow);

    animation:
        iroeAccessModalIn 280ms cubic-bezier(
            0.22,
            1,
            0.36,
            1
        ) both;
}

.iroe-access-modal::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background:
        linear-gradient(
            90deg,
            var(--iroe-access-blue-600),
            var(--iroe-access-cyan-500),
            var(--iroe-access-cyan-300)
        );

    z-index: 2;
}

.iroe-access-modal.is-attention {
    animation:
        iroeAccessAttention 420ms ease;
}


/* ============================================================
   5. CABECERA Y LOGO
============================================================ */

.iroe-access-modal__header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    min-height: 92px;
    padding: 18px 24px;

    box-sizing: border-box;

    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(34, 197, 246, 0.13),
            transparent 42%
        ),
        linear-gradient(
            135deg,
            var(--iroe-access-navy-950),
            var(--iroe-access-navy-850)
        );

    border-bottom:
        1px solid rgba(255, 255, 255, 0.1);
}

.iroe-access-brand {
    display: flex;
    align-items: center;

    min-width: 0;
}

.iroe-access-brand__logo {
    display: block;

    width: auto;
    max-width: 285px;
    height: 58px;

    object-fit: contain;
    object-position: left center;

    filter:
        drop-shadow(
            0 5px 14px rgba(0, 0, 0, 0.22)
        );
}

.iroe-access-security-badge {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 7px 10px;

    color: #dff8ff;
    background: rgba(34, 197, 246, 0.1);

    border:
        1px solid rgba(34, 197, 246, 0.35);
    border-radius: 999px;

    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

.iroe-access-security-badge::before {
    content: "";

    display: block;

    width: 7px;
    height: 7px;

    background: var(--iroe-access-cyan-400);

    border-radius: 50%;

    box-shadow:
        0 0 0 4px rgba(34, 197, 246, 0.1);
}


/* ============================================================
   6. CUERPO DE LA VENTANA
============================================================ */

.iroe-access-modal__body {
    flex: 1 1 auto;

    padding: 28px 30px 25px;

    overflow-x: hidden;
    overflow-y: auto;

    box-sizing: border-box;

    scrollbar-width: thin;
    scrollbar-color:
        var(--iroe-access-gray-300)
        transparent;
}

.iroe-access-modal__body::-webkit-scrollbar {
    width: 8px;
}

.iroe-access-modal__body::-webkit-scrollbar-track {
    background: transparent;
}

.iroe-access-modal__body::-webkit-scrollbar-thumb {
    background: var(--iroe-access-gray-300);

    border: 2px solid var(--iroe-access-white);
    border-radius: 999px;
}

.iroe-access-introduction {
    margin-bottom: 22px;
}

.iroe-access-eyebrow {
    margin: 0 0 8px;

    color: var(--iroe-access-blue-600);

    font-size: 0.69rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.iroe-access-introduction h1 {
    margin: 0;

    color: var(--iroe-access-navy-900);

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.iroe-access-introduction p:last-child {
    margin: 12px 0 0;

    color: var(--iroe-access-gray-500);

    font-size: 0.91rem;
    line-height: 1.55;
}


/* ============================================================
   7. PESTAÑAS: INICIAR SESIÓN / CREAR CUENTA
============================================================ */

.iroe-access-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    margin-bottom: 22px;
    padding: 4px;

    background: var(--iroe-access-gray-100);

    border: 1px solid var(--iroe-access-gray-200);
    border-radius: 11px;
}

.iroe-access-tab {
    min-height: 40px;
    padding: 8px 12px;

    color: var(--iroe-access-gray-500);
    background: transparent;

    border: 0;
    border-radius: 8px;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;

    cursor: pointer;

    transition:
        color var(--iroe-access-transition),
        background-color var(--iroe-access-transition),
        box-shadow var(--iroe-access-transition);
}

.iroe-access-tab:hover {
    color: var(--iroe-access-navy-900);
    background: rgba(255, 255, 255, 0.68);
}

.iroe-access-tab.is-active {
    color: var(--iroe-access-navy-900);
    background: var(--iroe-access-white);

    box-shadow:
        0 3px 10px rgba(7, 23, 37, 0.1);
}

.iroe-access-tab:focus-visible {
    outline:
        3px solid rgba(34, 197, 246, 0.28);
    outline-offset: 2px;
}


/* ============================================================
   8. FORMULARIOS
============================================================ */

.iroe-access-form-container {
    min-height: 210px;
}

.iroe-access-form {
    display: grid;
    gap: 16px;
}

.iroe-access-field {
    display: grid;
    gap: 7px;
}

.iroe-access-field label {
    color: var(--iroe-access-gray-700);

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.35;
}

.iroe-access-field input {
    width: 100%;
    min-width: 0;
    min-height: 46px;

    padding: 0 13px;

    box-sizing: border-box;

    color: var(--iroe-access-navy-900);
    background: var(--iroe-access-white);

    border:
        1px solid var(--iroe-access-gray-300);
    border-radius: var(--iroe-access-radius-small);

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.88rem;
    line-height: 1;

    outline: none;

    box-shadow:
        inset 0 1px 2px rgba(7, 23, 37, 0.025);

    transition:
        border-color var(--iroe-access-transition),
        box-shadow var(--iroe-access-transition),
        background-color var(--iroe-access-transition);
}

.iroe-access-field input::placeholder {
    color: #8ca0af;
    opacity: 1;
}

.iroe-access-field input:hover {
    border-color: #9db1be;
}

.iroe-access-field input:focus {
    background: #ffffff;

    border-color: var(--iroe-access-blue-500);

    box-shadow:
        0 0 0 4px rgba(15, 157, 204, 0.13);
}

.iroe-access-field input:disabled {
    cursor: wait;
    opacity: 0.72;
}


/* ============================================================
   9. CAMPO DE CONTRASEÑA
============================================================ */

.iroe-access-password {
    position: relative;
}

.iroe-access-password input {
    padding-right: 82px;
}

.iroe-access-password__toggle {
    position: absolute;
    top: 50%;
    right: 8px;

    min-width: 62px;
    min-height: 31px;

    padding: 5px 8px;

    transform: translateY(-50%);

    color: var(--iroe-access-blue-600);
    background: transparent;

    border: 0;
    border-radius: 7px;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;

    cursor: pointer;

    transition:
        color var(--iroe-access-transition),
        background-color var(--iroe-access-transition);
}

.iroe-access-password__toggle:hover {
    color: var(--iroe-access-navy-900);
    background: var(--iroe-access-gray-100);
}

.iroe-access-password__toggle:focus-visible {
    outline:
        3px solid rgba(34, 197, 246, 0.25);
    outline-offset: 1px;
}


/* ============================================================
   10. RECORDAR SESIÓN Y RECUPERAR CONTRASEÑA
============================================================ */

.iroe-access-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    margin-top: -2px;
}

.iroe-access-remember,
.iroe-access-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    color: var(--iroe-access-gray-500);

    font-size: 0.75rem;
    line-height: 1.4;

    cursor: pointer;
}

.iroe-access-remember {
    align-items: center;
}

.iroe-access-remember input,
.iroe-access-consent input {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;
    margin: 1px 0 0;

    accent-color: var(--iroe-access-blue-600);

    cursor: pointer;
}

.iroe-access-link-button,
.iroe-access-back-button {
    display: inline-flex;
    align-items: center;

    padding: 0;

    color: var(--iroe-access-blue-600);
    background: transparent;

    border: 0;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35;

    cursor: pointer;
}

.iroe-access-link-button {
    text-align: right;
}

.iroe-access-link-button:hover,
.iroe-access-back-button:hover {
    color: var(--iroe-access-navy-900);
    text-decoration: underline;
}

.iroe-access-link-button:focus-visible,
.iroe-access-back-button:focus-visible {
    outline:
        3px solid rgba(34, 197, 246, 0.24);
    outline-offset: 4px;

    border-radius: 3px;
}


/* ============================================================
   11. BOTÓN PRINCIPAL
============================================================ */

.iroe-access-primary-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    min-height: 48px;
    padding: 11px 18px;

    box-sizing: border-box;

    color: var(--iroe-access-white);
    background:
        linear-gradient(
            135deg,
            var(--iroe-access-blue-600),
            var(--iroe-access-blue-500)
        );

    border: 1px solid rgba(6, 92, 127, 0.5);
    border-radius: 10px;

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.2;

    cursor: pointer;

    box-shadow:
        0 8px 18px rgba(8, 127, 174, 0.22);

    transition:
        transform var(--iroe-access-transition),
        box-shadow var(--iroe-access-transition),
        filter var(--iroe-access-transition);
}

.iroe-access-primary-button:hover {
    filter: brightness(1.055);

    box-shadow:
        0 11px 23px rgba(8, 127, 174, 0.29);

    transform: translateY(-1px);
}

.iroe-access-primary-button:active {
    transform: translateY(0);
}

.iroe-access-primary-button:focus-visible {
    outline:
        4px solid rgba(34, 197, 246, 0.24);
    outline-offset: 3px;
}

.iroe-access-primary-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}


/* ============================================================
   12. INDICADOR DE CARGA
============================================================ */

.iroe-access-button-loader {
    display: none;

    width: 15px;
    height: 15px;

    border:
        2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;

    animation:
        iroeAccessSpinner 700ms linear infinite;
}

.iroe-access-form.is-loading
.iroe-access-button-loader {
    display: inline-block;
}

.iroe-access-form.is-loading
.iroe-access-primary-button {
    cursor: wait;
}


/* ============================================================
   13. MENSAJES DE ESTADO
============================================================ */

.iroe-access-status {
    display: none;

    margin-top: 16px;
    padding: 11px 13px;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: 0.77rem;
    line-height: 1.45;
}

.iroe-access-status.is-visible {
    display: block;

    animation:
        iroeAccessStatusIn 180ms ease both;
}

.iroe-access-status.is-error {
    color: var(--iroe-access-error);
    background: var(--iroe-access-error-bg);
    border-color: var(--iroe-access-error-border);
}

.iroe-access-status.is-success {
    color: var(--iroe-access-success);
    background: var(--iroe-access-success-bg);
    border-color: var(--iroe-access-success-border);
}

.iroe-access-status.is-info {
    color: var(--iroe-access-info);
    background: var(--iroe-access-info-bg);
    border-color: var(--iroe-access-info-border);
}


/* ============================================================
   14. TEXTO DE RECUPERACIÓN
============================================================ */

.iroe-access-recovery-heading {
    padding: 15px 16px;

    background: var(--iroe-access-gray-50);

    border: 1px solid var(--iroe-access-gray-200);
    border-radius: 10px;
}

.iroe-access-recovery-heading h2 {
    margin: 0;

    color: var(--iroe-access-navy-900);

    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

.iroe-access-recovery-heading p {
    margin: 7px 0 0;

    color: var(--iroe-access-gray-500);

    font-size: 0.79rem;
    line-height: 1.5;
}

.iroe-access-form-note {
    margin: -2px 0 0;

    color: var(--iroe-access-gray-500);

    font-size: 0.72rem;
    line-height: 1.45;
    text-align: center;
}


/* ============================================================
   15. CONTACTO INSTITUCIONAL
============================================================ */

.iroe-access-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;

    margin-top: 21px;
    padding-top: 17px;

    color: var(--iroe-access-gray-500);

    border-top:
        1px solid var(--iroe-access-gray-200);

    font-size: 0.74rem;
    line-height: 1.4;
    text-align: center;
}

.iroe-access-support a {
    color: var(--iroe-access-blue-600);

    font-weight: 750;
    text-decoration: none;
}

.iroe-access-support a:hover {
    color: var(--iroe-access-navy-900);
    text-decoration: underline;
}

.iroe-access-support a:focus-visible {
    outline:
        3px solid rgba(34, 197, 246, 0.24);
    outline-offset: 3px;

    border-radius: 3px;
}


/* ============================================================
   16. PIE DE LA VENTANA
============================================================ */

.iroe-access-modal__footer {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 13px 24px;

    color: #8fa5b5;
    background: var(--iroe-access-navy-900);

    border-top:
        1px solid rgba(255, 255, 255, 0.07);

    font-size: 0.61rem;
    line-height: 1.4;
    letter-spacing: 0.015em;
}

.iroe-access-modal__footer span:last-child {
    text-align: right;
}


/* ============================================================
   17. ANIMACIONES
============================================================ */

@keyframes iroeAccessOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes iroeAccessModalIn {
    from {
        opacity: 0;
        transform:
            translateY(18px)
            scale(0.975);
    }

    to {
        opacity: 1;
        transform:
            translateY(0)
            scale(1);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes iroeAccessAttention {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }
}


/* ============================================================
   18. TABLET
============================================================ */

@media (max-width: 700px) {
    .iroe-access-overlay {
        padding: 16px;
    }

    .iroe-access-modal {
        max-height: calc(100vh - 32px);
    }

    .iroe-access-modal__header {
        min-height: 82px;
        padding: 16px 19px;
    }

    .iroe-access-brand__logo {
        max-width: 235px;
        height: 51px;
    }

    .iroe-access-security-badge {
        padding: 6px 8px;

        font-size: 0.6rem;
    }

    .iroe-access-modal__body {
        padding: 24px 22px 22px;
    }

    .iroe-access-modal__footer {
        padding-inline: 19px;
    }
}


/* ============================================================
   19. MÓVILES
============================================================ */

@media (max-width: 520px) {
    .iroe-access-overlay {
        align-items: end;

        padding: 9px;
    }

    .iroe-access-modal {
        width: 100%;
        max-height: calc(100dvh - 18px);

        border-radius: 17px 17px 11px 11px;
    }

    .iroe-access-modal__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;

        min-height: auto;
        padding: 16px 18px 15px;
    }

    .iroe-access-brand__logo {
        max-width: min(100%, 255px);
        height: 52px;
    }

    .iroe-access-security-badge {
        align-self: flex-start;
    }

    .iroe-access-modal__body {
        padding: 21px 18px 20px;
    }

    .iroe-access-introduction {
        margin-bottom: 18px;
    }

    .iroe-access-introduction h1 {
        font-size: 1.42rem;
    }

    .iroe-access-introduction p:last-child {
        font-size: 0.84rem;
    }

    .iroe-access-tabs {
        margin-bottom: 18px;
    }

    .iroe-access-form {
        gap: 14px;
    }

    .iroe-access-form__options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .iroe-access-link-button {
        text-align: left;
    }

    .iroe-access-modal__footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;

        padding: 11px 18px;
    }

    .iroe-access-modal__footer span:last-child {
        text-align: left;
    }
}


/* ============================================================
   20. PANTALLAS MUY PEQUEÑAS
============================================================ */

@media (max-width: 360px) {
    .iroe-access-overlay {
        padding: 5px;
    }

    .iroe-access-modal {
        max-height: calc(100dvh - 10px);
    }

    .iroe-access-modal__header,
    .iroe-access-modal__body,
    .iroe-access-modal__footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .iroe-access-brand__logo {
        max-width: 220px;
    }

    .iroe-access-tab {
        padding-inline: 7px;

        font-size: 0.75rem;
    }
}


/* ============================================================
   21. ALTURA REDUCIDA
============================================================ */

@media (max-height: 720px) and (min-width: 521px) {
    .iroe-access-overlay {
        align-items: start;

        padding-top: 14px;
        padding-bottom: 14px;
    }

    .iroe-access-modal {
        max-height: calc(100vh - 28px);
    }

    .iroe-access-modal__header {
        min-height: 76px;
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .iroe-access-brand__logo {
        height: 48px;
    }

    .iroe-access-modal__body {
        padding-top: 21px;
        padding-bottom: 20px;
    }

    .iroe-access-introduction {
        margin-bottom: 17px;
    }

    .iroe-access-tabs {
        margin-bottom: 17px;
    }
}


/* ============================================================
   22. ACCESIBILIDAD: MOVIMIENTO REDUCIDO
============================================================ */

@media (prefers-reduced-motion: reduce) {
    .iroe-access-overlay,
    .iroe-access-modal,
    .iroe-access-status,
    .iroe-access-primary-button,
    .iroe-access-tab,
    .iroe-access-button-loader {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 1ms !important;
    }
}


/* ============================================================
   23. CONTRASTE FORZADO
============================================================ */

@media (forced-colors: active) {
    .iroe-access-modal,
    .iroe-access-tabs,
    .iroe-access-field input,
    .iroe-access-status,
    .iroe-access-recovery-heading {
        border: 1px solid CanvasText;
    }

    .iroe-access-primary-button,
    .iroe-access-tab.is-active {
        forced-color-adjust: none;
    }
}