:root {
    color-scheme: light;
    --blue: #2167cd;
    --ink: #16264b;
    --muted: #687b99;
    --line: #dbe6f5;
    --orange: #ffa05c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.login-page {
    margin: 0;
    min-height: 100dvh;
    background: #edf6ff;
    color: var(--ink);
    font-family: Inter, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #80b7fa; outline-offset: 4px; }
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.login-layout {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    width: 100%;
    min-height: 100dvh;
    overflow: hidden;
    background: linear-gradient(110deg, #fff 7%, #f5faff 45%, #eaf4ff 100%);
}
.login-layout::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 600px;
    height: 600px;
    top: -440px;
    left: 32%;
    border-radius: 50%;
    background: #d4ebff;
}
.login-story {
    position: relative;
    padding: clamp(28px, 6dvh, 72px) 0 24px clamp(30px, 6vw, 120px);
    overflow: hidden;
}
.schoolyz-wordmark {
    display: inline-block;
    font-size: clamp(30px, 2.8vw, 44px);
    font-weight: 800;
    letter-spacing: -1.7px;
    line-height: 1.2;
    color: #1f61c3;
    text-decoration: none !important;
}
.schoolyz-wordmark span { font-weight: 750; }
.story-copy { position: relative; z-index: 2; margin-top: clamp(24px, 4dvh, 42px); }
.story-accent { display: block; width: 34px; height: 3px; background: var(--orange); margin-bottom: 18px; }
.story-copy h1 {
    font-size: clamp(26px, min(3.1vw, 5.5dvh), 48px);
    font-weight: 750;
    letter-spacing: -1.4px;
    line-height: 1.13;
    margin: 0;
}
.story-copy h1 span { color: #1a3e78; }
.school-scene {
    position: absolute;
    z-index: 1;
    right: -6%;
    bottom: 2dvh;
    width: min(95%, 850px);
    height: min(51dvh, 600px);
    margin: 0;
    pointer-events: none;
}
.school-scene img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    mask-image: linear-gradient(to right, transparent, #000 18%), linear-gradient(to bottom, transparent, #000 18%, #000 85%, transparent);
    mask-composite: intersect;
}
.school-scene figcaption {
    position: absolute;
    top: -40px;
    right: 18%;
    transform: rotate(-8deg);
    font-family: "Segoe Print", "Comic Sans MS", cursive;
    color: #3268b2;
    font-size: clamp(16px, 1.6vw, 23px);
    line-height: 1.4;
    text-align: center;
}
.school-scene figcaption span { display: block; background: var(--orange); height: 2px; width: 60px; margin: 8px auto; transform: rotate(-6deg); }
.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4dvh, 44px) clamp(24px, 5vw, 100px) clamp(18px, 4dvh, 44px) 18px;
}
.login-panel::before {
    content: "";
    position: absolute;
    right: -92px;
    top: -105px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: #ffad6b;
    z-index: -1;
}
.login-panel::after {
    content: "";
    position: absolute;
    right: -92px;
    bottom: 8%;
    width: 150px;
    height: 330px;
    border-radius: 70% 30% 0 80%;
    transform: rotate(-22deg);
    background: #bddff7;
    z-index: -1;
}
.login-card {
    width: 100%;
    max-width: 430px;
    border-radius: 24px;
    background: #ffffffed;
    padding: 36px 34px 28px;
    box-shadow: 0 20px 70px #467ab41a, 0 2px 8px #467ab408;
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .schoolyz-wordmark { font-size: 31px; letter-spacing: -1.3px; }
.tenant-logo { width: auto; max-width: 200px; max-height: 60px; object-fit: contain; }
.login-heading { text-align: center; margin-bottom: 26px; }
.login-heading h2 { font-size: 21px; font-weight: 750; letter-spacing: -.7px; line-height: 1.4; margin: 0 0 8px; text-wrap: balance; }
.welcome-wave { font-size: 19px; display: inline-block; }
.login-heading p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 11px; font-weight: 600; color: #536788; margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.input-wrap > svg { position: absolute; left: 15px; width: 18px; height: 18px; color: #7c91ae; pointer-events: none; }
.login-field input, .login-field select {
    width: 100%;
    min-width: 0;
    height: 47px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0 14px;
    background: #f7faff;
    color: var(--ink);
    font-size: 12px;
    transition: border-color .2s, box-shadow .2s;
}
.input-wrap input { padding: 0 42px; }
.login-field input::placeholder { color: #8797b0; }
.login-field input:focus, .login-field select:focus { outline: none; border-color: #6ba0ea; box-shadow: 0 0 0 3px #2167cd12; background: white; }
.login-field input[aria-invalid="true"] { border-color: #cd6b6b; }
.password-toggle { position: absolute; right: 3px; top: 2px; display: grid; place-items: center; width: 42px; height: 43px; border: 0; border-radius: 6px; background: transparent; color: #6b83a5; cursor: pointer; transition: background .2s; }
.password-toggle:hover { background: #e6effb; }
.password-toggle svg { width: 19px; height: 19px; }
.eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
.field-error { font-size: 11px; color: #b94343; line-height: 1.5; }
.field-error:not(:empty) { margin-top: 7px; }
.field-hint { font-size: 10px; color: var(--muted); line-height: 1.6; margin: 7px 0 0; }
.login-submit { border: 0; width: 100%; height: 47px; border-radius: 9px; background: var(--blue); color: #fff; display: flex; justify-content: center; align-items: center; gap: 13px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 14px #2167cd1a; transition: background .2s, transform .2s; }
.login-submit svg { width: 18px; height: 18px; }
.login-submit:hover { background: #1857b1; transform: translateY(-1px); }
.login-submit:active { transform: translateY(1px); }
.login-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.login-help { text-align: center; font-size: 10px; color: #7a8ba6; line-height: 1.7; margin-top: 22px; }
.login-help p { margin: 14px 0 0; }
.login-help > p { font-size: 14px; }
.login-help a, .login-help summary { font-weight: 600; color: var(--blue); }
.login-help summary { cursor: pointer; list-style: none; padding: 10px; border: 1px solid #e1eaf7; background: #f8faff; border-radius: 8px; font-size: 11px; transition: background .2s; }
.login-help summary::-webkit-details-marker { display: none; }
.login-help summary:hover { background: #edf4ff; }
.login-help details[open] p { padding: 0 10px; }
.panel-footer { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 10px; color: #8a9bb2; margin: 20px 0 0; }
.panel-footer svg { width: 13px; height: 13px; }
.login-alert { background: #fff0f0; border: 1px solid #f3caca; color: #a53d3d; border-radius: 8px; padding: 12px; margin-bottom: 18px; font-size: 12px; line-height: 1.6; }
.login-alert-success { background: #eff9f3; border-color: #c4e5d1; color: #28734a; }
.register-card { max-width: 470px; padding: 28px 32px 24px; }
.register-card .login-brand { margin-bottom: 16px; }
.register-card .login-heading { margin-bottom: 20px; }
.register-card .login-field { margin-bottom: 14px; }
.register-fields { padding: 0; margin: 0; border: 0; min-width: 0; }
.register-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.register-role-warning { padding: 14px; border: 1px solid #d4e5fb; border-radius: 9px; background: #f1f7ff; color: #456b9b; font-size: 12px; line-height: 1.7; margin: 0 0 16px; }
.register-login-link { margin: 20px 0 0; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; }
.register-login-link a { font-weight: 600; }
@media (max-width: 1000px) {
    .login-story { padding-left: 34px; }
    .login-panel { padding-left: 12px; padding-right: 26px; }
    .login-card { padding-left: 24px; padding-right: 24px; }
    .story-copy h1 { font-size: clamp(26px, 3.3vw, 34px); }
    .school-scene { width: 108%; right: -14%; }
    .school-scene figcaption { right: 16%; font-size: 16px; }
    .login-heading h2 { font-size: 19px; }
}
@media (max-width: 760px) {
    .login-layout { display: flex; flex-direction: column; background: linear-gradient(150deg, #edf7ff, #f9fcff 45%, #eaf5ff); }
    .login-story { display: none; }
    .login-panel { flex: 1; padding: 24px 22px; min-height: 100dvh; }
    .login-panel::before { width: 145px; height: 145px; top: -82px; right: -60px; }
    .login-panel::after { width: 105px; height: 210px; bottom: -78px; right: -38px; }
    .login-card { max-width: 410px; padding: 30px 26px 24px; border-radius: 22px; box-shadow: 0 14px 50px #467ab412; }
    .login-heading h2 { font-size: 20px; }
    .login-field input, .login-field select { font-size: 16px; }
    .login-field input::placeholder { font-size: 12px; }
    .login-field label { font-size: 12px; }
    .login-help { font-size: 11px; }
    .register-card { max-width: 440px; padding: 26px 24px 22px; }
}
@media (max-width: 360px) {
    .login-panel { padding: 16px 14px; }
    .login-card { padding: 26px 20px 22px; }
    .login-heading h2 { font-size: 18px; }
    .login-brand .schoolyz-wordmark { font-size: 28px; }
    .register-row { grid-template-columns: 1fr; gap: 0; }
}
@media (max-height: 700px) {
    .login-panel { padding-top: 16px; padding-bottom: 16px; }
    .login-card { padding-top: 24px; padding-bottom: 22px; }
    .login-brand { margin-bottom: 16px; }
    .login-heading { margin-bottom: 18px; }
    .register-card .login-brand { margin-bottom: 12px; }
    .register-card { padding-top: 20px; padding-bottom: 18px; }
    .register-card .login-heading { margin-bottom: 14px; }
    .register-card .login-field { margin-bottom: 12px; }
    .register-card .login-field input, .register-card .login-field select { height: 43px; }
    .register-card .password-toggle { height: 39px; }
    .register-card .login-submit { height: 43px; }
    .register-login-link { margin-top: 16px; }
    .school-scene figcaption { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 360px) and (max-height: 650px) {
    .register-page .login-panel { padding: 12px; }
    .register-card { padding: 18px 16px; }
    .register-card .login-brand { margin-bottom: 10px; }
    .register-card .login-brand .schoolyz-wordmark { font-size: 26px; }
    .register-card .login-heading { margin-bottom: 16px; }
    .register-card .login-heading p { display: none; }
    .register-card .register-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .register-card .login-field label { font-size: 11px; }
    .register-card .field-hint { font-size: 9px; }
}
