/* =========================================================
   Perímetro público Corporate Professional
   Layout externo, autenticación, recuperación, 2FA y estados.
   ========================================================= */

.portal-external-body {
    --pre-navy-950: #061427;
    --pre-navy-900: #091a31;
    --pre-navy-850: #0c213d;
    --pre-navy-800: #102b50;
    --pre-cobalt: #145bd7;
    --pre-cobalt-strong: #0d4fc7;
    --pre-cobalt-soft: #eaf1ff;
    --pre-gold: #c6a25b;
    --pre-gold-light: #e3c989;
    --pre-ink: #122039;
    --pre-copy: #4a5a70;
    --pre-muted: #718096;
    --pre-line: #dce3ec;
    --pre-surface: #f4f6f9;
    --pre-success: #0d8d6f;
    --pre-warning: #b7791f;
    --pre-danger: #b13b48;
    --pre-serif: Georgia, Cambria, "Times New Roman", serif;
    --pre-sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    --pre-mono: "Roboto Mono", Consolas, monospace;
    min-height: 100vh;
    margin: 0;
    color: var(--pre-ink);
    background: var(--pre-navy-950);
    font-family: var(--pre-sans);
}

.portal-external-body *,
.portal-external-body *::before,
.portal-external-body *::after {
    box-sizing: border-box;
}

.portal-external-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: clip;
    background:
        radial-gradient(circle at 82% 25%, rgba(20, 91, 215, .18), transparent 29rem),
        linear-gradient(118deg, var(--pre-navy-950) 0%, var(--pre-navy-900) 57%, #0b2343 100%);
}

.portal-external-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .095;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px);
    background-size: 78px 78px;
    mask-image: linear-gradient(90deg, transparent 0, #000 56%, #000 100%);
}

.portal-external-architecture {
    position: fixed;
    z-index: 0;
    top: 120px;
    right: -80px;
    width: min(49vw, 700px);
    height: calc(100vh - 180px);
    min-height: 490px;
    opacity: .18;
    pointer-events: none;
    transform: skewX(-8deg);
    border: 1px solid rgba(255, 255, 255, .18);
}

.portal-external-architecture span {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, .28);
}

.portal-external-architecture span:nth-child(1) { left: 14%; }
.portal-external-architecture span:nth-child(2) { left: 32%; }
.portal-external-architecture span:nth-child(3) { left: 50%; background: rgba(227, 201, 137, .72); }
.portal-external-architecture span:nth-child(4) { left: 68%; }
.portal-external-architecture span:nth-child(5) { left: 86%; }

.portal-external-architecture::after {
    content: "";
    position: absolute;
    top: 23%;
    right: 5%;
    left: 5%;
    height: 1px;
    background: rgba(227, 201, 137, .58);
    box-shadow: 0 140px 0 rgba(255, 255, 255, .22), 0 280px 0 rgba(255, 255, 255, .22);
}

.portal-external-skip {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 10px;
    padding: 10px 15px;
    color: #fff !important;
    background: var(--pre-cobalt);
    border-radius: 2px;
    transform: translateY(-160%);
    transition: transform .2s ease;
}

.portal-external-skip:focus { transform: translateY(0); }

.portal-external-header {
    position: relative;
    z-index: 20;
    min-height: 76px;
    border-bottom: 1px solid rgba(255, 255, 255, .13);
}

.portal-external-header-inner,
.portal-external-footer-inner {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.portal-external-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.portal-external-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
    text-decoration: none;
}

.portal-external-brand-logo {
    width: 218px;
    height: auto;
    display: block;
    object-fit: contain;
}

.portal-external-brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    border: 1px solid rgba(227, 201, 137, .62);
    background: rgba(255, 255, 255, .04);
}

.portal-external-brand-mark::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 17px;
    height: 17px;
    border-right: 2px solid var(--pre-gold);
    border-bottom: 2px solid var(--pre-gold);
}

.portal-external-brand-mark i { font-size: 1.3rem; }
.portal-external-brand-copy { display: grid; gap: 1px; }

.portal-external-brand-copy strong {
    color: #fff;
    font-family: var(--pre-serif);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: .005em;
    line-height: 1.1;
}

.portal-external-brand-copy small {
    color: rgba(255, 255, 255, .56);
    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.portal-external-nav {
    display: flex;
    align-items: center;
    gap: 9px;
}

.portal-external-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    color: rgba(255, 255, 255, .68);
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: .75rem;
    font-weight: 650;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.portal-external-nav a:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .19);
    background: rgba(255, 255, 255, .045);
}

.portal-external-nav-primary {
    color: #fff !important;
    background: var(--pre-cobalt) !important;
    border-color: var(--pre-cobalt) !important;
    box-shadow: 0 9px 22px rgba(20, 91, 215, .22);
}

