* {
    box-sizing: border-box;
}

body.login-body {
    --bg: #07090d;
    --bg2: #101217;
    --panel: rgba(18, 20, 27, 0.84);
    --panel-strong: rgba(24, 27, 35, 0.94);
    --white: #f5f7fb;
    --white-soft: rgba(245, 247, 251, 0.76);
    --white-dim: rgba(245, 247, 251, 0.34);
    --red: #ff2e4d;
    --red-soft: #ff6b7f;
    --red-dark: #8b0f22;
    --muted: #a9afbd;
    --line: rgba(255, 46, 77, 0.26);
    --shadow: 0 26px 90px rgba(0, 0, 0, 0.62);
    min-height: 100vh;
    margin: 0;
    /* Vertical SÍ, horizontal no. El `overflow: hidden` de antes existía para
       ocultar la sangría lateral de los degradados decorativos, pero también
       impedía desplazarse hacia abajo: con el alta de MFA la tarjeta pasó a ser
       más alta que la pantalla y la clave manual —«¿No puedes escanearlo?»—
       quedaba fuera, sin forma de llegar a ella ni con la rueda del ratón.
       Quien no puede escanear el QR se queda sin poder darse de alta, que es
       justo el bloqueo que este flujo venía a evitar.
       Los decorados no se ven afectados: van en `position: fixed`. */
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--white);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.11), transparent 26%),
        radial-gradient(circle at 80% 74%, rgba(255, 46, 77, 0.16), transparent 30%),
        linear-gradient(135deg, #07090d 0%, #151820 52%, #050609 100%);
}

.login-bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.045) 49%, transparent 51% 100%),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 46, 77, 0.045) 1px, transparent 1px);
    background-size: 220px 220px, 58px 58px, 58px 58px;
    animation: gridSlide 22s linear infinite;
}

.command-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.command-bg::before {
    content: "";
    position: absolute;
    inset: -20%;
    background:
        conic-gradient(from 90deg at 50% 50%, transparent 0deg, rgba(255, 46, 77, 0.11) 42deg, transparent 86deg, transparent 360deg);
    animation: slowRotate 26s linear infinite;
    opacity: 0.66;
}

.command-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.024) 0px,
        rgba(255, 255, 255, 0.024) 1px,
        transparent 2px,
        transparent 7px
    );
    opacity: 0.34;
    animation: scanLines 7s linear infinite;
}

.hex-field {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72vw, 920px);
    aspect-ratio: 1.35;
    transform: translate(-50%, -50%);
    opacity: 0.62;
    filter: drop-shadow(0 0 28px rgba(255, 46, 77, 0.20));
}

.hex-svg {
    width: 100%;
    height: 100%;
}

.hex-main {
    transform-origin: 50% 50%;
    animation: hexBreath 4.6s ease-in-out infinite;
}

.hex-ring {
    transform-origin: 50% 50%;
    animation: hexPulse 3.8s ease-out infinite;
}

.hex-ring.delay {
    animation-delay: 1.9s;
}

.route-path {
    stroke-dasharray: 12 18;
    animation: dashMove 2.4s linear infinite;
}

.alert-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

.alert-dot:nth-of-type(2n) {
    animation-delay: .55s;
}

.alert-dot:nth-of-type(3n) {
    animation-delay: 1.1s;
}

.alert-beam {
    position: absolute;
    height: 2px;
    width: 38vw;
    background: linear-gradient(90deg, transparent, rgba(255, 46, 77, .88), rgba(255, 255, 255, .76), transparent);
    box-shadow: 0 0 18px rgba(255, 46, 77, .36);
    opacity: 0;
    animation: beamCross 6.5s ease-in-out infinite;
}

.alert-beam.b1 {
    left: 3vw;
    top: 21vh;
    transform: rotate(-8deg);
}

.alert-beam.b2 {
    right: 4vw;
    bottom: 22vh;
    transform: rotate(9deg);
    animation-delay: 2.4s;
}

