/* Pantallas de entrada con el aspecto nuevo del portal (solo con el módulo «Aspecto nuevo» activo): inicio de sesión y segundo paso. */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(/assets/fonts/dm-sans-latin.woff2) format('woff2');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(/assets/fonts/dm-sans-latin-ext.woff2) format('woff2');
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
        U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
    --ink: #00185e;
    --mut: #5c6b8f;
    --ln: #dce4ef;
    --soft: #eef3fa;
    --frame: #f2f6fa;
    --btn: #0050d7;
    --bad: #b3261e;
}
* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    min-height: 100%;
}
body {
    background: var(--frame);
    color: var(--ink);
    font-family:
        'DM Sans',
        system-ui,
        -apple-system,
        'Segoe UI',
        sans-serif;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.ln-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}
.ln-card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--ln);
    border-radius: 16px;
    padding: 28px 28px 24px;
    display: grid;
    gap: 14px;
}
.ln-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    text-decoration: none;
}
.ln-brand b {
    width: 34px;
    height: 30px;
    border-radius: 8px;
    background: var(--btn);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 11px;
    letter-spacing: -0.03em;
}
.ln-card h1 {
    margin: 4px 0 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.ln-card p {
    margin: 0;
    color: var(--mut);
}
.ln-card form {
    display: grid;
    gap: 12px;
}
.ln-card label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mut);
    margin-bottom: 4px;
}
.ln-card input[type='text'],
.ln-card input[type='password'] {
    width: 100%;
    background: var(--soft);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    min-height: 44px;
}
.ln-card input:focus {
    outline: 0;
    border-color: var(--btn);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 80, 215, 0.14);
}
.ln-card button[type='submit'] {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--btn);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ln-card button[type='submit']:hover {
    background: #0a3fa8;
}
.ln-card button[type='submit']:disabled {
    opacity: 0.6;
    cursor: default;
}
.ln-card .error {
    margin: 0;
    padding: 0;
    color: var(--bad);
    font-weight: 600;
    min-height: 0;
}
.ln-card .error:empty {
    display: none;
}
.ln-card .error:not(:empty) {
    padding: 10px 12px;
    background: #fde0e0;
    border-radius: 8px;
}
.ln-links {
    display: grid;
    gap: 6px;
    font-size: 13.5px;
}
.ln-links a,
.ln-card a {
    color: var(--btn);
    text-decoration: none;
}
.ln-links a:hover,
.ln-card a:hover {
    text-decoration: underline;
}
.ln-foot {
    text-align: center;
    padding: 14px 16px 20px;
    color: var(--mut);
    font-size: 12.5px;
}
/* Casillas del código de verificación (otp.js): pequeñas y del color del portal. */
.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 2px;
}
.ln-card .otp-boxes .otp-digit {
    flex: none;
    width: 40px;
    height: 48px;
    min-height: 0;
    padding: 0;
    text-align: center;
    font:
        600 20px/1 'DM Sans',
        system-ui,
        sans-serif;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--ln);
    border-radius: 8px;
}
.ln-card .otp-boxes .otp-digit:nth-child(3) {
    margin-right: 8px;
}
.ln-card .otp-boxes .otp-digit:focus {
    border-color: var(--btn);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 80, 215, 0.14);
}
.ln-card .otp-boxes .otp-digit.filled {
    background: #fff;
    border-color: var(--btn);
}
.otp-boxes.otp-error .otp-digit {
    border-color: var(--bad);
    animation: otp-shake 0.35s;
}
@keyframes otp-shake {
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}
.otp-switch {
    margin: 10px 0 0;
    text-align: center;
}
.otp-switch button {
    background: none;
    border: 0;
    padding: 6px 4px;
    color: var(--btn);
    font: inherit;
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
@media (max-width: 420px) {
    .ln-card {
        padding: 22px 18px 20px;
    }
    .otp-boxes {
        gap: 5px;
    }
    .ln-card .otp-boxes .otp-digit {
        width: 36px;
        height: 44px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .otp-boxes.otp-error .otp-digit {
        animation: none;
    }
}
/* Modo oscuro (la elección se guarda en este navegador al activarlo desde el panel). */
html[data-theme='dark'] {
    --ink: #e8eefb;
    --mut: #94a5c8;
    --ln: #27344f;
    --soft: #182440;
    --frame: #0b1220;
    --btn: #3b82f6;
    --bad: #ff8f8f;
    color-scheme: dark;
}
html[data-theme='dark'] .ln-card {
    background: #121c31;
}
html[data-theme='dark'] .ln-card input[type='text'],
html[data-theme='dark'] .ln-card input[type='password'] {
    background: #182440;
    color: #e8eefb;
}
html[data-theme='dark'] .ln-card input:focus,
html[data-theme='dark'] .ln-card .otp-boxes .otp-digit:focus,
html[data-theme='dark'] .ln-card .otp-boxes .otp-digit.filled {
    background: #121c31;
}
html[data-theme='dark'] .ln-card .error:not(:empty) {
    background: #40202a;
}
.ln-card p {
    text-align: justify;
    hyphens: auto;
}
.ln-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}
.ln-head h1 {
    margin: 0;
    flex: 1;
    text-align: center;
}

/* Fondo de las pantallas de entrada: la foto de la web, nítida, con la capa oscura de la página de mantenimiento. */
body {
    position: relative;
    background: #1b2420;
}
body::before {
    content: '';
    position: fixed;
    inset: -4%;
    z-index: -2;
    background: url(/assets/login-fondo-1280.webp) center / cover no-repeat;
    filter: saturate(1.08);
    transform: scale(1.04);
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(27, 36, 32, 0.12), rgba(27, 36, 32, 0.72) 82%),
        linear-gradient(180deg, rgba(27, 36, 32, 0.28), rgba(27, 36, 32, 0.5));
}
@media (min-width: 1281px) {
    body::before {
        background-image: url(/assets/login-fondo-1600.webp);
    }
}
.ln-main,
.ln-foot {
    position: relative;
}
.ln-card {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-color: rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .ln-card {
    background: rgba(18, 28, 49, 0.9);
    border-color: rgba(255, 255, 255, 0.14);
}
.ln-foot {
    color: rgba(247, 243, 236, 0.88);
}
