:root {
    --auth-primary: var(--app-primary);
    --auth-primary-hover: var(--app-primary-hover);
    --auth-title: var(--app-title);
    --auth-text-muted: var(--app-text-muted);
    --auth-input-bg: var(--app-surface);
    --auth-input-border: var(--app-campo-borde);
    --auth-danger: var(--app-danger);
    --auth-danger-bg: var(--app-danger-soft);
    --auth-success: var(--app-success);
    --auth-success-bg: var(--app-success-soft);
    --auth-radius: var(--app-radio-tarjeta);
}

html, body {
    min-height: 100%;
}

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--app-text);
    background-color: #0f2a55;
    position: relative;
}

.auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(8, 27, 61, 0.78), rgba(18, 61, 130, 0.62)),
        url("../images/hospital-fachada.jpg") center / cover no-repeat;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--auth-radius);
    box-shadow: var(--app-sombra-alta);
    padding: 32px 32px 24px;
}

.auth-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    max-height: 95px;
    margin: 0 auto 16px;
    object-fit: contain;
}

.auth-title {
    color: var(--auth-title);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.35;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--app-border);
}

.auth-section-title {
    color: var(--auth-title);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    margin: -8px 0 16px;
}

.auth-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--app-text);
    margin-bottom: 6px;
}

.auth-input {
    position: relative;
}

.auth-input .form-control {
    background-color: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: var(--app-radio);
    min-height: var(--app-control-alto);
    padding: 9px 14px 9px 42px;
    font-size: 0.95rem;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.auth-input .form-control.auth-has-toggle {
    padding-right: 44px;
}

.auth-input .form-control:focus {
    background-color: var(--auth-input-bg);
    border-color: var(--auth-primary);
    box-shadow: var(--app-foco);
}

.auth-input .form-control:-webkit-autofill,
.auth-input .form-control:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--app-text);
    box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
}
.auth-input .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--app-text);
    box-shadow: 0 0 0 1000px var(--auth-input-bg) inset, var(--app-foco);
}

.auth-input .form-control.input-validation-error {
    border-color: var(--auth-danger);
    background-color: #fff;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-text-soft);
    font-size: 1.1rem;
    pointer-events: none;
}

.auth-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--app-text-soft);
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1;
    font-size: 1.1rem;
}

.auth-toggle-password:hover,
.auth-toggle-password:focus-visible {
    color: var(--auth-primary);
    outline: none;
    background-color: rgba(26, 95, 208, 0.08);
}

.auth-field-error {
    display: block;
    color: var(--auth-danger);
    font-size: 0.82rem;
    margin-top: 5px;
}

.auth-field-error:empty {
    display: none;
}

.auth-btn {
    background-color: var(--auth-primary);
    border: 0;
    color: #fff;
    font-weight: 600;
    min-height: var(--app-control-alto);
    padding: 9px 12px;
    border-radius: var(--app-radio);
    font-size: 1rem;
    transition: background-color .15s ease, transform .05s ease;
}

.auth-btn:hover,
.auth-btn:focus {
    background-color: var(--auth-primary-hover);
    color: #fff;
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    box-shadow: var(--app-foco);
}

.auth-footer-link {
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    margin: 20px 0 0;
}

.auth-footer-link a {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 0;
    border-radius: var(--app-radio);
    font-size: 0.9rem;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.auth-alert > .bi {
    font-size: 1.1rem;
    line-height: 1.2;
}

.auth-alert-danger {
    background-color: var(--auth-danger-bg);
    color: var(--auth-danger);
}

.auth-alert-success {
    background-color: var(--auth-success-bg);
    color: var(--auth-success);
}

.auth-countdown {
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px 20px 20px;
    }

    .auth-title {
        font-size: 1.1rem;
    }
}

