:root {
    --auth-primary: #031a32;
    --auth-primary-light: #0a3d6b;
    --auth-accent: #9f0b16;
    --auth-accent-dark: #760812;
    --auth-background: #f4f6fa;
    --auth-border: #dde3ec;
    --auth-muted: #667085;
    --auth-danger: #dc3545;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--auth-background);
    color: #101828;
}

.auth-page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.auth-container {
    display: grid;
    grid-template-columns: minmax(420px, 46%) 1fr;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

/*
 * Panel institucional Web.
 * Usa el mismo estadio que CACHMobile y una capa azul marino
 * semitransparente para conservar contraste y legibilidad.
 */
.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(30px, 5vh, 64px) clamp(36px, 4vw, 64px);
    color: #ffffff;
    background-color: var(--auth-primary);
    background-image: url('/images/cach-login-stadium-bg.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

    .auth-brand-panel::before {
        position: absolute;
        inset: 0;
        z-index: 0;
        content: "";
        background:
            linear-gradient(
                180deg,
                rgba(3, 26, 50, 0.78) 0%,
                rgba(3, 26, 50, 0.62) 46%,
                rgba(1, 16, 31, 0.84) 100%
            );
    }

    .auth-brand-panel::after {
        position: absolute;
        inset: 0;
        z-index: 0;
        content: "";
        pointer-events: none;
        background:
            linear-gradient(
                90deg,
                rgba(1, 16, 31, 0.18),
                transparent 42%,
                rgba(1, 16, 31, 0.12)
            );
    }

.auth-brand-content,
.auth-brand-footer {
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    display: grid;
    width: 132px;
    height: 132px;
    margin-bottom: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    background: rgba(1, 16, 31, 0.38);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(8px);
}

    .auth-brand-logo img {
        width: 116px;
        height: 116px;
        object-fit: contain;
    }

.auth-eyebrow,
.auth-form-eyebrow {
    display: block;
    margin-bottom: 18px;
    color: var(--auth-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-brand-panel .auth-eyebrow {
    color: #ff3a48;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.auth-brand-panel h1 {
    max-width: 560px;
    margin-bottom: 18px;
    font-size: clamp(2rem, 3.1vw, 3.6rem);
    font-weight: 800;
    line-height: 1.04;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.34);
}

.auth-brand-panel > .auth-brand-content > p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.98rem;
    line-height: 1.65;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
}

.auth-feature-list {
    display: grid;
    gap: 18px;
    margin-top: 54px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.auth-feature-icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: #ff4652;
    background: rgba(1, 16, 31, 0.48);
    backdrop-filter: blur(6px);
}

.auth-brand-footer {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.85rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.34);
}

.auth-form-panel {
    display: grid;
    padding: clamp(24px, 4vh, 48px);
    place-items: center;
    background:
        radial-gradient(
            circle at 50% 45%,
            rgba(10, 61, 107, 0.04),
            transparent 52%
        ),
        var(--auth-background);
}

.auth-card {
    width: min(100%, 480px);
    padding: 44px;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.1);
}

.auth-card-header {
    margin-bottom: 32px;
}

    .auth-card-header h2 {
        margin-bottom: 10px;
        color: #101828;
        font-size: 2rem;
        font-weight: 800;
    }

    .auth-card-header p {
        margin: 0;
        color: var(--auth-muted);
    }

.auth-mobile-logo {
    display: none;
}

.auth-form {
    display: grid;
    gap: 22px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

    .auth-field .form-label {
        margin: 0;
        color: #344054;
        font-size: 0.9rem;
        font-weight: 650;
    }

.auth-input-group {
    position: relative;
}

    .auth-input-group .form-control {
        min-height: 52px;
        padding-left: 46px;
        padding-right: 46px;
        border-color: var(--auth-border);
        border-radius: 12px;
    }

        .auth-input-group .form-control:focus {
            border-color: var(--auth-accent);
            box-shadow: 0 0 0 0.2rem rgba(159, 11, 22, 0.12);
        }

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    color: #98a2b3;
    transform: translateY(-50%);
}

.auth-input-group:focus-within .auth-input-icon,
.auth-input-group:focus-within .auth-password-toggle {
    color: var(--auth-accent);
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    z-index: 2;
    padding: 6px;
    border: 0;
    color: #667085;
    background: transparent;
    transform: translateY(-50%);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.88rem;
}

.auth-forgot-link {
    color: var(--auth-primary);
    font-weight: 650;
    text-decoration: none;
}

.auth-forgot-link:hover {
    color: var(--auth-accent);
}

.form-check-input:checked {
    border-color: var(--auth-accent);
    background-color: var(--auth-accent);
}

.auth-submit-button {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-color: var(--auth-accent);
    border-radius: 12px;
    color: #ffffff;
    background: var(--auth-accent);
    box-shadow: 0 12px 28px rgba(159, 11, 22, 0.18);
    font-weight: 700;
}