.alert-beam.b3 {
    left: 31vw;
    top: 72vh;
    transform: rotate(2deg);
    animation-delay: 4.1s;
}

.side-module {
    position: absolute;
    width: 250px;
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-left: 3px solid rgba(255, 46, 77, .82);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025)),
        rgba(11, 13, 18, .66);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(14px);
    font-family: "JetBrains Mono", monospace;
    opacity: 0;
    transform: translateY(10px);
    animation: moduleReveal 10s ease-in-out infinite;
}

.side-module::before,
.side-module::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: rgba(255, 46, 77, .72);
    border-style: solid;
}

.side-module::before {
    left: -1px;
    top: -1px;
    border-width: 1px 0 0 1px;
}

.side-module::after {
    right: -1px;
    bottom: -1px;
    border-width: 0 1px 1px 0;
}

.side-module.s1 {
    left: 5vw;
    top: 11vh;
    animation-delay: .3s;
}

.side-module.s2 {
    left: 6vw;
    bottom: 10vh;
    animation-delay: 3.2s;
}

.side-module.s3 {
    right: 5vw;
    top: 13vh;
    animation-delay: 1.8s;
}

.side-module.s4 {
    right: 6vw;
    bottom: 12vh;
    animation-delay: 5.2s;
}

.module-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--white);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.module-title span:last-child {
    color: var(--red-soft);
}

.module-value {
    color: var(--white);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.04em;
}

.module-copy {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.red-bars {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    align-items: end;
    height: 32px;
    margin-top: 12px;
}

.red-bars span {
    height: var(--h);
    background: linear-gradient(to top, rgba(255, 46, 77, .2), rgba(255, 46, 77, .95), rgba(255, 255, 255, .72));
    animation: redBar 1.35s ease-in-out infinite alternate;
}

.red-bars span:nth-child(2n) {
    animation-delay: .18s;
}

.red-bars span:nth-child(3n) {
    animation-delay: .36s;
}

.ticker {
    position: fixed;
    z-index: 4;
    left: 0;
    right: 0;
    top: 0;
    height: 32px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(5, 6, 9, .42);
    backdrop-filter: blur(10px);
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    height: 32px;
    gap: 36px;
    padding-left: 100%;
    color: rgba(245, 247, 251, .68);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: .13em;
    white-space: nowrap;
    animation: tickerMove 28s linear infinite;
}

.ticker-track b {
    color: var(--red-soft);
    font-weight: 700;
}

.login-container {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    display: grid;
    /* `safe` centra mientras quepa y deja de centrar cuando no cabe. Sin él, una
       tarjeta más alta que la pantalla —el alta de MFA lo es— se desborda por
       arriba y por abajo a partes iguales, y la mitad superior queda por encima
       del origen del scroll: inalcanzable aunque la página sí pueda desplazarse. */
    place-items: safe center;
    padding: 42px 24px 24px;
}

.login-card {
    position: relative;
    width: min(100%, 450px);
    padding: 36px 34px 34px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .18);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .035)),
        rgba(11, 13, 18, .82);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(24px);
    border-radius: 6px 34px 6px 34px;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255, 46, 77, .72), transparent 34%) top left / 100% 2px no-repeat,
        linear-gradient(180deg, rgba(255, 46, 77, .72), transparent 38%) top left / 2px 100% no-repeat,
        linear-gradient(270deg, rgba(255, 255, 255, .34), transparent 36%) bottom right / 100% 1px no-repeat,
        linear-gradient(0deg, rgba(255, 255, 255, .34), transparent 36%) bottom right / 1px 100% no-repeat;
}

.login-card::after {
    content: "ACCESO SEGURO · PLATAFORMA CORPORATIVA";
    position: absolute;
    top: 14px;
    right: 16px;
    color: rgba(255, 46, 77, .72);
    font: 700 9px/1 "JetBrains Mono", monospace;
    letter-spacing: .15em;
}

.login-logo {
    text-align: center;
    margin-bottom: 26px;
}

