.auth-portal {
    --auth-navy: #07183d;
    --auth-blue: #123f84;
    --auth-cyan: #43c9ed;
    --auth-text: #14213d;
    --auth-muted: #68738a;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(420px, 1fr);
    background: #fff;
}

.auth-portal__brand {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(32px, 4vw, 64px);
    color: #fff;
    background:
        radial-gradient(circle at 8% 18%, rgba(67, 201, 237, .2), transparent 25%),
        linear-gradient(145deg, #061630 0%, var(--auth-navy) 50%, var(--auth-blue) 100%);
}

.auth-portal__brand::before,
.auth-portal__brand::after {
    position: absolute;
    content: "";
    width: 390px;
    height: 390px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
}

.auth-portal__brand::before { top: -190px; right: -115px; }
.auth-portal__brand::after { bottom: -250px; left: -170px; }

.auth-portal__logo {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}

.auth-portal__logo img { display: block; width: 185px; max-height: 56px; object-fit: contain; }

.auth-portal__message {
    position: relative;
    z-index: 1;
    width: min(680px, 90%);
    margin: auto;
    text-align: center;
}

.auth-portal__illustration {
    width: min(390px, 58%);
    max-height: 330px;
    margin-bottom: 24px;
    filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .2));
}

.auth-portal__message h2 {
    margin: 0 0 16px;
    color: #fff;
    font-size: clamp(2.1rem, 4vw, 3.8rem);
    font-weight: 500;
    letter-spacing: -.04em;
}

.auth-portal__message p {
    max-width: 620px;
    margin: 0 auto;
    color: rgba(255, 255, 255, .78);
    font-size: clamp(1rem, 1.5vw, 1.28rem);
    line-height: 1.65;
}

.auth-portal__form-side {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 5vw, 76px);
    background: #fff;
}

.auth-portal__form { width: 100%; max-width: 480px; }
.auth-portal__form--wide { max-width: 540px; }
.auth-portal__eyebrow { margin-bottom: 8px; color: var(--auth-blue); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .74rem; }
.auth-portal__title { margin-bottom: 8px; color: var(--auth-text); font-size: clamp(1.8rem, 2.4vw, 2.25rem); font-weight: 700; letter-spacing: -.035em; }
.auth-portal__subtitle { margin-bottom: 34px; color: var(--auth-muted); font-size: 1rem; line-height: 1.55; }

.auth-portal .form-label { margin-bottom: 8px; color: var(--auth-text); font-size: .95rem; font-weight: 600; }
.auth-portal .form-control {
    min-height: 52px;
    padding: 12px 15px;
    border: 1px solid #d8dfeb;
    border-radius: 10px;
    color: var(--auth-text);
    background: #fff;
    box-shadow: none;
}
.auth-portal .form-control:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 4px rgba(18, 63, 132, .1); }
.auth-portal__link { color: var(--auth-navy); font-weight: 600; text-decoration: none; }
.auth-portal__link:hover { color: var(--auth-blue); text-decoration: underline; }
.auth-portal__primary {
    min-height: 52px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--auth-navy);
    font-weight: 600;
    transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.auth-portal__primary:hover { color: #fff; background: #0d2c64; box-shadow: 0 10px 24px rgba(7, 24, 61, .2); transform: translateY(-1px); }
.auth-portal__primary:disabled { opacity: .6; transform: none; }
.auth-portal__back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; color: var(--auth-navy); font-weight: 600; text-decoration: none; }
.auth-portal__back:hover { color: var(--auth-blue); }
.auth-portal__footer { margin-top: 28px; color: var(--auth-muted); text-align: center; }
.auth-portal .btn-cu { border-radius: 9px; }
.auth-portal .cf-turnstile { max-width: 100%; overflow: hidden; }

@media (max-width: 991.98px) {
    .auth-portal { display: block; }
    .auth-portal__brand { min-height: 210px; padding: 24px; }
    .auth-portal__logo img { width: 155px; }
    .auth-portal__message { margin: auto; }
    .auth-portal__illustration { display: none; }
    .auth-portal__message h2 { margin-bottom: 8px; font-size: 2rem; }
    .auth-portal__message p { font-size: .95rem; }
    .auth-portal__form-side { min-height: calc(100vh - 210px); padding: 44px 24px; align-items: flex-start; }
}

@media (max-width: 575.98px) {
    .auth-portal__brand { min-height: 180px; }
    .auth-portal__message h2 { font-size: 1.65rem; }
    .auth-portal__message p { display: none; }
    .auth-portal__form-side { min-height: calc(100vh - 180px); padding: 34px 20px; }
    .auth-portal__subtitle { margin-bottom: 26px; }
}