.auth-submit-button:hover,
.auth-submit-button:active {
    border-color: var(--auth-accent-dark) !important;
    color: #ffffff !important;
    background: var(--auth-accent-dark) !important;
}

.auth-submit-button:focus,
.auth-submit-button:focus-visible {
    border-color: var(--auth-accent);
    color: #ffffff;
    background: var(--auth-accent);
    box-shadow: 0 0 0 0.25rem rgba(159, 11, 22, 0.18);
}

.auth-validation-summary:empty {
    display: none;
}

.auth-status-page {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.auth-status-card {
    width: min(100%, 520px);
    padding: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.1);
}

.auth-status-icon {
    display: grid;
    width: 78px;
    height: 78px;
    margin: 0 auto 24px;
    place-items: center;
    border-radius: 22px;
    font-size: 2rem;
}

    .auth-status-icon.is-danger {
        color: var(--auth-danger);
        background: rgba(220, 53, 69, 0.1);
    }

.auth-status-card h1 {
    margin-bottom: 14px;
    font-weight: 800;
}

.auth-status-card p {
    margin-bottom: 28px;
    color: var(--auth-muted);
}

.auth-status-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}


/*
 * Ajuste vertical para laptops y pantallas de menor altura.
 * El objetivo es conservar todo el login dentro del viewport
 * sin mostrar scroll en tamaños de escritorio habituales.
 */
@media (min-width: 992px) and (max-height: 900px) {
    .auth-brand-panel {
        padding: 28px 44px;
    }

    .auth-brand-logo {
        width: 116px;
        height: 116px;
        margin-bottom: 20px;
        border-radius: 22px;
    }

    .auth-brand-logo img {
        width: 104px;
        height: 104px;
    }

    .auth-eyebrow,
    .auth-form-eyebrow {
        margin-bottom: 14px;
        font-size: 0.7rem;
    }

    .auth-brand-panel h1 {
        max-width: 520px;
        margin-bottom: 12px;
        font-size: clamp(1.9rem, 3vw, 3.15rem);
        line-height: 1.02;
    }

    .auth-brand-panel > .auth-brand-content > p {
        max-width: 540px;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .auth-feature-list {
        gap: 10px;
        margin-top: 32px;
    }

    .auth-feature {
        gap: 12px;
        font-size: 0.92rem;
    }

    .auth-feature-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .auth-brand-footer {
        font-size: 0.78rem;
    }

    .auth-form-panel {
        padding: 24px 34px;
    }

    .auth-card {
        width: min(100%, 470px);
        padding: 30px 34px;
        border-radius: 20px;
    }

    .auth-card-header {
        margin-bottom: 22px;
    }

    .auth-card-header h2 {
        margin-bottom: 7px;
        font-size: 1.75rem;
    }

    .auth-card-header p {
        font-size: 0.92rem;
    }

    .auth-form {
        gap: 16px;
    }

    .auth-field {
        gap: 6px;
    }

    .auth-input-group .form-control {
        min-height: 48px;
    }

    .auth-submit-button {
        min-height: 48px;
    }
}

@media (min-width: 992px) and (max-height: 720px) {
    .auth-brand-panel {
        padding: 20px 36px;
    }

    .auth-brand-logo {
        width: 94px;
        height: 94px;
        margin-bottom: 14px;
    }

    .auth-brand-logo img {
        width: 84px;
        height: 84px;
    }

    .auth-brand-panel h1 {
        max-width: 480px;
        margin-bottom: 8px;
        font-size: clamp(1.7rem, 2.7vw, 2.65rem);
    }

    .auth-brand-panel > .auth-brand-content > p {
        font-size: 0.86rem;
        line-height: 1.4;
    }

    .auth-feature-list {
        gap: 7px;
        margin-top: 20px;
    }

    .auth-feature {
        font-size: 0.86rem;
    }

    .auth-feature-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .auth-form-panel {
        padding: 18px 28px;
    }

    .auth-card {
        padding: 24px 30px;
    }

    .auth-card-header {
        margin-bottom: 16px;
    }

    .auth-card-header h2 {
        font-size: 1.55rem;
    }

    .auth-form {
        gap: 12px;
    }

    .auth-input-group .form-control,
    .auth-submit-button {
        min-height: 44px;
    }
}

@media (max-width: 991.98px) {
    .auth-body {
        overflow: auto;
    }

    .auth-page,
    .auth-container {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 24px;
    }

    .auth-mobile-logo {
        display: block;
        margin-bottom: 24px;
        text-align: center;
    }

        .auth-mobile-logo img {
            width: 110px;
            height: 110px;
            object-fit: contain;
        }
}

@media (max-width: 575.98px) {
    .auth-form-panel {
        align-items: stretch;
        padding: 0;
    }

    .auth-card {
        min-height: 100vh;
        padding: 36px 24px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-options,
    .auth-status-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