.login-logo-badge {
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    color: var(--white);
    font-size: 34px;
    border: 1px solid rgba(255, 255, 255, .22);
    background:
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .28), transparent 36%),
        linear-gradient(135deg, rgba(255, 46, 77, .72), rgba(80, 8, 20, .78));
    box-shadow: 0 0 44px rgba(255, 46, 77, .22);
    clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}

.login-logo h1 {
    margin: 0;
    color: var(--white);
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.login-logo p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.form-label {
    color: rgba(245, 247, 251, .82);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.form-control {
    height: 48px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .17);
    background: rgba(5, 6, 9, .66);
    border-radius: 4px 16px 4px 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.form-control:focus {
    color: var(--white);
    background: rgba(8, 9, 13, .86);
    border-color: rgba(255, 46, 77, .86);
    box-shadow: 0 0 0 4px rgba(255, 46, 77, .13), 0 0 30px rgba(255, 46, 77, .16);
}

.btn-login {
    width: 100%;
    height: 50px;
    margin-top: 18px;
    border: 0;
    color: #fff;
    background:
        linear-gradient(135deg, #ff2e4d, #b20d27 56%, #fff 170%);
    border-radius: 4px 18px 4px 18px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
    box-shadow: 0 18px 42px rgba(255, 46, 77, .24);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 52px rgba(255, 46, 77, .34);
    filter: brightness(1.08);
}

.btn-login:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.btn-outline-info {
    color: var(--white);
    border-color: rgba(255, 46, 77, .55);
    background: rgba(255, 46, 77, .06);
    border-radius: 4px 16px 4px 16px;
}

.btn-outline-info:hover {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.login-error {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(255, 46, 77, .13);
    border: 1px solid rgba(255, 46, 77, .38);
    border-radius: 4px 14px 4px 14px;
    font-size: 13px;
}

.login-error-visible {
    display: block;
}

.magic-link-session-notice {
    display: block;
    text-align: left;
    margin: 0 0 18px;
    border-left-width: 4px;
    position: relative;
    z-index: 1;
}

.change-account-notice {
    background: rgba(255, 193, 7, .10);
    border-color: rgba(255, 193, 7, .48);
}

.magic-link-session-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.magic-link-session-actions .btn {
    flex: 1 1 170px;
    min-height: 40px;
}

.text-muted {
    color: rgba(169, 175, 189, .82) !important;
}

.classification {
    position: fixed;
    z-index: 4;
    left: 22px;
    bottom: 18px;
    color: rgba(245, 247, 251, .52);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: .18em;
}

.classification b {
    color: var(--red-soft);
}

@keyframes gridSlide {
    from {
        background-position: 0 0, 0 0, 0 0;
    }

    to {
        background-position: 220px 220px, 58px 58px, 58px 58px;
    }
}

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

@keyframes scanLines {
    to {
        transform: translateY(56px);
    }
}

@keyframes hexBreath {
    0%,
    100% {
        transform: scale(.985);
        opacity: .82;
    }

    50% {
        transform: scale(1.025);
        opacity: 1;
    }
}

@keyframes hexPulse {
    0% {
        transform: scale(.8);
        opacity: 0;
    }

    24% {
        opacity: .78;
    }

    100% {
        transform: scale(1.22);
        opacity: 0;
    }
}

@keyframes dashMove {
    to {
        stroke-dashoffset: -60;
    }
}

@keyframes dotPulse {
    0%,
    100% {
        opacity: .34;
        r: 4;
    }

    45% {
        opacity: 1;
        r: 7;
    }
}

@keyframes beamCross {
    0%,
    18% {
        opacity: 0;
        transform: translateX(-18px) rotate(var(--r, 0deg));
    }

    35%,
    58% {
        opacity: .84;
    }

    80%,
    100% {
        opacity: 0;
        transform: translateX(18px) rotate(var(--r, 0deg));
    }
}

@keyframes moduleReveal {
    0%,
    10% {
        opacity: 0;
        transform: translateY(12px);
    }

    22%,
    68% {
        opacity: .92;
        transform: translateY(0);
    }

    82%,
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes redBar {
    to {
        transform: scaleY(.42);
        opacity: .55;
    }
}

@keyframes tickerMove {
    to {
        transform: translateX(-100%);
    }
}

@media (max-width: 980px) {
    .hex-field {
        width: 112vw;
        opacity: .34;
    }

    .side-module {
        display: none;
    }

    .login-card {
        padding: 34px 24px 30px;
    }

    .login-card::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}


html[data-brand="risk"] body.login-body {
    --bg: #4A0400;
    --bg2: #300300;
    --panel: rgba(74, 4, 0, 0.88);
    --panel-strong: rgba(56, 3, 0, 0.96);
    --red: var(--sev-critical);
    --red-soft: var(--sev-low);
    --red-dark: #4A0400;
    --muted: #D8A9A2;
    --line: rgba(199, 154, 75, 0.32);
    --shadow: 0 26px 80px rgba(35, 2, 0, 0.46);
    background: #4A0400;
    font-family: var(--font-ui);
}

html[data-brand="risk"] .login-bg-gradient {
    background:
        linear-gradient(rgba(240, 212, 138, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 212, 138, 0.035) 1px, transparent 1px);
    background-size: 58px 58px;
}

html[data-brand="risk"] .command-bg::before {
    background: conic-gradient(from 90deg at 50% 50%, transparent 0deg, rgba(255, 158, 0, 0.10) 42deg, transparent 86deg, transparent 360deg);
}

html[data-brand="risk"] .hex-field {
    filter: drop-shadow(0 0 28px rgba(255, 158, 0, 0.14));
}

html[data-brand="risk"] #redLine stop:first-child {
    stop-color: #FFFFFF;
}

html[data-brand="risk"] #redLine stop:nth-child(2) {
    stop-color: var(--sev-low);
}

html[data-brand="risk"] #redLine stop:last-child {
    stop-color: var(--sev-critical);
}

html[data-brand="risk"] .hex-ring,
html[data-brand="risk"] .route-path {
    stroke: var(--opn-gold);
}

html[data-brand="risk"] .alert-dot {
    fill: var(--sev-low);
}

html[data-brand="risk"] .side-module {
    border-left-color: var(--opn-gold);
    background: rgba(56, 3, 0, 0.76);
    box-shadow: none;
}

html[data-brand="risk"] .side-module::before,
html[data-brand="risk"] .side-module::after {
    border-color: var(--opn-gold);
}

html[data-brand="risk"] .module-title span:last-child,
html[data-brand="risk"] .ticker-track b,
html[data-brand="risk"] .classification b {
    color: var(--opn-gold-light);
}

html[data-brand="risk"] .login-card {
    background: rgba(56, 3, 0, 0.94);
    border-color: rgba(199, 154, 75, 0.44);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

html[data-brand="risk"] .login-card::before {
    background:
        linear-gradient(90deg, var(--opn-gold), transparent 34%) top left / 100% 2px no-repeat,
        linear-gradient(180deg, var(--opn-gold), transparent 38%) top left / 2px 100% no-repeat;
}

html[data-brand="risk"] .login-card::after {
    content: "CONTROL Y PROTECCIÓN";
    color: var(--opn-gold);
    letter-spacing: 0;
}

html[data-brand="risk"] .login-logo-badge {
    background: transparent;
    border: 0;
    box-shadow: none;
    clip-path: none;
}

html[data-brand="risk"] .login-logo-badge img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

html[data-brand="risk"] .login-logo h1 {
    color: #FFFFFF;
    letter-spacing: 0;
}

html[data-brand="risk"] .login-logo p {
    color: var(--brand-sidebar-text, #D8A9A2);
}

html[data-brand="risk"] .form-control {
    background: rgba(35, 2, 0, 0.72);
    border-color: rgba(216, 169, 162, 0.34);
    border-radius: 6px;
}

html[data-brand="risk"] .form-control:focus {
    background: rgba(35, 2, 0, 0.90);
    border-color: var(--opn-gold);
    box-shadow: 0 0 0 3px rgba(199, 154, 75, 0.16);
}

html[data-brand="risk"] .btn-login {
    background: var(--sev-critical);
    border: 1px solid var(--sev-critical);
    border-bottom: 2px solid var(--opn-gold);
    border-radius: 6px;
    box-shadow: none;
    letter-spacing: 0;
}

html[data-brand="risk"] .btn-login:hover {
    background: #6F0601;
    box-shadow: none;
    filter: none;
}

/* ==========================================================================
   Marca Iberdrola — maqueta clara del propietario
   (login_sentinel_iberdrola_claro 2.html, 29-08-2026). Arena #FFF5EC, verde
   #00A443, bosque #00402A, cielo #0DA9FF y atardecer #FF9C1A. El atributo
   data-theme del login puede seguir en dark: esta piel pinta encima y no
   usa el catálogo light_red, para que el carmín no se mezcle con los verdes.
   ========================================================================== */

html[data-brand="iberdrola"] {
    color-scheme: light;
}

html[data-brand="iberdrola"] body.login-body {
    --bg: #fff5ec;
    --bg2: #ffffff;
    --panel: rgba(255, 255, 255, 0.86);
    --panel-strong: #ffffff;
    --red: #00a443;
    --red-soft: #00a443;
    --red-dark: #00402a;
    --muted: #4d6b5c;
    --line: rgba(0, 164, 67, 0.22);
    --shadow: 0 28px 60px rgba(18, 51, 38, 0.12);
    --iberdrola-sky: #0da9ff;
    --iberdrola-sunset: #ff9c1a;
    --iberdrola-sand: #fff5ec;
    --iberdrola-ink: #123326;
    --white: #123326;
    color: var(--iberdrola-ink);
    background: var(--iberdrola-sand);
}

html[data-brand="iberdrola"] .login-bg-gradient,
html[data-brand="iberdrola"] .alert-beam,
html[data-brand="iberdrola"] .command-bg::before,
html[data-brand="iberdrola"] .command-bg::after {
    display: none;
}

html[data-brand="iberdrola"] .iberdrola-wash {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 32% 46%, rgba(13, 169, 255, .16), transparent 42%),
        radial-gradient(ellipse at 78% 18%, rgba(255, 156, 26, .14), transparent 36%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 164, 67, .12), transparent 40%);
}

html[data-brand="iberdrola"] .iberdrola-topbar {
    position: fixed;
    z-index: 6;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1.2rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(12px);
    font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

html[data-brand="iberdrola"] .iberdrola-topbar b {
    color: var(--red-dark);
    font-weight: 600;
}

html[data-brand="iberdrola"] .iberdrola-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(0, 164, 67, .16);
    display: inline-block;
    margin-right: .45rem;
}

.iberdrola-particulas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

html[data-brand="iberdrola"] .iberdrola-hud {
    position: fixed;
    z-index: 2;
    left: 1.2rem;
    bottom: 3.4rem;
    width: min(34rem, 42vw);
    padding: 0;
    background: none;
    pointer-events: none;
}

html[data-brand="iberdrola"] .iberdrola-hud-headline {
    margin: 0 0 .35rem;
    max-width: 16ch;
    color: var(--red-dark);
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.05;
}

html[data-brand="iberdrola"] .iberdrola-hud-copy {
    margin: 0 0 1.1rem;
    max-width: 34ch;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.45;
}

html[data-brand="iberdrola"] .iberdrola-hud-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

html[data-brand="iberdrola"] .iberdrola-kpi {
    min-width: 7.2rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(8px);
}

html[data-brand="iberdrola"] .iberdrola-kpi b {
    display: block;
    color: var(--red-dark);
    font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 600;
}

html[data-brand="iberdrola"] .iberdrola-kpi small {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .62rem;
}

@media (max-width: 1100px) {
    html[data-brand="iberdrola"] .iberdrola-hud {
        width: min(30rem, 38vw);
    }
}

@media (max-width: 980px), (max-height: 700px) {
    html[data-brand="iberdrola"] .iberdrola-hud {
        display: none;
    }
}

@media (max-width: 980px) {
    html[data-brand="iberdrola"] .iberdrola-topbar-hide-sm {
        display: none;
    }
}

html[data-brand="iberdrola"] .ticker {
    top: auto;
    bottom: 0;
    height: auto;
    padding: .45rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, .86);
}

html[data-brand="iberdrola"] .ticker-track {
    height: auto;
    padding-left: 0;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
    animation-duration: 48s;
}

html[data-brand="iberdrola"] .ticker-track b {
    color: var(--red);
}

html[data-brand="iberdrola"] .classification {
    display: none;
}

html[data-brand="iberdrola"] .login-container {
    justify-items: end;
    padding: 5.2rem 2.2rem 4.2rem;
}

@media (max-width: 980px) {
    html[data-brand="iberdrola"] .login-container {
        justify-items: center;
        padding: 4.6rem 1.2rem 4rem;
    }
}

html[data-brand="iberdrola"] .login-card {
    width: min(26.5rem, calc(100vw - 2rem));
    padding: 0 0 1.35rem;
    color: var(--iberdrola-ink);
    background: #ffffff;
    border: 1px solid rgba(0, 64, 42, .08);
    border-radius: 0;
    box-shadow:
        0 28px 60px rgba(18, 51, 38, .12),
        0 0 0 1px rgba(255, 255, 255, .8) inset;
}

html[data-brand="iberdrola"] .login-card::before {
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--red), var(--iberdrola-sky), var(--iberdrola-sunset));
}