.auth-help {
    color: var(--auth-text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.auth-help-center {
    text-align: center;
    font-size: 0.82rem;
    margin: 8px 0 0;
}

.auth-body::before {
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1px, transparent 0) 0 0 / 22px 22px,
        radial-gradient(1200px 600px at 10% 0%, rgba(56, 189, 248, 0.18), transparent 60%),
        linear-gradient(135deg, rgba(6, 22, 52, 0.92), rgba(18, 61, 130, 0.86) 60%, rgba(26, 95, 208, 0.82)),
        url("../images/hospital-fachada.jpg") center / cover no-repeat;
}

.auth-card {
    max-width: 960px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(2, 10, 30, 0.45), 0 8px 20px rgba(2, 10, 30, 0.2);
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    color: #fff;
    background: linear-gradient(160deg, #0b2a5b 0%, #123d7e 55%, #1a5fd0 120%);
    overflow: hidden;
}
.auth-brand::before, .auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}
.auth-brand::before { width: 340px; height: 340px; top: -120px; right: -140px; }
.auth-brand::after { width: 260px; height: 260px; bottom: -110px; left: -90px; background: rgba(56, 189, 248, 0.12); }
.auth-brand > * { position: relative; z-index: 1; }

.auth-logo-marco {
    display: inline-block;
    padding: 12px 16px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}
.auth-logo { max-width: 190px; max-height: 84px; margin: 0; }
.auth-title { color: #fff; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; }
.auth-title span:nth-child(2) { color: #bfe3ff; }
.auth-subtitle {
    margin: 10px 0 0;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 500;
}
.auth-iconos { display: flex; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.auth-iconos li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 1.2rem;
    color: #dbeafe;
}

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px 40px; }
.auth-section-title { margin: 0 0 22px; text-align: left; font-size: 1.45rem; font-weight: 800; color: var(--auth-title); }
.auth-section-title::after {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin-top: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--app-primary), var(--app-accent));
}
.auth-label { color: var(--app-text); }
.auth-input .form-control { min-height: 46px; border-radius: 12px; }
.auth-input-icon { color: var(--app-primary); opacity: 0.75; }
.auth-btn {
    min-height: 48px;
    border-radius: 12px;
    background-image: linear-gradient(180deg, #2b70e2 0%, var(--app-primary) 100%);
    box-shadow: 0 8px 18px rgba(26, 95, 208, 0.3);
}
.auth-btn:hover, .auth-btn:focus { background-image: linear-gradient(180deg, #1f62d4 0%, var(--app-primary-hover) 100%); }
.auth-btn:disabled { background-image: none; box-shadow: none; }
.auth-alert { border-radius: 12px; border-left: 4px solid currentColor; }
.auth-footer-link { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--app-border); }

@media (max-width: 860px) {
    .auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .auth-brand { padding: 30px 24px 26px; }
    .auth-logo-marco { margin-bottom: 14px; padding: 8px 12px; }
    .auth-logo { max-height: 60px; }
    .auth-title { font-size: 1.15rem; }
    .auth-iconos { display: none; }
    .auth-form { padding: 28px 24px 26px; }
}

.auth-body { font-family: var(--app-fuente); font-size: 1rem; }
.auth-input .form-control { font-size: 1rem; }

@media (min-width: 861px) {
    .auth-card { min-height: 600px; }
    .auth-brand { padding: 64px 40px; }
    .auth-form { padding: 64px 48px 56px; }
    .auth-form .auth-section-title { margin-bottom: 30px; }
    .auth-form .mb-3 { margin-bottom: 1.4rem !important; }
}

.auth-ayuda { margin-top: 6px; font-size: 0.8rem; line-height: 1.35; color: var(--app-text-muted, #5b6678); }
.auth-ayuda strong { color: var(--auth-title, #0b2a5b); }
.auth-ayuda-error { color: var(--auth-danger, #b91c1c); }
.auth-ayuda-error strong { color: inherit; }
.auth-ayuda-ok { color: #15803d; }
.auth-aviso-pegar { margin-top: 4px; font-size: 0.8rem; font-weight: 600; color: #b45309; }
.auth-aviso-pegar:empty { display: none; }

.auth-codigo { font-family: Consolas, "Roboto Mono", monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.5em; }
