:root {
    --auth-orange: var(--edu-orange-accent, #ed681f);
    --auth-orange-light: #ff9138;
    --auth-ink: #12213a;
    --auth-muted: #748097;
    --auth-border: #dce3ec;
    --auth-control-bg: #fbfcfe;
    --form-label-control-gap: var(--field-label-control-gap);
    --form-group-gap: 26px;
    --hero-copy-ratio: 75%;
    --hero-decoration-ratio: 25%;
}

* {
    box-sizing: border-box;
}

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

.login-page {
    min-height: 100vh;
    min-height: 100svh;
    background: #f5f6f8;
    color: var(--auth-ink);
    font-family: var(--font-content-auto);
}

html[dir="rtl"] .login-page {
    line-height: 1.75;
}

.login-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr);
    direction: ltr;
    position: relative;
}

.login-art {
    --copy-column: 1;
    --decoration-column: 2;
    isolation: isolate;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(150px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: clamp(20px, 3vw, 44px);
    padding: 46px 7.5% 54px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 24%, rgba(255, 192, 95, .46), transparent 18%),
        radial-gradient(circle at 64% 92%, rgba(237, 105, 41, .35), transparent 28%),
        linear-gradient(130deg, #18263c, #283549);
}

.login-brand {
    grid-column: 1 / -1;
    grid-row: 1;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: #e0eaf5;
    text-decoration: none;
    justify-content: flex-start;
    width: auto;
    height: auto;
    background: none;
}

.login-brand img {
    display: block;
    width: clamp(150px, 18vw, 210px);
    height: auto;
    object-fit: contain;
    visibility: visible;
}

.art-copy {
    grid-column: var(--copy-column);
    grid-row: 2;
    align-self: start;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 650px;
    margin-block-start: clamp(110px, 18vh, 205px);
    text-align: start;
}

.art-eyebrow,
.eyebrow {
    color: var(--edu-orange-logo-bright, #fdb204);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.art-copy :is(h1,h2) {
    margin: 18px 0 17px;
    max-width: 650px;
    font-size: clamp(36px, 2.8vw, 43px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.art-copy p {
    margin: 0;
    max-width: 620px;
    color: #d9e0ea;
    font-size: clamp(14px, 1.08vw, 17px);
    line-height: 1.7;
}

.art-decoration {
    grid-column: var(--decoration-column);
    grid-row: 2;
    align-self: end;
    justify-self: stretch;
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 245px;
    inline-size: min(30rem, 38vw);
    min-height: 310px;
    justify-self: end;
    pointer-events: none;
}

.art-orb {
    position: absolute;
    inset-inline-start: 50%;
    inset-block-start: 50%;
    width: clamp(120px, 10vw, 160px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    letter-spacing: 2px;
    box-shadow: 0 0 0 28px rgba(255, 255, 255, .04), 0 0 0 60px rgba(255, 255, 255, .025);
    transform: translate(-50%, -50%);
}

.login-art-float { position: absolute; z-index: 2; display: grid; place-items: center; filter: drop-shadow(0 1rem 1.2rem rgb(0 0 0 / .28)); }
.login-art-float .visual-artwork { --artwork-size: clamp(5.5rem, 7vw, 7rem) !important; }
.login-art-float--student { inset-block-start: 0; inset-inline-start: 38%; animation: login-art-drift-one 7s ease-in-out infinite; }
.login-art-float--parent { inset-block-start: 37%; inset-inline-end: 0; animation: login-art-drift-two 8.5s ease-in-out -2.5s infinite; }
.login-art-float--staff { inset-block-end: 2%; inset-inline-start: 4%; animation: login-art-drift-three 7.8s ease-in-out -4s infinite; }
@keyframes login-art-drift-one { 0%,100% { transform: translate3d(0,0,0) rotate(-5deg); } 50% { transform: translate3d(.55rem,-.75rem,0) rotate(3deg); } }
@keyframes login-art-drift-two { 0%,100% { transform: translate3d(0,0,0) rotate(4deg); } 50% { transform: translate3d(-.5rem,.7rem,0) rotate(-3deg); } }
@keyframes login-art-drift-three { 0%,100% { transform: translate3d(0,0,0) rotate(-3deg); } 50% { transform: translate3d(.65rem,.5rem,0) rotate(3deg); } }

.login-art-assurances {
    position: absolute;
    z-index: 3;
    inset-inline: 9%;
    inset-block-end: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(18px, 3vw, 42px);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
}

.login-art-assurances > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.login-art-assurances svg {
    inline-size: 25px;
    block-size: 25px;
    fill: none;
    stroke: #ff7b22;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-art-tagline {
    color: #e0eaf5;
    font-size: 12px;
    letter-spacing: normal;
    visibility: visible;
    white-space: normal;
}


.login-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: 92px 42px 46px;
    background: rgba(255, 255, 255, .96);
}

.auth-responsive-bar {
    display: contents;
}

.auth-responsive-bar .responsive-app-bar__leading {
    display: none;
}

.auth-responsive-bar .responsive-app-bar__actions {
    display: contents;
}

.login-tools {
    position: absolute;
    inset-block-start: 28px;
    inset-inline-end: 35px;
    z-index: 3;
    display: flex;
    gap: 13px;
}

.language-control,
.appearance-control {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #fff;
    color: #4d5b70;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.language-control:hover,
.appearance-control:hover {
    border-color: #ee8a43;
    background: #fff8f2;
}

.language-control:focus-visible,
.appearance-control:focus-visible {
    outline: 3px solid rgba(242, 138, 60, .35);
    outline-offset: 2px;
}

.appearance-control:active {
    transform: translateY(1px);
}

.appearance-control svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.language-flag {
    display: block;
    width: 20px;
    height: 14px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .08);
}

.login-card {
    width: min(100%, 490px);
    text-align: start;
}

.login-card h2 {
    margin: 9px 0 5px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.25;
}

.login-card > p {
    margin: 0 0 30px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
}

.recovery-card {
    display: grid;
    gap: 22px;
    padding: 24px;
}

.recovery-form {
    display: grid;
    gap: 18px;
}

.recovery-form .edu-control {
    margin: 0;
}

.auth-back-link,
.auth-button-link {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
}

.auth-success {
    justify-items: stretch;
}

.auth-success__icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    justify-self: center;
    border-radius: 50%;
    background: #e9f8ef;
    color: #18794e;
    font-size: 30px;
    font-weight: 800;
}

.login-portal-intent {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 18px;
    align-items: center;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid #f3bd7c;
    border-radius: 12px;
    background: #fff8ef;
    color: #62390d;
}

.login-portal-intent > span {
    grid-column: 1;
    color: #81501a;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    line-height: 1.4;
    text-transform: uppercase;
}

.login-portal-intent > strong {
    grid-column: 1;
    color: #1b3855;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
}

.login-portal-intent > p {
    grid-column: 1;
    margin: 1px 0 0;
    color: #6f5535;
    font-size: 12px;
    line-height: 1.5;
}

.login-portal-intent > a {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    color: #a5490f;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-portal-intent > a:hover {
    color: #733009;
}

.login-portal-intent > a:focus-visible {
    outline: 3px solid rgba(242, 138, 60, .35);
    outline-offset: 3px;
    border-radius: 3px;
}

.form-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--form-label-control-gap);
    margin: 0 0 var(--form-group-gap);
    text-align: start;
}

.form-label {
    display: block;
    margin: 0;
    color: #445166;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.control-shell {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
}

.form-control {
    display: block;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 13px 16px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: var(--auth-control-bg);
    color: var(--auth-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: start;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control:focus {
    border: 2px solid var(--auth-orange);
    padding: 12px 15px;
    box-shadow: inset 0 0 0 1px rgba(243, 107, 33, .08), 0 0 0 2px rgba(243, 107, 33, .08);
}

.form-control.is-invalid {
    border-color: #cf3f4f;
    box-shadow: inset 0 0 0 1px rgba(207, 63, 79, .08);
}

.login-card .password-control .form-control {
    padding-inline-end: 56px;
}

.login-card .password-control .form-control:focus {
    padding-inline-end: 55px;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 5px;
    inset-block-start: 50%;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    transform: translateY(-50%);
    background: transparent;
    color: #718098;
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(243, 107, 33, .08);
    color: var(--auth-orange);
}

.password-toggle:focus-visible {
    outline: 3px solid rgba(242, 138, 60, .35);
}

.password-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .icon-eye-off,
.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}

.field-error {
    margin: -5px 0 0;
    color: #b92f3d;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.65;
    text-align: start;
}

.field-error[hidden] {
    display: none;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 24px;
    font-size: 12px;
}

.forgot {
    font-weight: 500;
    text-decoration: none;
}

.forgot:hover {
    text-decoration: underline;
}

.login-submit.button.edu-button {
    width: 100%;
    min-height: 56px;
    font-size: 1rem;
    font-weight: 800;
}

.login-back-home {
    display: inline-block;
    color: #a5490f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-back-home:hover {
    color: #733009;
}

.login-back-home:focus-visible {
    outline: 3px solid rgba(242, 138, 60, .35);
    outline-offset: 3px;
    border-radius: 3px;
}

/* A selected public portal is represented by its approved artwork, not the
   generic authentication icon. Keep it prominent without changing layout. */
.login-card .page-header__lead { align-items: center; }
.login-card .page-header__artwork { margin-inline-start: auto; order: 2; }
.login-card .page-header__artwork > .visual-artwork { --artwork-size: clamp(7.5rem, 17vw, 11rem); animation: login-portal-artwork-float 5.5s ease-in-out infinite; filter: drop-shadow(0 1rem 1.25rem rgb(0 0 0 / .25)); }
.login-card .page-header__artwork > .visual-artwork img { block-size: var(--artwork-size); inline-size: var(--artwork-size); }
@keyframes login-portal-artwork-float { 0%,100% { transform: translate3d(0,0,0) rotate(-2deg); } 50% { transform: translate3d(0,-.6rem,0) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .login-card .page-header__artwork > .visual-artwork,.login-art-float { animation: none; } }

.submit-arrow {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-copyright {
    display: block;
    color: var(--control-muted, #5f6d82);
    font-size: 9px;
    font-weight: 400;
    line-height: 1.75;
    text-align: start;
}

html[dir="rtl"] .login-shell {
    grid-template-columns: minmax(390px, .9fr) minmax(0, 1.1fr);
}

html[dir="rtl"] .login-art {
    --copy-column: 2;
    --decoration-column: 1;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(150px, 1fr) minmax(0, 3fr);
    direction: ltr;
    background:
        radial-gradient(circle at 20% 24%, rgba(255, 192, 95, .46), transparent 18%),
        radial-gradient(circle at 36% 92%, rgba(237, 105, 41, .35), transparent 28%),
        linear-gradient(230deg, #18263c, #283549);
}

html[dir="rtl"] .login-panel {
    grid-column: 1;
    grid-row: 1;
    direction: rtl;
}

html[dir="rtl"] .login-tools {
    inset-inline: auto;
    right: auto;
    left: 35px;
    direction: rtl;
}

html[dir="rtl"] .login-brand {
    direction: rtl;
    justify-content: flex-start;
}

html[dir="rtl"] .art-copy {
    direction: rtl;
    justify-self: end;
    text-align: start;
}

html[dir="rtl"] .art-copy :is(h1,h2) {
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: 0;
}

html[dir="rtl"] .art-copy p {
    line-height: 2;
}

html[dir="rtl"] .art-orb {
    inset-inline-start: 50%;
    inset-block-start: 50%;
    inset-inline-end: auto;
}

/* The RTL hero mirrors its copy grid, but the decorative orbit needs its own
   bounded physical canvas so no part of the circle can be clipped at the edge. */
html[dir="rtl"] .art-decoration {
    position: absolute;
    inset-block-end: 6%;
    inset-inline-start: 5%;
    inline-size: min(30rem, 38vw);
    min-height: 310px;
}

html[dir="rtl"] .login-card,
html[dir="rtl"] .form-group,
html[dir="rtl"] .field-error,
html[dir="rtl"] .auth-copyright {
    text-align: start;
}

html[dir="rtl"] .form-row {
    direction: rtl;
}

html[dir="rtl"] .login-submit {
    font-weight: 600;
}

html[dir="rtl"] .login-portal-intent > span {
    letter-spacing: 0;
}

html[dir="rtl"] .submit-arrow {
    transform: scaleX(-1);
}

html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-page {
    background: #111a2b;
    color: #eef3f9;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] .check {
    color: #d6deea;
}

html[data-theme="dark"] .login-card > p,
html[data-theme="dark"] .auth-copyright {
    color: #a4b0c1;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .language-control,
html[data-theme="dark"] .appearance-control {
    border-color: #394960;
    background: #1d293c;
    color: #f2f5fa;
}

html[data-theme="dark"] .login-portal-intent {
    border-color: #825524;
    background: #2d241a;
    color: #f8d7a8;
}

html[data-theme="dark"] .login-portal-intent > span,
html[data-theme="dark"] .login-portal-intent > p {
    color: #e6c393;
}

html[data-theme="dark"] .login-portal-intent > strong {
    color: #f6efe5;
}

html[data-theme="dark"] .login-portal-intent > a {
    color: #ffbd74;
}

html[data-theme="dark"] .login-back-home {
    color: #ffbd74;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="system"] .login-panel,
    html[data-theme="system"] .login-page {
        background: #111a2b;
        color: #eef3f9;
    }

    html[data-theme="system"] .form-label,
    html[data-theme="system"] .check {
        color: #d6deea;
    }

    html[data-theme="system"] .login-card > p,
    html[data-theme="system"] .auth-copyright {
        color: #a4b0c1;
    }

    html[data-theme="system"] .form-control,
    html[data-theme="system"] .language-control,
    html[data-theme="system"] .appearance-control {
        border-color: #394960;
        background: #1d293c;
        color: #f2f5fa;
    }

    html[data-theme="system"] .login-portal-intent {
        border-color: #825524;
        background: #2d241a;
        color: #f8d7a8;
    }

    html[data-theme="system"] .login-portal-intent > span,
    html[data-theme="system"] .login-portal-intent > p {
        color: #e6c393;
    }

    html[data-theme="system"] .login-portal-intent > strong {
        color: #f6efe5;
    }

    html[data-theme="system"] .login-portal-intent > a {
        color: #ffbd74;
    }

    html[data-theme="system"] .login-back-home {
        color: #ffbd74;
    }
}

@media (max-width: 1120px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(370px, .9fr);
    }

    html[dir="rtl"] .login-shell {
        grid-template-columns: minmax(370px, .9fr) minmax(0, 1fr);
    }

    .login-art,
    html[dir="rtl"] .login-art {
        grid-template-columns: minmax(0, 72fr) minmax(125px, 28fr);
        padding-inline: 6.5%;
    }

    html[dir="rtl"] .login-art {
        grid-template-columns: minmax(125px, 28fr) minmax(0, 72fr);
    }

    .art-copy :is(h1,h2) {
        font-size: clamp(32px, 3.4vw, 43px);
    }

    .art-orb {
        width: 120px;
        box-shadow: 0 0 0 22px rgba(255, 255, 255, .04), 0 0 0 44px rgba(255, 255, 255, .025);
    }
}

@media (max-width: 1199px) {
    .login-shell,
    html[dir="rtl"] .login-shell {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .auth-responsive-bar,
    html[dir="rtl"] .auth-responsive-bar {
        order: 1;
        min-height: calc(64px + var(--safe-top));
        display: flex;
        direction: inherit;
    }

    html[dir="rtl"] .auth-responsive-bar {
        direction: rtl;
    }

    .auth-responsive-bar .responsive-app-bar__leading,
    .auth-responsive-bar .responsive-app-bar__actions {
        display: flex;
    }

    .auth-responsive-bar .responsive-app-bar__logo {
        display: block;
    }

    .login-tools,
    html[dir="rtl"] .login-tools {
        position: static;
        inset: auto;
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 0;
        background: transparent;
    }

    html[dir="rtl"] .login-tools {
        justify-content: flex-start;
    }

    .login-art,
    html[dir="rtl"] .login-art {
        order: 2;
        min-height: 280px;
        display: block;
        width: 100%;
        min-width: 0;
        grid-column: auto;
        padding: 30px clamp(24px, 6vw, 46px);
    }

    .login-brand { display: flex; }

    .art-copy {
        width: min(100%, 650px);
        margin-block-start: 18px;
    }

    .art-copy :is(h1,h2) {
        margin-block: 11px;
        font-size: clamp(27px, 6vw, 38px);
    }

    html[dir="rtl"] .art-copy :is(h1,h2) {
        line-height: 1.45;
    }

    .art-decoration {
        display: none;
    }

    .login-art-assurances {
        display: none;
    }

    .login-panel {
        order: 3;
        min-height: auto;
        width: 100%;
        min-width: 0;
        grid-column: auto;
        padding: 48px 28px calc(38px + var(--safe-bottom));
    }

    .login-card,
    .login-brand,
    .art-copy {
        min-width: 0;
        max-width: 100%;
    }

    .form-control {
        font-size: 16px;
    }

}

@media (max-width: 767px) {
    .auth-responsive-bar,
    html[dir="rtl"] .auth-responsive-bar {
        min-height: calc(62px + var(--safe-top));
    }

    .login-art,
    html[dir="rtl"] .login-art {
        min-height: 238px;
        padding: 22px 24px;
    }

    .art-copy {
        margin-block-start: 0;
    }

    .login-panel {
        min-height: auto;
        padding: 40px 24px calc(34px + var(--safe-bottom));
    }
}

@media (max-width: 480px) {
    .login-art,
    html[dir="rtl"] .login-art {
        min-height: 230px;
        padding: 20px 22px;
    }

    .art-copy {
        margin-block-start: 0;
    }

    .art-copy :is(h1,h2) {
        font-size: 27px;
    }

    .art-copy p {
        font-size: 13px;
        line-height: 1.6;
    }

    .login-panel {
        min-height: calc(100svh - 300px);
        padding: 82px 20px 32px;
    }

    .login-card h2 {
        font-size: 28px;
    }

    .login-portal-intent {
        gap: 3px 12px;
        padding: 12px;
    }

    .form-row {
        align-items: flex-start;
        gap: 12px;
    }
}