html[data-brand="iberdrola"] .login-card::after {
    display: none;
}

html[data-brand="iberdrola"] .login-logo {
    position: relative;
    text-align: left;
    margin: 0;
    padding: 1.35rem 1.6rem 1.05rem 1.75rem;
    background: #fff;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--red), var(--iberdrola-sky), var(--iberdrola-sunset)) 1;
}

html[data-brand="iberdrola"] .login-logo-badge {
    width: auto;
    max-width: 248px;
    padding: 0;
    height: auto;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    clip-path: none;
}

html[data-brand="iberdrola"] .login-logo-badge img {
    width: auto;
    height: 56px;
    max-width: min(100%, 248px);
    max-height: none;
    object-fit: contain;
    display: block;
    background: #fff;
}

html[data-brand="iberdrola"] .iberdrola-product {
    display: block;
    margin-top: .65rem;
    font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

html[data-brand="iberdrola"] .login-logo h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Selector con `p.` a propósito: `.login-logo p` (0,2,2) le ganaba a
   `.iberdrola-access` (0,2,1), así que el tamaño de 1.15rem y el color de marca
   NUNCA se aplicaban. El título salía en Inter a 13,76 px —exactamente el mismo
   cuerpo que el párrafo de debajo— y en el mismo gris verdoso, así que no era un
   título: era una primera línea en negrita. De ahí que se leyera como un pegote.

   Y la tipografía: la página tiene tres con papeles claros —Chakra Petch para el
   titular, IBM Plex Mono para los cintillos, Inter para el cuerpo— y este texto
   no usaba ninguna de las dos que llevan la identidad. Ahora es de la casa. */
html[data-brand="iberdrola"] .login-logo p.iberdrola-access {
    margin: 1.35rem 1.6rem 0.35rem 1.75rem;
    font-family: var(--font-display, "Chakra Petch", "Segoe UI", Inter, sans-serif);
    font-size: 1.4rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--red-dark);
}

