@font-face {
    font-family: "Nexa Black";
    src: url("../fonts/Nexa-Black.woff2") format("woff2");
    font-style: normal;
    font-weight: 900;
    font-display: swap;
}

@font-face {
    font-family: "Bicyclette";
    src: url("../fonts/Bicyclette-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Bicyclette";
    src: url("../fonts/Bicyclette-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

:root {
    --turquoise: #00c9c2;
    --turquoise-dark: #008b86;
    --turquoise-deep: #075a58;
    --orange: #ff4800;
    --orange-dark: #da3e00;
    --yellow: #ffb600;
    --ink: #102e33;
    --ink-deep: #071d21;
    --muted: #68797d;
    --line: #dfe6e6;
    --surface: #ffffff;
    --surface-soft: #f5f8f8;
    --danger: #b42318;
    --success: #067647;
    --font-display: "Nexa Black", "Arial Black", Arial, sans-serif;
    --font-body: "Montserrat", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shadow-modal: 0 34px 84px rgba(3, 21, 24, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* PORTADA: conserva la composición original */
.access-page {
    background: var(--ink-deep);
}

.landing {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 24px;
    isolation: isolate;
    overflow: hidden;
    background-color: var(--ink-deep);
    background-image: url("../img/back.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.landing-overlay {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(110deg, rgba(4, 26, 30, 0.87), rgba(6, 42, 46, 0.57) 50%, rgba(3, 23, 27, 0.86)),
        radial-gradient(circle at 50% 42%, rgba(0, 201, 194, 0.14), transparent 37%);
}

.landing-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, transparent, black 24%, black 76%, transparent);
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: brand-enter 760ms cubic-bezier(.16, 1, .3, 1) both;
}

.brand-logo {
    display: block;
    width: clamp(155px, 18vw, 230px);
    max-height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.28));
}

.brand-copy {
    margin-top: 18px;
    color: #fff;
    text-transform: uppercase;
}

.brand-copy span {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.7vw, 2rem);
    line-height: 1;
    letter-spacing: 0.13em;
}

.brand-copy small {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-body);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.32em;
}

.login-trigger,
.submit-button,
.logout-button {
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

.login-trigger {
    min-width: 210px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 31px;
    padding: 10px 23px;
    color: var(--ink-deep);
    background: #fff;
    box-shadow: 0 17px 38px rgba(0, 0, 0, 0.22);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.login-trigger svg {
    width: 18px;
    height: 18px;
    transition: transform 180ms ease;
}

.login-trigger:hover {
    color: #fff;
    background: var(--orange);
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.login-trigger:hover svg {
    transform: translateX(3px);
}

.login-trigger:active,
.submit-button:active,
.logout-button:active {
    transform: translateY(0);
}

.login-trigger:focus-visible,
.submit-button:focus-visible,
.logout-button:focus-visible,
.modal-close:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid rgba(0, 201, 194, 0.58);
    outline-offset: 3px;
}

.landing-footnote {
    position: absolute;
    right: 32px;
    bottom: 24px;
    margin: 0;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* LOGIN COMPACTO */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 240ms ease, visibility 240ms ease;
}

.modal.is-open {
    visibility: visible;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 17, 20, 0.73);
    backdrop-filter: blur(9px) saturate(0.86);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 780px);
    min-height: 478px;
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow-modal);
    transform: translateY(18px) scale(0.988);
    opacity: 0;
    transition:
        transform 330ms cubic-bezier(.16, 1, .3, 1),
        opacity 240ms ease;
}

.modal-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    height: 3px;
    background: linear-gradient(90deg, var(--turquoise) 0 56%, var(--orange) 56% 84%, var(--yellow) 84%);
}

.modal.is-open .modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #d8e2e2;
    border-radius: 3px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.modal-close svg {
    width: 17px;
    height: 17px;
}

.modal-close:hover {
    color: var(--orange);
    border-color: rgba(255, 72, 0, 0.35);
    background: #fff;
    transform: rotate(4deg);
}

.modal-identity {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 42px 32px 30px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(4, 66, 68, 0.95), rgba(5, 31, 35, 0.99)),
        url("../img/back.png") center / cover no-repeat;
}