.portal-external-nav-primary:hover { transform: translateY(-1px); background: #1b65e6 !important; }

.portal-external-body .verificar-main-clean {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    min-height: 0;
    display: flex;
    flex: 1 0 auto;
    margin: 0;
    padding: 0;
}

.portal-external-footer {
    position: relative;
    z-index: 3;
    min-height: 58px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(3, 14, 28, .3);
}

.portal-external-footer-inner {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    color: rgba(255, 255, 255, .4);
    font-size: .62rem;
    letter-spacing: .04em;
}

.portal-external-footer-principles {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.portal-external-footer-principles i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--pre-gold);
}

/* Estructuras generales de autenticación */
.portal-login-v2-page,
.portal-auth-dialog-page,
.portal-public-state-page,
.portal-auth-popup-page {
    width: 100%;
    min-height: calc(100vh - 146px);
    display: grid;
    place-items: center;
    padding: 32px 24px;
}

.portal-login-v2-card,
.portal-auth-dialog-shell {
    position: relative;
    width: min(100%, 1060px);
    overflow: hidden;
    border: 1px solid rgba(227, 201, 137, .34);
    border-radius: 3px;
    background: var(--pre-navy-900);
    box-shadow: 0 34px 85px rgba(0, 8, 21, .42);
}

.portal-login-v2-card::before,
.portal-auth-dialog-shell::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: linear-gradient(var(--pre-gold-light), var(--pre-cobalt));
}

.portal-login-v2-brand,
.portal-auth-dialog-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.portal-login-v2-brand {
    min-height: 62px;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.portal-login-v2-brand > *,
.portal-auth-dialog-brand > * {
    display: none;
}

.portal-login-v2-brand::before,
.portal-auth-dialog-brand::before {
    content: "";
    width: 205px;
    height: 48px;
    display: block;
    flex: 0 0 auto;
    background: url("../../images/brand/portal-recibos-logo.png") left center / contain no-repeat;
}

.portal-login-v2-brand::after {
    content: "ACCESO / CONFIDENCIAL";
    margin-left: auto;
    color: rgba(255, 255, 255, .34);
    font-family: var(--pre-mono);
    font-size: .52rem;
    letter-spacing: .11em;
}

.portal-login-v2-brand-icon,
.portal-auth-dialog-icon {
    position: relative;
    width: 41px;
    height: 41px;
    display: grid;
    place-items: center;
    flex: 0 0 41px;
    color: var(--pre-gold-light);
    border: 1px solid rgba(227, 201, 137, .42);
    border-radius: 0;
    background: rgba(227, 201, 137, .045);
    font-size: 1.15rem;
}

.portal-login-v2-brand h1,
.portal-login-v2-brand p,
.portal-auth-dialog-brand strong,
.portal-auth-dialog-brand span { display: block; margin: 0; }

.portal-login-v2-brand h1,
.portal-auth-dialog-brand strong {
    color: #fff;
    font-family: var(--pre-serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
}

.portal-login-v2-brand p,
.portal-auth-dialog-brand span {
    color: rgba(255, 255, 255, .46);
    font-size: .56rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.portal-login-v2-grid,
.portal-auth-dialog-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(370px, 430px);
}

.portal-login-v2-grid { gap: 0; }

.portal-login-v2-copy,
.portal-auth-dialog-copy {
    position: relative;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 39px 50px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 82px 100%,
        var(--pre-navy-900);
}

.portal-auth-dialog-copy { min-height: 520px; }

.portal-login-v2-kicker,
.portal-auth-dialog-kicker,
.portal-auth-popup-kicker,
.portal-public-state-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--pre-gold-light);
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.portal-login-v2-kicker::before,
.portal-auth-dialog-kicker::before,
.portal-auth-popup-kicker::before,
.portal-public-state-kicker::before {
    content: "";
    width: 26px;
    height: 1px;
    flex: 0 0 auto;
    background: var(--pre-gold);
}

.portal-login-v2-copy h2,
.portal-auth-dialog-copy h1 {
    max-width: 650px;
    margin: 16px 0 17px;
    color: #fff;
    font-family: var(--pre-serif);
    font-size: clamp(2.7rem, 4.4vw, 4.35rem);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
}

.portal-login-v2-copy > p,
.portal-auth-dialog-copy > p {
    max-width: 570px;
    margin: 0;
    color: rgba(255, 255, 255, .62);
    font-size: .95rem;
    line-height: 1.7;
}

.portal-login-v2-benefits,
.portal-auth-dialog-list {
    display: grid;
    gap: 0;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.portal-login-v2-benefits li,
.portal-auth-dialog-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    color: rgba(255, 255, 255, .64);
    border-bottom: 1px solid rgba(255, 255, 255, .09);
    font-size: .77rem;
    line-height: 1.5;
}

.portal-login-v2-benefits i,
.portal-auth-dialog-list i {
    margin-top: 1px;
    color: var(--pre-gold-light);
    font-size: 1rem;
}

.portal-login-v2-benefits strong,
.portal-login-v2-benefits span { display: block; }
.portal-login-v2-benefits strong { color: #fff; font-size: .8rem; font-weight: 650; }
.portal-login-v2-benefits span { color: rgba(255, 255, 255, .5); font-size: .71rem; }

.portal-login-v2-form-wrap,
.portal-auth-dialog-form-wrap {
    min-width: 0;
    display: grid;
    align-items: center;
    padding: 24px;
    color: var(--pre-ink);
    background: #f2f4f7;
}

.portal-login-v2-form-card,
.portal-auth-dialog-form {
    position: relative;
    padding: 27px 28px;
    color: var(--pre-ink);
    background: #fff;
    border: 1px solid #d8e0e9;
    border-radius: 2px;
    box-shadow: 0 18px 40px rgba(20, 39, 66, .11);
}

.portal-login-v2-form-card::before,
.portal-auth-dialog-form::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--pre-gold), var(--pre-cobalt));
}