html[data-brand="iberdrola"] .login-logo p {
    margin: 0 1.6rem 0 1.75rem;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
}

html[data-brand="iberdrola"] #login-form,
html[data-brand="iberdrola"] #mfa-panel,
html[data-brand="iberdrola"] #sso-section,
html[data-brand="iberdrola"] #sso-status-message {
    padding-left: 1.75rem;
    padding-right: 1.6rem;
}

html[data-brand="iberdrola"] .form-label {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--red-dark);
    font-weight: 600;
}

html[data-brand="iberdrola"] .form-control {
    background: var(--iberdrola-sand);
    border: 1px solid rgba(0, 164, 67, .28);
    border-radius: 0;
    color: var(--iberdrola-ink);
}

html[data-brand="iberdrola"] .form-control:focus {
    background: #fff;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(0, 164, 67, .16);
}

html[data-brand="iberdrola"] .btn-login {
    background: var(--red);
    color: #fff;
    border-radius: 0;
    box-shadow: 0 8px 22px rgba(0, 164, 67, .28);
    letter-spacing: .04em;
}

html[data-brand="iberdrola"] .btn-login:hover {
    box-shadow: 0 10px 26px rgba(0, 164, 67, .34);
    filter: brightness(1.05);
    color: #fff;
}

html[data-brand="iberdrola"] .btn-outline-info,
html[data-brand="iberdrola"] .btn-outline-light,
html[data-brand="iberdrola"] .btn-outline-secondary {
    border-color: rgba(0, 164, 67, .45);
    color: var(--red-dark);
    background: rgba(0, 164, 67, .06);
}