.modal-identity::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(to bottom, var(--turquoise) 0 62%, var(--orange) 62% 84%, var(--yellow) 84%);
}

.modal-identity::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 12%, rgba(0, 201, 194, 0.28), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 44%);
    pointer-events: none;
}

.modal-identity > * {
    position: relative;
    z-index: 1;
}

.modal-identity img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 12px 26px rgba(0, 0, 0, 0.18));
}

.identity-shine {
    position: absolute;
    top: -96px;
    right: -132px;
    z-index: 0;
    width: 270px;
    height: 270px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    transform: rotate(28deg);
}

.identity-shine::before,
.identity-shine::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.identity-shine::before {
    inset: 30px;
}

.identity-shine::after {
    inset: 60px;
}

.identity-content {
    margin-top: auto;
    padding-top: 60px;
}

.identity-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--turquoise);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.identity-eyebrow::before {
    content: "";
    width: 23px;
    height: 1px;
    background: currentColor;
}

.identity-content h2 {
    margin: 15px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.62rem, 2.6vw, 2.05rem);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.identity-content p {
    margin: 15px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.83rem;
    line-height: 1.58;
}

.identity-mark {
    align-self: flex-end;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.13);
    font-family: var(--font-display);
    font-size: 2.7rem;
    line-height: 1;
    letter-spacing: 0.05em;
}

.modal-form-side {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 46px 36px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 182, 0, 0.09), transparent 27%),
        radial-gradient(circle at 0 100%, rgba(0, 201, 194, 0.07), transparent 31%),
        #fff;
}

.modal-form-side::after {
    content: "";
    position: absolute;
    top: 0;
    right: 64px;
    width: 48px;
    height: 3px;
    background: var(--orange);
}

.modal-heading {
    margin-bottom: 23px;
    padding-right: 38px;
}

.modal-kicker,
.welcome-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: var(--turquoise-dark);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.21em;
    text-transform: uppercase;
}

.modal-kicker::before {
    content: "";
    width: 5px;
    height: 5px;
    background: var(--orange);
}

.modal-heading h2,
.welcome-card h1 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.4vw, 2.55rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.modal-heading p,
.welcome-card p {
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 0.91rem;
    line-height: 1.52;
}

.login-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
    cursor: text;
}

.field > span:first-child {
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.015em;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #ccd8d8;
    border-radius: 4px;
    background: #fff;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.input-shell > svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-left: 14px;
    color: #819295;
    transition: color 180ms ease;
}

.input-shell:focus-within {
    border-color: var(--turquoise-dark);
    box-shadow: 0 0 0 2px rgba(0, 201, 194, 0.12);
    background: #ffffff;
}

.input-shell:focus-within > svg {
    color: var(--orange);
}

.field input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 13px 10px 11px;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    outline: none;
}

.field input::placeholder {
    color: #9aa8aa;
}

.field input:focus,
.field input:focus-visible {
    outline: none;
}