/* Adaptación de las vistas de autenticación existentes al diseño institucional. */
.auth-portal-legacy { min-height: 100vh; background: #fff; }
.auth-portal-legacy > .position-relative { background: #fff !important; }
.auth-portal-legacy > .position-relative > .position-relative { min-height: 100vh; }
.auth-portal-legacy > .position-relative > .position-relative > .row { min-height: 100vh; margin: 0; }
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child {
    position: relative;
    overflow: hidden;
    display: flex;
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    flex-direction: column;
    min-height: 100vh;
    padding: clamp(32px, 4vw, 64px) !important;
    color: #fff;
    background:
        radial-gradient(circle at 8% 18%, rgba(67, 201, 237, .2), transparent 25%),
        linear-gradient(145deg, #061630 0%, #07183d 52%, #123f84 100%);
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child::before,
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child::after {
    position: absolute;
    content: "";
    width: 390px;
    height: 390px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child::before { top: -190px; right: -115px; }
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child::after { bottom: -250px; left: -170px; }
.auth-portal-legacy .logo-img {
    z-index: 2;
    align-self: flex-start;
    width: auto !important;
    padding: 10px 14px !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}
.auth-portal-legacy .logo-img img { width: 185px; max-height: 56px; object-fit: contain; }
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div {
    position: relative;
    z-index: 1;
    display: flex !important;
    flex: 1;
    height: auto !important;
    min-height: 0;
    align-items: center;
    justify-content: center;
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div::before,
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div::after {
    position: absolute;
    left: 50%;
    width: min(680px, 90%);
    text-align: center;
    transform: translate(-50%, -50%);
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div::before {
    top: calc(50% + 155px);
    content: "Conecta. Participa. Crece.";
    color: #fff;
    font-size: clamp(2.1rem, 3.6vw, 3.6rem);
    font-weight: 500;
    letter-spacing: -.04em;
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div::after {
    top: calc(50% + 230px);
    content: "Gestiona tus solicitudes y trámites en un espacio digital simple, seguro y conectado con tu comunidad.";
    color: rgba(255, 255, 255, .78);
    font-size: 1.1rem;
    line-height: 1.65;
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div img {
    width: min(390px, 58%) !important;
    max-height: 390px;
    margin-top: -100px;
    filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .2));
}
.auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:last-child {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    min-height: 100vh;
    padding: 0;
    background: #fff;
}
.auth-portal-legacy .authentication-login,
.auth-portal-legacy .card { background: #fff !important; }
.auth-portal-legacy .auth-max-width { width: 100% !important; max-width: 520px !important; padding: clamp(32px, 4vw, 68px) !important; }
.auth-portal-legacy .card .auth-max-width { max-width: 560px !important; }
.auth-portal-legacy .card-body { padding: clamp(32px, 4vw, 68px) !important; }
.auth-portal-legacy h2 { color: #14213d; font-size: clamp(1.8rem, 2.4vw, 2.25rem) !important; letter-spacing: -.035em; }
.auth-portal-legacy h2 + p,
.auth-portal-legacy .mb-5 p { color: #68738a; line-height: 1.55; }
.auth-portal-legacy .form-label,
.auth-portal-legacy .form-group label { margin-bottom: 8px; color: #14213d; font-size: .95rem; font-weight: 600; }
.auth-portal-legacy .form-control { min-height: 52px; padding: 12px 15px; border: 1px solid #d8dfeb; border-radius: 10px; box-shadow: none; }
.auth-portal-legacy .form-control:focus { border-color: #123f84; box-shadow: 0 0 0 4px rgba(18, 63, 132, .1); }
.auth-portal-legacy .btn-primary { min-height: 52px; border: 0; border-radius: 9px !important; background: #07183d; font-weight: 600; }
.auth-portal-legacy .btn-primary:hover { background: #0d2c64; box-shadow: 0 10px 24px rgba(7, 24, 61, .2); }
.auth-portal-legacy .btn-secondary,
.auth-portal-legacy .bg-primary-subtle { min-height: 48px; border: 0; border-radius: 9px; color: #07183d !important; background: #eef3fa !important; font-weight: 600; }
.auth-portal-legacy a.text-primary { color: #07183d !important; }
.auth-portal-legacy .btn-cu { border-radius: 9px; }

@media (max-width: 1199.98px) {
    .auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child { flex-basis: 58.333333%; max-width: 58.333333%; }
    .auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:last-child { flex-basis: 41.666667%; max-width: 41.666667%; }
}

@media (max-width: 991.98px) {
    .auth-portal-legacy > .position-relative > .position-relative > .row { display: block; }
    .auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child {
        display: flex !important;
        max-width: none;
        min-height: 210px;
        padding: 24px !important;
    }
    .auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:first-child > div { display: none !important; }
    .auth-portal-legacy > .position-relative > .position-relative > .row > [class*="col-"]:last-child { max-width: none; min-height: calc(100vh - 210px); }
    .auth-portal-legacy .authentication-login,
    .auth-portal-legacy .card { min-height: calc(100vh - 210px) !important; }
    .auth-portal-legacy .auth-max-width { max-width: 600px !important; margin: 0 auto; }
}