.portal-login-v2-form-head {
    position: relative;
    padding-right: 43px;
}

.portal-login-v2-form-head::after,
.portal-auth-dialog-form-head::after {
    content: "PR";
    position: absolute;
    top: 28px;
    right: 27px;
    color: #cad2dc;
    font-family: var(--pre-serif);
    font-size: 1rem;
    font-weight: 700;
}

.portal-auth-dialog-form-head { position: static; }

.portal-login-v2-form-head h2,
.portal-auth-dialog-form-head h2 {
    margin: 0 0 7px;
    color: var(--pre-ink);
    font-family: var(--pre-serif);
    font-size: 1.72rem;
    font-weight: 600;
    letter-spacing: -.025em;
}

.portal-login-v2-form-head p,
.portal-auth-dialog-form-head p {
    margin: 0 0 18px;
    color: var(--pre-copy);
    font-size: .81rem;
    line-height: 1.55;
}

.portal-login-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.portal-login-field label {
    color: var(--pre-ink);
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.portal-login-input {
    min-height: 49px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid #c7d1dd;
    border-radius: 2px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.portal-login-input:focus-within {
    border-color: var(--pre-cobalt);
    background: #fbfdff;
    box-shadow: 0 0 0 3px rgba(20, 91, 215, .1);
}

.portal-login-input i { color: var(--pre-cobalt); font-size: 1.02rem; }

.portal-login-input input,
.portal-login-input select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pre-ink);
    font-size: .89rem;
    font-weight: 600;
}

.portal-login-input input::placeholder { color: #8996a7; font-weight: 450; }

.portal-login-v2-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 3px 0 15px;
    color: var(--pre-copy);
    font-size: .75rem;
}

.portal-login-v2-row a,
.portal-auth-dialog-footer a {
    color: var(--pre-cobalt-strong);
    font-weight: 700;
    text-decoration: none;
}

.portal-login-v2-row a:hover,
.portal-auth-dialog-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.portal-login-check { display: inline-flex; align-items: center; gap: 7px; color: var(--pre-copy); }
.portal-login-check input { accent-color: var(--pre-cobalt); }

.portal-login-v2-recovery-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: -7px 0 14px;
    color: var(--pre-copy);
    font-size: .72rem;
}
.portal-login-v2-recovery-link i { color: var(--pre-cobalt-strong); font-size: .9rem; }
.portal-login-v2-recovery-link a { color: var(--pre-cobalt-strong); font-weight: 700; text-decoration: none; }
.portal-login-v2-recovery-link a:hover { text-decoration: underline; text-underline-offset: 3px; }

.portal-login-v2-submit {
    width: 100%;
    min-height: 49px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    border: 1px solid var(--pre-cobalt);
    border-radius: 2px;
    background: var(--pre-cobalt);
    color: #fff !important;
    font-size: .81rem;
    font-weight: 750;
    letter-spacing: .015em;
    text-decoration: none;
    box-shadow: 0 11px 24px rgba(20, 91, 215, .21);
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.portal-login-v2-submit:hover {
    background: #1b65e6;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(20, 91, 215, .28);
}

.portal-login-v2-submit i { transition: transform .2s ease; }
.portal-login-v2-submit:hover i { transform: translateX(2px); }
.portal-login-v2-submit-inline { width: auto; min-width: 190px; }
.portal-login-v2-submit-sm { min-height: 45px; }

.portal-login-v2-note,
.portal-auth-account-pill,
.portal-auth-help,
.portal-password-policy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 12px;
    color: var(--pre-copy);
    border: 1px solid #d9e1ea;
    border-radius: 2px;
    background: #f4f7fb;
    font-size: .71rem;
    line-height: 1.45;
}