/* Evita el fondo celeste/amarillo que algunos navegadores aplican al autocompletar. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    caret-color: var(--ink);
    transition: background-color 9999s ease-out 0s;
}

.field input:-moz-autofill {
    color: var(--ink);
    box-shadow: 0 0 0 1000px #ffffff inset;
}

.password-toggle {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-right: 3px;
    border: 0;
    border-radius: 2px;
    color: #718386;
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--orange);
    background: #f2f7f7;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle .eye-closed {
    display: none;
}

.password-toggle.is-visible .eye-open {
    display: none;
}

.password-toggle.is-visible .eye-closed {
    display: block;
}

.form-message {
    min-height: 1.25em;
    margin: -1px 0 -1px;
    color: var(--danger);
    font-size: 0.79rem;
    line-height: 1.4;
}

.form-message.is-success {
    color: var(--success);
}

.submit-button {
    position: relative;
    min-height: 47px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    overflow: hidden;
    padding: 11px 20px;
    color: #fff;
    background: var(--turquoise-dark);
    box-shadow: 0 13px 26px rgba(0, 139, 134, 0.2);
    font-size: 0.91rem;
    letter-spacing: 0.01em;
}


.submit-button:hover {
    transform: translateY(-2px);
    background: var(--turquoise-deep);
    box-shadow: 0 16px 31px rgba(7, 90, 88, 0.25);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.78;
}

.button-arrow {
    width: 17px;
    height: 17px;
    color: #ffffff;
    transition: transform 180ms ease;
}

.submit-button:hover .button-arrow {
    transform: translateX(3px);
}

.button-loader {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.submit-button.is-loading .button-loader {
    display: inline-block;
}

.submit-button.is-loading .button-arrow {
    display: none;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    color: #879598;
    font-size: 0.7rem;
}

.security-note svg {
    width: 15px;
    height: 15px;
    color: var(--turquoise-dark);
}

body.modal-open {
    overflow: hidden;
}

/* DASHBOARD BÁSICO */
.dashboard-page {
    background:
        linear-gradient(rgba(246, 249, 249, 0.95), rgba(246, 249, 249, 0.95)),
        url("../img/back.png") center / cover fixed no-repeat;
}

.dashboard-shell {
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #d8e1e1;
}

.dashboard-logo {
    width: 86px;
    height: auto;
}

.logout-button {
    padding: 10px 17px;
    color: var(--orange-dark);
    border: 1px solid rgba(255, 72, 0, 0.22);
    background: rgba(255, 255, 255, 0.76);
}

.logout-button:hover {
    transform: translateY(-1px);
    color: #fff;
    border-color: var(--orange);
    background: var(--orange);
}

.welcome-card {
    max-width: 720px;
    margin: 82px auto 0;
    padding: clamp(30px, 6vw, 56px);
    border-top: 4px solid var(--turquoise);
    border-right: 1px solid rgba(22, 52, 58, 0.08);
    border-bottom: 1px solid rgba(22, 52, 58, 0.08);
    border-left: 1px solid rgba(22, 52, 58, 0.08);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 64px rgba(22, 52, 58, 0.11);
    animation: brand-enter 600ms ease both;
}

@keyframes brand-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 760px) {
    .modal-panel {
        width: min(100%, 470px);
        min-height: auto;
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .modal-identity {
        min-height: 132px;
        display: block;
        padding: 30px 30px 24px;
    }

    .modal-identity img {
        width: 62px;
        height: 62px;
    }

    .identity-content,
    .identity-mark,
    .identity-shine {
        display: none;
    }

    .modal-form-side {
        padding: 37px 34px 31px;
    }
}

@media (max-width: 560px) {
    .landing {
        padding: 32px 18px;
        background-position: center;
    }

    .brand-logo {
        width: clamp(135px, 40vw, 190px);
    }

    .brand-copy span {
        font-size: 1.35rem;
    }

    .login-trigger {
        min-width: 196px;
        min-height: 44px;
        margin-top: 28px;
    }

    .landing-footnote {
        right: auto;
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        width: 100%;
        text-align: center;
    }

    .modal {
        align-items: end;
        padding: 0;
    }

    .modal-panel {
        width: 100%;
        max-height: 94vh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 5px 5px 0 0;
        transform: translateY(34px);
    }

    .modal-close {
        top: 14px;
        right: 14px;
    }

    .modal-identity {
        min-height: 105px;
        padding: 24px 22px 18px;
    }

    .modal-identity img {
        width: 52px;
        height: 52px;
    }

    .modal-form-side {
        padding: 30px 22px 24px;
    }

    .modal-heading {
        margin-bottom: 21px;
    }

    .modal-heading h2 {
        font-size: 2rem;
    }

    .dashboard-header {
        align-items: flex-start;
    }

    .welcome-card {
        margin-top: 50px;
    }
}

@media (max-height: 620px) and (min-width: 761px) {
    .modal-panel {
        min-height: 440px;
    }

    .modal-identity {
        padding-top: 34px;
        padding-bottom: 24px;
    }

    .identity-content {
        padding-top: 34px;
    }

    .modal-form-side {
        padding-top: 36px;
        padding-bottom: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
