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

@font-face {
    font-family: "Manrope Portal";
    src: url("/fonts/manrope/manrope-medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Manrope Portal";
    src: url("/fonts/manrope/manrope-semibold.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

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

:root {
    --portal-ink: #17283e;
    --portal-navy: #12304a;
    --portal-blue: #2168a8;
    --portal-cyan: #3aa8d8;
    --portal-sky: #dff2fa;
    --portal-canvas: #f3f7fa;
    --portal-surface: #ffffff;
    --portal-muted: #687b8c;
    --portal-line: #d8e4ec;
    --portal-danger: #a64049;
    --portal-danger-bg: #fbeff0;
    --portal-radius: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--portal-canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--portal-ink);
    background: var(--portal-canvas);
    font-family: "Manrope Portal", Inter, "Segoe UI", sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-logo {
    display: block;
    width: 142px;
    height: auto;
}

.portal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.1rem;
    color: var(--portal-blue);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.portal-kicker::before {
    width: 1.8rem;
    height: 2px;
    background: var(--portal-cyan);
    content: "";
}

/* Acceso */
.portal-login-page {
    background: var(--portal-surface);
}

.portal-login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.22fr) minmax(390px, 0.78fr);
}

.portal-login-scene {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.5rem);
    background:
        radial-gradient(circle at 76% 18%, rgba(58, 168, 216, 0.17), transparent 31%),
        linear-gradient(145deg, #edf7fb 0%, #f7fafc 58%, #e9f2f7 100%);
}

.portal-login-scene::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 34%;
    background: var(--portal-cyan);
    content: "";
}

.portal-scene-header,
.portal-scene-copy,
.portal-scene-footer {
    position: relative;
    z-index: 2;
}

.portal-scene-copy {
    width: min(650px, 90%);
    padding-block: 4rem;
}

.portal-scene-copy h1 {
    max-width: 650px;
    margin: 0;
    color: var(--portal-navy);
    font-size: clamp(3rem, 6vw, 6.4rem);
    font-weight: 500;
    letter-spacing: -0.065em;
    line-height: 0.95;
}

.portal-scene-copy > p:last-child {
    max-width: 520px;
    margin: 1.8rem 0 0;
    color: #526a7c;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.65;
}

.portal-scene-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #718494;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.portal-scene-footer span:last-child {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.portal-scene-footer span:last-child::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--portal-cyan);
    box-shadow: 0 0 0 5px rgba(58, 168, 216, 0.12);
    content: "";
}

.portal-blueprint {
    position: absolute;
    right: -9%;
    bottom: -8%;
    width: min(54vw, 760px);
    color: var(--portal-blue);
    opacity: 0.12;
    transform: rotate(-5deg);
}

.portal-auth-panel {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 5rem);
    background: var(--portal-surface);
}

.portal-auth-mobile-brand {
    display: none;
}

.portal-auth-inner {
    width: min(100%, 430px);
}

