:root {
    --login-navy: #0f1c35;
    --login-ink: #172554;
    --login-border: #d8e3f1;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    background: #eef4fb;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.login-shell {
    min-height: 100vh;
    padding: 0;
}
.login-frame {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}
.login-hero {
    position: relative;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(10, 23, 49, 0.18) 0%, rgba(10, 23, 49, 0.68) 100%),
        linear-gradient(135deg, rgba(10, 23, 49, 0.42) 0%, rgba(18, 52, 120, 0.28) 100%),
        url('../img/login-hero-puente.jpg') center center / cover no-repeat;
}
.login-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(147, 197, 253, 0.12), transparent 45%),
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.25), transparent 30%);
    pointer-events: none;
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem 3.25rem;
    background: linear-gradient(180deg, #f9fbfe 0%, #f2f7fc 100%);
}
.login-panel-inner {
    width: 100%;
    max-width: 430px;
}
.login-brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2.25rem;
}
.login-brand {
    width: min(100%, 408px);
    height: auto;
    margin-bottom: 0.55rem;
    filter: brightness(0) saturate(100%) invert(16%) sepia(52%) saturate(1136%) hue-rotate(191deg) brightness(92%) contrast(97%);
}
.login-subbrand {
    width: min(100%, 168px);
    height: auto;
    margin-bottom: 2.8rem;
    filter: brightness(0) saturate(100%) invert(16%) sepia(52%) saturate(1136%) hue-rotate(191deg) brightness(92%) contrast(97%);
    opacity: 0.9;
}
.login-title {
    margin: 0;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--login-ink);
}
.login-field {
    margin-bottom: 1.15rem;
}
.login-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.01em;
}
.login-input {
    width: 100%;
    height: 58px;
    padding: 0 1rem;
    border: 1px solid var(--login-border);
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.login-input:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.45);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.login-alert {
    margin-bottom: 1.25rem;
    border: 1px solid rgba(220, 38, 38, 0.14);
    border-radius: 16px;
    background: #fff1f2;
    color: #991b1b;
}
.login-maintenance-notice {
    margin-bottom: 1rem;
    padding: .7rem .85rem;
    border: 1px solid rgba(217, 119, 6, .35);
    border-left: 4px solid #d97706;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffe8d5 0%, #ffd7b8 100%);
    color: #7c2d12;
}
.login-maintenance-notice strong {
    display: block;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: .2rem;
}
.login-maintenance-notice span {
    display: block;
    font-size: .84rem;
    line-height: 1.3;
    color: #7c2d12;
}
.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 30px rgba(29, 78, 216, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(29, 78, 216, 0.26);
}
.login-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 18px 34px rgba(29, 78, 216, 0.26);
}
.login-secondary-action {
    margin-top: 1rem;
    text-align: center;
}
.login-secondary-action a {
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}
.login-secondary-action a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.login-info-notice {
    border-color: rgba(37, 99, 235, .24);
    border-left-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
}
.login-info-notice span,
.login-info-notice strong {
    color: #1e3a8a;
}
.password-field-wrap {
    display: flex;
    gap: .5rem;
}
.password-field-wrap .login-input,
.password-field-wrap .form-control {
    flex: 1 1 auto;
}
.password-toggle {
    flex: 0 0 auto;
    min-width: 58px;
    border: 1px solid var(--login-border);
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-weight: 700;
}
.password-policy {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .6rem;
    margin: .35rem 0 .65rem;
    font-size: .82rem;
}
.password-policy > div {
    color: #64748b;
    font-weight: 600;
}
.password-policy > div.is-ok {
    color: #166534;
}
.password-policy [data-policy-icon] {
    display: inline-flex;
    width: 1.05rem;
    justify-content: center;
    font-weight: 900;
}
.login-mfa .login-panel {
    max-height: 100vh;
    overflow-y: auto;
}
.login-totp-setup .login-panel {
    align-items: flex-start;
    padding-top: 1.35rem;
    padding-bottom: 1.35rem;
}
.login-totp-setup .login-panel-inner {
    max-width: 430px;
}
.login-totp-setup .login-brand-wrap {
    margin-bottom: 1rem;
}
.login-totp-setup .login-brand {
    width: min(100%, 330px);
    margin-bottom: 0.25rem;
}
.login-totp-setup .login-subbrand {
    width: min(100%, 132px);
    margin-bottom: 1.25rem;
}
.login-totp-setup .login-title {
    font-size: 1.85rem;
}
.login-totp-setup .login-maintenance-notice {
    margin-bottom: 0.85rem;
}
.login-totp-qr {
    width: 190px;
    height: 190px;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}
@media (max-width: 991.98px) {
    .login-frame {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }
    .login-hero {
        display: none;
    }
    .login-panel {
        min-height: 100vh;
        padding: 2rem 1.5rem;
    }
    .login-mfa .login-panel {
        overflow-y: visible;
    }
}
@media (max-width: 575.98px) {
    body { overflow: auto; }
    .login-brand {
        width: min(100%, 300px);
        margin-bottom: 0.2rem;
    }
    .login-subbrand {
        width: min(100%, 138px);
        margin-bottom: 2.6rem;
    }
    .login-panel {
        padding: 1rem 1.65rem 2rem;
    }
    .login-panel-inner {
        max-width: 330px;
    }
    .login-title {
        font-size: 1.7rem;
    }
    .login-field {
        margin-bottom: 1rem;
    }
    .login-input {
        height: 54px;
        border-radius: 16px;
    }
    .login-submit {
        height: 54px;
        border-radius: 16px;
    }
}
