.auth-body {
    --auth-accent: #1062a3;
    --auth-accent-hover: #0061a0;
    --auth-accent-dark: #004571;
    --auth-accent-soft: #f2f4f8;
    --auth-ink: #0f172a;
    --auth-muted: #808191;
    --auth-border: #e2e8f0;
    --auth-radius: 8px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #fff;
    color: var(--auth-ink);
    font-family: "Exo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/*
 * A single padded container holds the header, the form and the footer, so all
 * three keep one grid at every width, as on eCampus. 100dvh keeps the footer on
 * screen on mobile browsers, where 100vh also counts the address bar.
 */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.auth-header {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/*
 * The Figma lockup is 42x56 with a 32px wordmark; scaled to 51px so the header
 * block is exactly as tall as the eCampus one, proportions untouched.
 */
.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #111827;
    font-size: 29px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
}

.auth-brand strong {
    font-weight: 800;
}

.auth-brand:hover,
.auth-brand:focus {
    color: #111827;
    text-decoration: none;
}

.auth-brand-logo {
    width: 38.25px;
    height: 51px;
    object-fit: contain;
}

.auth-language {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-align: end;
}

.auth-language:hover,
.auth-language:focus {
    color: var(--auth-muted);
}

.auth-language-flag {
    width: 22px;
    height: 16px;
    flex: none;
}

/* Below md the form sits right under the header; from md it is centred in the
   leftover height, matching the eCampus `md:grow` main. */
.auth-main {
    width: 100%;
    max-width: 516px;
    margin: 0 auto;
    padding: 32px 0 0;
}

@media (min-width: 768px) {
    .auth-page {
        padding: 28px 49px;
    }

    .auth-main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 32px 0;
    }
}