.portal-auth-inner h2 {
    margin: 0;
    color: var(--portal-navy);
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.portal-auth-intro {
    margin: 1rem 0 2.3rem;
    color: var(--portal-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.portal-error,
.portal-empty {
    margin: 0 0 1.3rem;
    padding: 0.85rem 1rem;
    border: 1px solid #edcdd1;
    border-radius: 10px;
    background: var(--portal-danger-bg);
    color: var(--portal-danger);
    font-size: 0.86rem;
    line-height: 1.45;
}

.portal-form-field {
    margin-bottom: 1.25rem;
}

.portal-form-field label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--portal-navy);
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-input-wrap {
    position: relative;
}

.portal-input-wrap input {
    width: 100%;
    height: 54px;
    padding: 0 1rem;
    border: 1px solid #cbd9e3;
    border-radius: 10px;
    outline: 0;
    background: #f9fbfc;
    color: var(--portal-ink);
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.portal-input-wrap input::placeholder {
    color: #9aa9b4;
}

.portal-input-wrap input:focus {
    border-color: var(--portal-cyan);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(58, 168, 216, 0.13);
}

.portal-input-wrap.has-action input {
    padding-right: 5.2rem;
}

.portal-input-action {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    padding: 0.38rem 0.45rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--portal-blue);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transform: translateY(-50%);
}

.portal-input-action:hover {
    background: #eaf4fa;
}

.portal-submit {
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.85rem;
    padding: 0.75rem 0.85rem 0.75rem 1.15rem;
    border: 0;
    border-radius: 10px;
    background: var(--portal-blue);
    box-shadow: 0 10px 22px rgba(33, 104, 168, 0.2);
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-submit::after,
.portal-card-action::after {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    content: "→";
    font-size: 1.05rem;
}

.portal-submit:hover {
    background: #195a91;
    box-shadow: 0 14px 28px rgba(33, 104, 168, 0.26);
    transform: translateY(-1px);
}

.portal-auth-note {
    margin: 1.5rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--portal-line);
    color: #83929d;
    font-size: 0.73rem;
    line-height: 1.55;
}

/* Selector de área */
.portal-home-page {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(58, 168, 216, 0.06), transparent 310px),
        var(--portal-canvas);
}

.portal-topbar {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    padding: 1rem clamp(1.25rem, 4vw, 4rem);
    border-bottom: 1px solid var(--portal-line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.portal-topbar-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-topbar-brand::after {
    width: 1px;
    height: 28px;
    background: var(--portal-line);
    content: "";
}

.portal-topbar-project {
    color: var(--portal-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #637787;
    font-size: 0.78rem;
    font-weight: 700;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.portal-logout img {
    width: 17px;
    height: 17px;
    opacity: 0.7;
}

.portal-logout:hover {
    border-color: var(--portal-line);
    background: #fff;
    color: var(--portal-navy);
}

.portal-home-main {
    width: min(1380px, calc(100% - clamp(2rem, 8vw, 8rem)));
    margin: 0 auto;
    padding: clamp(3rem, 7vh, 6rem) 0 4rem;
}

.portal-welcome {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.5fr);
    align-items: end;
    gap: 3rem;
    margin-bottom: clamp(2.4rem, 5vw, 4.2rem);
}

.portal-welcome h1 {
    max-width: 800px;
    margin: 0;
    color: var(--portal-navy);
    font-size: clamp(2.8rem, 6vw, 5.9rem);
    font-weight: 500;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.portal-welcome h1 span {
    display: block;
    color: var(--portal-blue);
}

.portal-welcome-copy {
    padding-left: 1.35rem;
    border-left: 2px solid var(--portal-cyan);
}

.portal-welcome-copy strong {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--portal-navy);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-welcome-copy p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.portal-access-board {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 1.15rem;
}

.portal-access-card {
    position: relative;
    display: flex;
    min-height: 330px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius);
    background: var(--portal-surface);
    box-shadow: 0 16px 40px rgba(23, 40, 62, 0.055);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.portal-access-card:hover {
    border-color: #b9d5e5;
    box-shadow: 0 22px 54px rgba(23, 40, 62, 0.1);
    transform: translateY(-4px);
}

.portal-access-card.primary {
    min-height: 390px;
    border: 0;
    background: var(--portal-blue);
    color: #fff;
}

.portal-access-card.primary::before {
    position: absolute;
    right: -8rem;
    bottom: -9rem;
    width: 26rem;
    height: 26rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    box-shadow:
        0 0 0 4rem rgba(255, 255, 255, 0.035),
        0 0 0 8rem rgba(255, 255, 255, 0.025);
    content: "";
}

.portal-card-index {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--portal-blue);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-access-card.primary .portal-card-index {
    color: #cfeaf6;
}

.portal-card-index::after {
    width: 2.5rem;
    height: 1px;
    background: currentColor;
    content: "";
    opacity: 0.55;
}

.portal-card-copy {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin-block: 2.5rem;
}

.portal-card-copy h2 {
    margin: 0 0 1rem;
    color: var(--portal-navy);
    font-size: clamp(2rem, 4vw, 3.8rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 1;
}

.portal-access-card.primary h2 {
    color: #fff;
}

.portal-card-copy p {
    max-width: 470px;
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.portal-access-card.primary .portal-card-copy p {
    color: #cbe3ee;
}

.portal-card-action {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.15rem;
    border-top: 1px solid var(--portal-line);
    color: var(--portal-blue);
    font-size: 0.83rem;
    font-weight: 700;
}

.portal-access-card.primary .portal-card-action {
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.portal-access-card:not(.primary) .portal-card-action::after {
    background: var(--portal-sky);
}

.portal-home-empty {
    max-width: 680px;
    padding: 2rem;
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius);
    background: #fff;
}

.portal-home-empty h2 {
    margin: 0 0 0.65rem;
    color: var(--portal-navy);
    font-size: 1.35rem;
}

.portal-home-empty p {
    margin: 0 0 1.5rem;
    color: var(--portal-muted);
    line-height: 1.6;
}

.portal-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--portal-blue);
    font-size: 0.84rem;
    font-weight: 700;
}

.portal-text-link::after {
    content: "→";
}

.portal-page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--portal-line);
    color: #80919d;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

:focus-visible {
    outline: 3px solid rgba(58, 168, 216, 0.38);
    outline-offset: 3px;
}

@media screen and (max-width: 960px) {
    .portal-login-shell {
        grid-template-columns: 1fr;
    }

    .portal-login-scene {
        min-height: 42vh;
        padding: 2rem clamp(1.25rem, 7vw, 4rem);
    }

    .portal-scene-copy {
        padding: 4rem 0 2rem;
    }

    .portal-scene-copy h1 {
        max-width: 560px;
        font-size: clamp(2.8rem, 10vw, 5.2rem);
    }

    .portal-scene-copy > p:last-child,
    .portal-scene-footer,
    .portal-blueprint {
        display: none;
    }

    .portal-auth-panel {
        min-height: 58vh;
        padding: 3.5rem clamp(1.25rem, 7vw, 4rem) 4.5rem;
    }

    .portal-auth-inner {
        width: min(100%, 560px);
    }

    .portal-welcome,
    .portal-access-board {
        grid-template-columns: 1fr;
    }

    .portal-welcome {
        align-items: start;
        gap: 1.8rem;
    }

    .portal-access-card,
    .portal-access-card.primary {
        min-height: 310px;
    }
}

@media screen and (max-width: 600px) {
    .portal-login-scene {
        min-height: auto;
        padding: 1.5rem 1.25rem 2.5rem;
    }

    .portal-scene-copy {
        padding: 3.5rem 0 0;
    }

    .portal-scene-copy h1 {
        font-size: clamp(2.55rem, 14vw, 4rem);
    }

    .portal-auth-panel {
        min-height: auto;
        align-items: flex-start;
        padding: 3rem 1.25rem 4rem;
    }

    .portal-auth-inner h2 {
        font-size: 2.1rem;
    }

    .portal-topbar {
        min-height: 68px;
        padding: 0.85rem 1rem;
    }

    .portal-topbar .portal-logo {
        width: 112px;
    }

    .portal-topbar-brand::after,
    .portal-topbar-project,
    .portal-logout span {
        display: none;
    }

    .portal-home-main {
        width: calc(100% - 2rem);
        padding-top: 2.8rem;
    }

    .portal-welcome {
        margin-bottom: 2.4rem;
    }

    .portal-welcome h1 {
        font-size: clamp(2.5rem, 13vw, 4rem);
    }

    .portal-access-card,
    .portal-access-card.primary {
        min-height: 285px;
        padding: 1.35rem;
        border-radius: 14px;
    }

    .portal-card-copy {
        margin-block: 2rem;
    }

    .portal-card-copy h2 {
        font-size: 2rem;
    }

    .portal-page-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }
}

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