.portal-login-v2-note i,
.portal-auth-account-pill i,
.portal-auth-help i,
.portal-password-policy i { color: var(--pre-success); font-size: 1rem; }

.portal-login-v2-note strong,
.portal-login-v2-note span { display: block; }
.portal-login-v2-note strong { color: var(--pre-ink); font-size: .74rem; font-weight: 700; }
.portal-login-v2-note span { color: var(--pre-copy); font-size: .68rem; }

.portal-auth-dialog-brand { margin-bottom: 26px; }
.portal-auth-dialog-footer { margin-top: 15px; text-align: center; font-size: .74rem; }
.portal-auth-account-pill { margin: 0 0 15px; }
.portal-auth-account-pill i { color: var(--pre-cobalt); }
.portal-auth-help { margin: 16px 0 0; }
.portal-auth-help.is-warning { color: #6e4e13; border-color: #e4d1a6; background: #fff9eb; }
.portal-auth-help.is-warning i { color: var(--pre-warning); }
.portal-password-policy { margin: 0 0 16px; }

.portal-password-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.portal-password-label-row > label {
    margin: 0;
}

.portal-password-policy-compact {
    position: relative;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #c8d3df;
    border-radius: 50%;
    color: var(--pre-cobalt-strong);
    background: #fff;
    cursor: help;
    outline: 0;
}

.portal-password-policy-compact > i {
    font-size: .86rem;
}

.portal-password-policy-tooltip {
    position: absolute;
    right: -4px;
    bottom: calc(100% + 9px);
    z-index: 20;
    width: min(285px, calc(100vw - 48px));
    padding: 9px 11px;
    border: 1px solid #c6d2df;
    border-radius: 2px;
    background: var(--pre-navy-900);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 17, 42, .24);
    font-size: .68rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    pointer-events: none;
}

.portal-password-policy-tooltip::after {
    position: absolute;
    top: 100%;
    right: 9px;
    width: 8px;
    height: 8px;
    content: "";
    border-right: 1px solid #c6d2df;
    border-bottom: 1px solid #c6d2df;
    background: var(--pre-navy-900);
    transform: translateY(-4px) rotate(45deg);
}

.portal-password-policy-compact:hover .portal-password-policy-tooltip,
.portal-password-policy-compact:focus .portal-password-policy-tooltip,
.portal-password-policy-compact:focus-within .portal-password-policy-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.portal-password-policy-compact:focus-visible {
    box-shadow: 0 0 0 3px rgba(20, 91, 215, .18);
}

.portal-2fa-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.portal-2fa-method { position: relative; cursor: pointer; }
.portal-2fa-method input { position: absolute; opacity: 0; }

.portal-2fa-method span {
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
    color: var(--pre-copy);
    border: 1px solid #c7d1dd;
    border-radius: 2px;
    background: #fff;
    font-size: .65rem;
    font-weight: 700;
}

.portal-2fa-method input:checked + span {
    color: var(--pre-cobalt-strong);
    border-color: var(--pre-cobalt);
    background: var(--pre-cobalt-soft);
    box-shadow: inset 0 -2px 0 var(--pre-cobalt);
}

/* Alertas del formulario */
.portal-external-body .alert {
    border-radius: 2px;
    font-size: .72rem;
}

.portal-external-body .alert-info { color: #174f84; border-color: #bed6ef; background: #eef6ff; }
.portal-external-body .alert-danger { color: #892f3b; border-color: #e8c3c8; background: #fff2f3; }

.portal-external-body .btn-outline-primary {
    min-height: 44px;
    border-color: #b5c8e5;
    border-radius: 2px;
    color: var(--pre-cobalt-strong);
    font-size: .72rem;
    font-weight: 700;
}

.portal-external-body .btn-outline-primary:hover { color: #fff; border-color: var(--pre-cobalt); background: var(--pre-cobalt); }

/* Confirmaciones, bloqueo y error */
.portal-public-state-card,
.portal-auth-popup-card {
    position: relative;
    width: min(100%, 590px);
    overflow: hidden;
    padding: 42px 44px;
    color: var(--pre-ink);
    border: 1px solid #d6dee8;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 34px 85px rgba(0, 8, 21, .39);
    text-align: left;
}

.portal-public-state-card::before,
.portal-auth-popup-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--pre-cobalt);
}

.portal-public-state-card.is-success::before,
.portal-auth-popup-card::before { background: var(--pre-success); }
.portal-public-state-card.is-warning::before { background: var(--pre-gold); }
.portal-public-state-card.is-danger::before { background: var(--pre-danger); }

.portal-public-state-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 29px;
    color: var(--pre-muted);
    font-family: var(--pre-serif);
    font-size: 0;
    font-weight: 700;
}