html[data-brand="iberdrola"] .btn-outline-info:hover,
html[data-brand="iberdrola"] .btn-outline-light:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

html[data-brand="iberdrola"] .login-error {
    background: rgba(180, 35, 24, .08);
    border-color: rgba(180, 35, 24, .28);
    color: #b42318;
}

html[data-brand="iberdrola"] .text-muted {
    color: var(--muted) !important;
}

html[data-brand="iberdrola"] #mfa-qr {
    background: #fff;
}

/* ── Fondo y tinta del campo van SIEMPRE juntos y con la maqueta del acceso ─
   31-08-2026 (risk.opnconsultoria.com, light_red): tinta del tema #1f1714
   sobre campo oscuro, 1,08:1. 16-09-2026 (risk-dev, marca HSI + light_red
   guardado): `html:root .form-control` gana el FONDO claro (#fff) y esta
   regla solo pintaba la tinta `--white` (#f5f7fb) → blanco sobre blanco.
   AA pide 4,5. Declarar uno y heredar el otro es cómo aparecen estos pares. */
html:root body.login-body .form-control,
html:root body.login-body textarea {
    color: var(--white);
    background: rgba(5, 6, 9, .66);
    caret-color: var(--white);
}

html:root body.login-body .form-control:focus,
html:root body.login-body textarea:focus {
    color: var(--white);
    background: rgba(8, 9, 13, .86);
    caret-color: var(--white);
}

html:root body.login-body .form-control::placeholder,
html:root body.login-body textarea::placeholder {
    color: color-mix(in srgb, var(--white) 58%, transparent);
    opacity: 1;
}

html:root[data-brand="risk"] body.login-body .form-control,
html:root[data-brand="risk"] body.login-body textarea {
    color: var(--white);
    background: rgba(35, 2, 0, 0.72);
    caret-color: var(--white);
}

html:root[data-brand="risk"] body.login-body .form-control:focus,
html:root[data-brand="risk"] body.login-body textarea:focus {
    color: var(--white);
    background: rgba(35, 2, 0, 0.90);
    caret-color: var(--white);
}

html:root[data-brand="iberdrola"] body.login-body .form-control,
html:root[data-brand="iberdrola"] body.login-body textarea {
    color: var(--iberdrola-ink);
    background: var(--iberdrola-sand);
    caret-color: var(--iberdrola-ink);
}

html:root[data-brand="iberdrola"] body.login-body .form-control:focus,
html:root[data-brand="iberdrola"] body.login-body textarea:focus {
    color: var(--iberdrola-ink);
    background: #fff;
    caret-color: var(--iberdrola-ink);
}