.auth-footer {
    margin-top: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3.5px 17.5px;
    color: var(--auth-ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.43;
    text-align: center;
}

.auth-footer p {
    margin: 0;
}

.auth-footer a {
    color: var(--auth-accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-footer a:hover,
.auth-footer a:focus {
    color: var(--auth-accent-dark);
}

.auth-footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3.5px 17.5px;
}

.auth-panel {
    text-align: center;
}

/* Recovery pages mirror the eCampus layout: left-aligned with a back link on top. */
.auth-panel--left {
    text-align: left;
}

.auth-panel--left .auth-panel-title,
.auth-panel--left .auth-panel-subtitle {
    margin-left: 0;
    margin-right: 0;
}

/* Only the sign-in heading is width-capped on eCampus. */
.auth-panel--left .auth-panel-title {
    max-width: none;
}

/* eCampus spaces the recovery description with py-4 and opens the form at my-6. */
.auth-panel--left .auth-panel-subtitle {
    margin-top: 16px;
    margin-bottom: 40px;
}

/*
 * The eCampus back link is a full-width flex item with centred content; a flex
 * wrapper reproduces that without the extra leading an inline box would add.
 */
.auth-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.auth-nav-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.auth-nav-link:hover,
.auth-nav-link:focus {
    color: var(--auth-ink);
    text-decoration: none;
}

.auth-panel-title {
    max-width: 400px;
    margin: 0 auto;
    color: var(--auth-ink);
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
}

/*
 * eCampus grows its headings only from lg, and caps the sign-in one lower
 * than the recovery ones (text-4xl vs text-5xl).
 */
@media (min-width: 1024px) {
    .auth-panel-title {
        font-size: 30px;
        line-height: 40px;
    }

    .auth-panel--left .auth-panel-title {
        font-size: 36px;
    }
}

.auth-panel-subtitle {
    margin: 12px auto 28px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 20px;
    /* The success step interpolates a user-supplied identifier. */
    overflow-wrap: anywhere;
}

.auth-alerts {
    text-align: left;
}

.login-kpi-id {
    min-height: 54px;
}

.login-kpi-id .kpi_id_button,
.login-auth-button {
    min-height: 54px;
    border-radius: var(--auth-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

/*
 * The KPI ID widget paints itself from data-color="brand"; this only backs it up
 * with the same blue so the button never falls back to an unbranded colour.
 */
.login-kpi-id .kpi_id_button {
    background-color: var(--auth-accent);
}

.login-kpi-unavailable {
    border: 0;
    background: var(--auth-accent);
    color: #fff;
    opacity: 0.65;
}

.login-google-button {
    margin-top: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
}

.login-google-button:hover,
.login-google-button:focus {
    border-color: #9ca3af;
    background: #f9fafb;
    color: #111827;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 20px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e5e7ef;
}

.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 13px;
}

.auth-form .form-control {
    display: block;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    padding: 7px 10px;
    color: var(--auth-ink);
    font-size: 13px;
    line-height: 20px;
    box-shadow: none;
}

.auth-form .form-control:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(16, 98, 163, 0.14);
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .form-control {
    padding-right: 42px;
}

/* The recovery link owns the gap under the password field, so the group drops its own. */
.auth-password-wrap .form-group {
    margin-bottom: 0;
}

.auth-password-toggle {
    position: absolute;
    top: 23px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-muted);
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
    color: var(--auth-accent);
    outline: 0;
}

.login-recovery {
    margin: 7px 0 36px;
    font-size: 13px;
    line-height: 18.57px;
    text-align: right;
}

.login-recovery-link {
    color: var(--auth-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 18.57px;
}

.login-recovery-link:hover,
.login-recovery-link:focus {
    color: var(--auth-accent-dark);
}

.auth-submit {
    display: block;
    width: 100%;
    min-height: 56px;
    border: 1px solid #c7c8d5;
    border-radius: var(--auth-radius);
    padding: 15px;
    background: #fff;
    color: #40414d;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.auth-submit:hover,
.auth-submit:focus {
    border-color: var(--auth-accent);
    background: var(--auth-accent-soft);
    color: var(--auth-accent-dark);
}

.auth-submit:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* The filled counterpart of the eCampus primary button, used on the recovery flow. */
.auth-submit--primary {
    border-color: var(--auth-accent);
    background: var(--auth-accent);
    color: #fff;
}

.auth-submit--primary:hover,
.auth-submit--primary:focus {
    border-color: var(--auth-accent-hover);
    background: var(--auth-accent-hover);
    color: #fff;
}

.auth-submit--primary:disabled {
    opacity: 0.4;
}

.auth-back {
    margin-top: 24px;
    text-align: center;
}

.auth-resend {
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 20px;
}

.auth-dev-link {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 18.57px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-back-link {
    color: var(--auth-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 18.57px;
}

.auth-back-link:hover,
.auth-back-link:focus {
    color: var(--auth-accent-dark);
}

.login-registration {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

.login-support {
    margin-top: 36px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    gap: 16px;
}

/* From the eCampus sm breakpoint the three links stop stretching. */
@media (min-width: 640px) {
    .login-support {
        grid-template-columns: repeat(3, minmax(0, 136px));
        gap: 24px;
    }
}

.login-support-link {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: var(--auth-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 18.57px;
    text-align: center;
}

.login-support-icon {
    width: 32px;
    height: 32px;
    flex: none;
}

.login-support-link:hover,
.login-support-link:focus {
    color: var(--auth-accent-dark);
}

.auth-panel .invalid-feedback {
    margin: 5px 0 0;
    color: #b42318;
    font-size: 13px;
    line-height: 18.57px;
}

.auth-panel .form-control.is-invalid {
    border-color: #b42318;
    background-image: none;
}

.auth-panel .alert {
    border-radius: var(--auth-radius);
    text-align: left;
}

/* Flash messages ship their own Bootstrap buttons; keep them on the auth palette. */
.auth-panel .alert .btn-primary {
    border-color: var(--auth-accent);
    background: var(--auth-accent);
}

.auth-panel .alert .btn-primary:hover,
.auth-panel .alert .btn-primary:focus {
    border-color: var(--auth-accent-dark);
    background: var(--auth-accent-dark);
}

.auth-panel-title + .auth-alerts {
    margin-top: 24px;
}

/* Below the eCampus md breakpoint only the flag is shown, as there. */
@media (max-width: 767.98px) {
    .auth-language span {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-header {
        flex-wrap: wrap;
    }

    .auth-brand {
        font-size: 1.375rem;
    }

    .auth-brand-logo {
        width: 30px;
        height: 40px;
    }

    .auth-footer {
        gap: 3.5px 14px;
    }

}