.portal-public-state-brand > i { display: none; }

.portal-public-state-brand::before {
    content: "";
    width: 206px;
    height: 50px;
    display: block;
    border: 1px solid rgba(198, 162, 91, .34);
    background: var(--pre-navy-900) url("../../images/brand/portal-recibos-logo.png") center / 188px auto no-repeat;
}

.portal-public-state-brand::after {
    content: "DOCUMENTO / ESTADO";
    margin-left: auto;
    color: #a4afbc;
    font-family: var(--pre-mono);
    font-size: .49rem;
    letter-spacing: .1em;
}

.portal-public-state-icon,
.portal-auth-popup-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    color: var(--pre-cobalt);
    border: 1px solid #bfd0eb;
    border-radius: 0;
    background: var(--pre-cobalt-soft);
    font-size: 1.65rem;
}

.portal-public-state-card.is-success .portal-public-state-icon,
.portal-auth-popup-icon { color: var(--pre-success); border-color: #b8ddcf; background: #edf9f5; }
.portal-public-state-card.is-warning .portal-public-state-icon { color: var(--pre-warning); border-color: #e2d0a6; background: #fff9eb; }
.portal-public-state-card.is-danger .portal-public-state-icon { color: var(--pre-danger); border-color: #e6c1c7; background: #fff2f3; }

.portal-public-state-card h1,
.portal-auth-popup-card h1 {
    margin: 15px 0 13px;
    color: var(--pre-ink);
    font-family: var(--pre-serif);
    font-size: clamp(2.25rem, 4.5vw, 3.65rem);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -.04em;
}

.portal-public-state-card > p,
.portal-auth-popup-card > p {
    margin: 0;
    color: var(--pre-copy);
    font-size: .89rem;
    line-height: 1.65;
}

.portal-public-state-detail,
.portal-auth-popup-meta {
    display: grid;
    gap: 4px;
    margin-top: 22px;
    padding: 14px 16px;
    color: var(--pre-copy);
    border: 1px solid var(--pre-line);
    border-radius: 2px;
    background: var(--pre-surface);
    font-size: .68rem;
}

.portal-public-state-detail strong,
.portal-auth-popup-meta strong { color: var(--pre-ink); }

.portal-public-state-actions,
.portal-auth-popup-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 25px;
}

.portal-public-state-actions .btn {
    min-width: 148px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border-radius: 2px;
    font-size: .7rem;
    font-weight: 750;
}

.portal-public-state-actions .btn-primary {
    color: #fff;
    border-color: var(--pre-cobalt);
    background: var(--pre-cobalt);
}

.portal-public-state-actions .btn-primary:hover { border-color: #1b65e6; background: #1b65e6; }

.portal-public-state-actions .btn-outline-secondary,
.portal-public-state-actions .btn-outline-light {
    color: var(--pre-ink);
    border-color: #c8d1dc;
    background: #fff;
}

.portal-public-state-actions .btn-outline-secondary:hover,
.portal-public-state-actions .btn-outline-light:hover {
    color: var(--pre-ink);
    border-color: #9ba9ba;
    background: #f4f6f9;
}

.portal-public-state-actions .btn-danger { color: #fff; border-color: var(--pre-danger); background: var(--pre-danger); }

.portal-public-request-id {
    margin-top: 20px;
    color: var(--pre-muted);
    font-size: .64rem;
}

.portal-public-request-id code { color: var(--pre-cobalt-strong); overflow-wrap: anywhere; }
.portal-auth-popup-page { background: transparent; }

.portal-external-body .text-danger {
    color: var(--pre-danger) !important;
    font-size: .66rem;
    font-weight: 650;
}

.portal-external-body .validation-summary-valid { display: none; }

@media (max-width: 900px) {
    .portal-login-v2-grid,
    .portal-auth-dialog-shell { grid-template-columns: 1fr; }

    .portal-login-v2-copy,
    .portal-auth-dialog-copy { min-height: auto; padding: 42px 40px; }

    .portal-login-v2-copy h2,
    .portal-auth-dialog-copy h1 { font-size: clamp(2.6rem, 8vw, 4rem); }

    .portal-login-v2-form-wrap,
    .portal-auth-dialog-form-wrap { padding: 28px; }

    .portal-external-architecture { width: 75vw; opacity: .13; }
}

@media (min-width: 901px) and (max-height: 850px) {
    .portal-login-v2-page,
    .portal-auth-dialog-page,
    .portal-public-state-page,
    .portal-auth-popup-page {
        min-height: calc(100vh - 154px);
        padding-block: 18px;
    }

    .portal-login-v2-copy,
    .portal-auth-dialog-copy { padding-block: 31px; }

    .portal-auth-dialog-copy { min-height: 470px; }
    .portal-login-v2-brand { min-height: 58px; padding-block: 7px; }
    .portal-login-v2-form-wrap,
    .portal-auth-dialog-form-wrap { padding-block: 18px; }
}

@media (max-width: 640px) {
    .portal-external-header-inner,
    .portal-external-footer-inner { width: min(100% - 30px, 1180px); }

    .portal-external-header,
    .portal-external-header-inner { min-height: 68px; }

    .portal-external-brand-copy small { display: none; }
    .portal-external-brand-mark { width: 38px; height: 38px; }
    .portal-external-brand-logo { width: 172px; }
    .portal-external-nav a { width: 40px; padding: 8px; }
    .portal-external-nav a span { display: none; }
    .portal-external-nav-primary i { font-size: 1rem; }

    .portal-login-v2-page,
    .portal-auth-dialog-page,
    .portal-public-state-page,
    .portal-auth-popup-page { min-height: calc(100vh - 138px); padding: 20px 14px; }

    .portal-login-v2-brand { padding-inline: 18px; }
    .portal-login-v2-brand::after { display: none; }
    .portal-login-v2-brand::before,
    .portal-auth-dialog-brand::before { width: 180px; height: 43px; }

    .portal-login-v2-copy,
    .portal-auth-dialog-copy { padding: 34px 25px; }

    .portal-login-v2-copy h2,
    .portal-auth-dialog-copy h1 { font-size: clamp(2.45rem, 13vw, 3.4rem); }

    .portal-login-v2-form-wrap,
    .portal-auth-dialog-form-wrap { padding: 14px; }

    .portal-login-v2-form-card,
    .portal-auth-dialog-form { padding: 27px 21px; }

    .portal-login-v2-form-head::after,
    .portal-auth-dialog-form-head::after { display: none; }

    .portal-login-v2-row { align-items: flex-start; flex-direction: column; }
    .portal-2fa-methods { grid-template-columns: 1fr; }

    .portal-public-state-card,
    .portal-auth-popup-card { padding: 31px 25px; }

    .portal-public-state-brand::after { display: none; }
    .portal-public-state-actions,
    .portal-auth-popup-actions { align-items: stretch; flex-direction: column; }
    .portal-public-state-actions .btn,
    .portal-auth-popup-actions .portal-login-v2-submit { width: 100%; }

    .portal-external-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 14px; }
    .portal-external-footer-principles { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-external-body *,
    .portal-external-body *::before,
    .portal-external-body *::after { transition-duration: .01ms !important; }
}

/* Reclamación personal del empleado */
.portal-external-body .portal-auth-context-card {
    display: grid;
    gap: .35rem;
    margin: 1.25rem 0;
    padding: 1rem;
    color: var(--pre-copy);
    border: 1px solid var(--pre-line);
    border-radius: 2px;
    background: var(--pre-surface);
}

.portal-external-body .portal-auth-context-card span,
.portal-external-body .portal-auth-context-card small {
    color: var(--pre-muted);
}

.portal-external-body .portal-auth-context-card strong {
    color: var(--pre-ink);
}

.portal-external-body .portal-consent-check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .75rem;
    align-items: start;
    margin: 1rem 0;
    padding: 1rem;
    color: var(--pre-copy);
    border: 1px solid var(--pre-line);
    border-radius: 2px;
    background: var(--pre-surface);
    font-size: .76rem;
    line-height: 1.55;
}

.portal-external-body .portal-consent-check input {
    margin-top: .25rem;
    accent-color: var(--pre-cobalt);
}

.portal-external-body .portal-login-code-input input {
    font-variant-numeric: tabular-nums;
    letter-spacing: .38em;
    text-align: center;
    font-size: 1.08rem;
    font-weight: 800;
}

.portal-external-body .portal-inline-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: 1rem;
    border-width: 1px;
    border-radius: 2px;
}

.portal-external-body .portal-inline-alert i {
    flex: 0 0 auto;
    margin-top: .12rem;
    font-size: 1.1rem;
}

.portal-external-body .portal-auth-secondary-action {
    margin-top: 1.2rem;
    padding-top: .85rem;
    border-top: 1px solid var(--pre-line);
}

.portal-external-body .portal-auth-secondary-action > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    color: var(--pre-cobalt-strong);
    cursor: pointer;
    font-size: .72rem;
    font-weight: 750;
    list-style: none;
}

.portal-external-body .portal-auth-secondary-action > summary::-webkit-details-marker {
    display: none;
}

.portal-external-body .portal-auth-secondary-action > summary i:last-child {
    transition: transform .18s ease;
}

.portal-external-body .portal-auth-secondary-action[open] > summary i:last-child {
    transform: rotate(180deg);
}

.portal-external-body .portal-auth-secondary-action > form {
    padding-top: 10px;
}
.portal-claim-review-card {
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid rgba(172, 194, 224, .25);
    border-left: 3px solid var(--pre-gold);
    border-radius: 2px;
    color: #f4f7fb;
    background: linear-gradient(115deg, #142c4b, #0d213c);
    box-shadow: 0 18px 38px rgba(0, 8, 21, .16);
}

.portal-claim-reject-panel {
    margin-bottom: 1rem;
    padding: .75rem;
    border: 1px solid #dbc991;
    border-radius: 2px;
    background: #fffdf7;
}

.portal-claim-reject-panel summary {
    color: #795718;
    cursor: pointer;
    font-weight: 750;
    list-style: none;
}

.portal-claim-reject-panel summary::-webkit-details-marker {
    display: none;
}

.portal-claim-reject-panel[open] summary {
    margin-bottom: .8rem;
}

.portal-claim-reject-panel form {
    display: grid;
    gap: .65rem;
}

.portal-claim-review-heading {
    display: grid;
    gap: 2px;
    padding: 15px 16px 13px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.portal-claim-review-heading span {
    color: var(--pre-gold-light);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.portal-claim-review-heading strong {
    color: #fff;
    font-family: var(--pre-serif);
    font-size: 1.18rem;
    font-weight: 600;
}

.portal-claim-review-heading small {
    color: rgba(255, 255, 255, .72);
    font-size: .78rem;
    font-weight: 650;
}

.portal-claim-review-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.portal-claim-review-card dl div {
    display: grid;
    gap: 3px;
    padding: 11px 16px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.portal-claim-review-card dl div:nth-child(even) {
    border-right: 0;
}

.portal-claim-review-card dt {
    color: rgba(224, 234, 248, .58);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.portal-claim-review-card dd {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-claim-privacy-note {
    display: block;
    padding: 10px 16px 12px;
    color: rgba(230, 238, 250, .62);
    font-size: .69rem;
    line-height: 1.45;
}

.portal-claim-page {
    padding-block: 18px;
}

.portal-claim-shell {
    width: min(100%, 1120px);
    grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
}

.portal-claim-copy {
    min-height: 0;
    padding: 30px 42px;
}

.portal-claim-copy .portal-auth-dialog-brand {
    margin-bottom: 17px;
}

.portal-claim-copy h1 {
    margin-block: 12px 13px;
    font-size: clamp(2.8rem, 3.8vw, 3.75rem);
}

.portal-claim-copy > p {
    font-size: .84rem;
    line-height: 1.55;
}

.portal-claim-copy .portal-claim-review-card {
    margin-top: 15px;
}

.portal-claim-copy .portal-claim-review-heading {
    padding: 11px 14px 10px;
}

.portal-claim-copy .portal-claim-review-card dl div {
    padding: 8px 14px;
}

.portal-claim-copy .portal-claim-privacy-note {
    padding: 8px 14px 9px;
}

.portal-claim-copy .portal-auth-dialog-list {
    margin-top: 14px;
}

.portal-claim-copy .portal-auth-dialog-list li {
    padding: 7px 0;
    font-size: .72rem;
}

.portal-claim-form-wrap {
    padding: 16px;
}

.portal-claim-page .portal-auth-dialog-form {
    padding: 22px 23px;
}

.portal-claim-page .portal-auth-dialog-form-head h2 {
    font-size: 1.58rem;
}

.portal-claim-page .portal-auth-dialog-form-head p {
    margin-bottom: 13px;
}

.portal-claim-page .portal-auth-help {
    margin-top: 11px;
}

.portal-claim-page .portal-login-field > .text-danger {
    display: block;
    max-width: 100%;
    margin-top: 1px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-claim-page.is-code-step .portal-login-field {
    gap: 4px;
    margin-bottom: 9px;
}

.portal-claim-page.is-code-step .portal-login-input {
    min-height: 43px;
}

.portal-claim-page.is-code-step .portal-consent-check {
    gap: 9px;
    margin: 8px 0;
    padding: 9px 10px;
    font-size: .67rem;
    line-height: 1.38;
}

.portal-claim-page.is-code-step .portal-login-v2-submit {
    min-height: 44px;
    padding-block: 9px;
}

.portal-claim-page.is-code-step .portal-auth-secondary-action {
    margin-top: 9px;
    padding-top: 5px;
}

.portal-claim-page.is-code-step .portal-auth-help {
    padding-block: 8px;
    font-size: .67rem;
}

@media (min-width: 901px) and (max-height: 1000px) {
    .portal-claim-page {
        align-items: start;
        padding-block: 12px;
    }

    .portal-claim-page .portal-auth-dialog-form {
        padding: 18px 20px;
    }

    .portal-claim-page .portal-auth-dialog-form-head p {
        margin-bottom: 10px;
    }

    .portal-claim-page .portal-claim-delivery-status {
        margin-bottom: 9px;
        padding-block: 8px;
    }

    .portal-claim-page .portal-claim-review-disclosure-copy small {
        display: none;
    }
}

@media (max-width: 900px) {
    .portal-claim-shell {
        grid-template-columns: 1fr;
    }

    .portal-claim-copy {
        padding: 34px 30px;
    }
}

.portal-claim-delivery-status {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px 12px;
    border: 1px solid #b9cce4;
    border-radius: 2px;
    color: #173a64;
    background: #eef5fc;
}

.portal-claim-delivery-status > i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: var(--pre-cobalt);
    background: #fff;
    border: 1px solid #c7d7ea;
}

.portal-claim-delivery-status div {
    display: grid;
    gap: 2px;
}

.portal-claim-delivery-status strong {
    color: var(--pre-ink);
    font-size: .76rem;
}

.portal-claim-delivery-status span {
    color: var(--pre-copy);
    font-size: .7rem;
    line-height: 1.45;
}

.portal-claim-review-disclosure {
    margin: 11px 0 0;
    overflow: hidden;
    border: 1px solid #d8c898;
    border-radius: 2px;
    background: #fffdf7;
}

.portal-claim-review-disclosure > summary {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 7px 10px;
    color: var(--pre-ink);
    cursor: pointer;
    list-style: none;
}

.portal-claim-review-disclosure > summary::-webkit-details-marker {
    display: none;
}

.portal-claim-review-disclosure > summary:hover,
.portal-claim-review-disclosure > summary:focus-visible {
    background: #fff9e9;
}

.portal-claim-review-disclosure-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #dfc477;
    color: #9a6814;
    background: #fff8e5;
}

.portal-claim-review-disclosure-copy {
    display: grid;
    gap: 2px;
}

.portal-claim-review-disclosure-copy strong {
    font-size: .78rem;
    line-height: 1.3;
}

.portal-claim-review-disclosure-copy small {
    color: var(--pre-muted);
    font-size: .67rem;
    line-height: 1.35;
}

.portal-claim-review-disclosure-chevron {
    color: #876522;
    transition: transform .18s ease;
}

.portal-claim-review-disclosure[open] .portal-claim-review-disclosure-chevron {
    transform: rotate(180deg);
}

.portal-claim-review-disclosure > form {
    display: grid;
    gap: 10px;
    padding: 13px;
    border-top: 1px solid #eadcb7;
    background: #fff;
}

.portal-claim-review-submit {
    min-height: 42px;
    border: 1px solid #bb8526;
    border-radius: 2px;
    color: #70490c;
    background: #fff9e9;
    font-size: .76rem;
    font-weight: 800;
}

.portal-claim-review-submit:hover,
.portal-claim-review-submit:focus-visible {
    color: #fff;
    background: #9a6814;
}

@media (max-width: 520px) {
    .portal-claim-review-card dl {
        grid-template-columns: 1fr;
    }

    .portal-claim-review-card dl div {
        border-right: 0;
    }
}

@media (max-width: 900px), (max-height: 850px) {
    .portal-auth-dialog-shell {
        align-items: start;
    }

    .portal-auth-dialog-copy,
    .portal-auth-dialog-form-wrap {
        min-height: auto;
    }
}

.portal-auth-reject-form {
    margin-top: 1rem;
}

.portal-auth-reject-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    min-height: 44px;
    border: 1px solid color-mix(in srgb, var(--portal-danger, #dc3545) 50%, transparent);
    border-radius: 4px;
    background: color-mix(in srgb, var(--portal-danger, #dc3545) 8%, transparent);
    color: var(--portal-danger, #b42318);
    font-weight: 700;
}

.portal-auth-reject-button:hover,
.portal-auth-reject-button:focus-visible {
    background: color-mix(in srgb, var(--portal-danger, #dc3545) 14%, transparent);
    outline: 2px solid color-mix(in srgb, var(--portal-danger, #dc3545) 35%, transparent);
    outline-offset: 2px;
}
