:root {
    --auth-ink: #17241f;
    --auth-muted: #596760;
    --auth-paper: #f2f4ef;
    --auth-panel: #fff;
    --auth-yellow: #e6b422;
    --auth-green: #173b70;
    --auth-border: #d8ded8;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
.auth-shell { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; min-height: 100svh; background: #eef2f5; }
.auth-shell-login { height: 100vh; height: 100svh; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.auth-brand { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; width: 100%; height: 100vh; height: 100svh; min-height: 100vh; min-height: 100svh; padding: 40px clamp(28px, 5vw, 76px); overflow: hidden; background: #173b70 url('../images/landing-school.png') center 48% / cover no-repeat; color: #fff; }
.auth-shell-school-entry .auth-brand { background-image: url('../images/auth-school-background.png'); }
.auth-brand::before { position: absolute; z-index: -1; inset: 0; background: linear-gradient(155deg, rgba(10,31,60,.72) 0%, rgba(17,54,98,.48) 48%, rgba(10,31,60,.82) 100%); content: ''; pointer-events: none; }
.auth-logo { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; width: fit-content; padding: 10px 14px 10px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 14px; background: rgba(11,35,68,.35); color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 800; text-decoration: none; backdrop-filter: blur(8px); }
.auth-logo span { max-width: 190px; line-height: 1.35; }
.auth-logo img { flex: 0 0 auto; border-radius: 8px; background: transparent; object-fit: contain; }
.auth-brand-emblem { display: block; width: 88px; height: 88px; margin: 0 0 22px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0,0,0,.2)); }
.auth-brand-copy { z-index: 1; max-width: 520px; padding: 38px 0; }
.auth-kicker { margin: 0 0 14px; color: #ffe18a; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.auth-brand-copy h1 { margin: 0; color: #fff; font-family: 'Manrope', sans-serif; font-size: clamp(58px, 7vw, 92px); font-weight: 800; letter-spacing: -.055em; line-height: .95; text-shadow: 0 4px 24px rgba(4,18,38,.24); }
.auth-description { max-width: 360px; margin: 20px 0 0; color: rgba(255,255,255,.94); font-size: 16px; line-height: 1.65; text-shadow: 0 2px 8px rgba(4,18,38,.25); }
.auth-motto { display: inline-block; margin: 26px 0 0; padding: 10px 13px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; background: rgba(11,35,68,.34); color: #ffe18a; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(8px); }
.auth-brand-index { z-index: 1; display: flex; justify-content: space-between; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 700; }
.auth-panel { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 28px clamp(24px, 5vw, 76px) 20px; background: #f7f9f8; }
.auth-shell-school-entry .auth-panel { background: linear-gradient(135deg, rgba(244,247,250,.84), rgba(249,250,248,.84)), url('../images/auth-school-background.png') center / cover no-repeat; }
.auth-panel-login { min-height: 0; justify-content: center; gap: 8px; overflow-y: auto; }
.auth-panel-login .auth-panel-top, .auth-panel-login .auth-footer { flex: 0 0 auto; width: min(100%, 480px); margin-inline: auto; }
.auth-panel-login .auth-form-wrap { width: min(100%, 480px); margin: auto; padding: 18px 28px; border-radius: 16px; box-shadow: 0 16px 48px rgba(24,43,67,.1); }
.auth-panel-login .auth-heading { font-size: 31px; }
.auth-panel-login .auth-subheading { margin: 4px 0 12px; font-size: 13px; line-height: 1.4; }
.auth-panel-login .auth-form .form-label { margin-bottom: 4px; font-size: 12px; }
.auth-panel-login .auth-form .form-control { min-height: 44px; padding: 9px 12px; }
.auth-panel-login .auth-password-wrap button { height: 44px; }
.auth-panel-login .auth-form > .mb-3 { margin-bottom: 8px !important; }
.auth-panel-login .auth-captcha-image { width: 150px; height: 48px; }
.auth-panel-login .auth-form [for="captcha"] + .d-flex { margin-bottom: 6px !important; }
.auth-panel-login #captcha { min-height: 42px; }
.auth-panel-login .auth-form .mb-4 { margin-bottom: 8px !important; }
.auth-panel-login .auth-submit { min-height: 44px; }
.auth-panel-login .auth-divider { margin: 8px 0; }
.auth-panel-login .auth-google-button { min-height: 44px; }
.auth-panel-login .auth-form-wrap > .form-text { margin: 5px 0 !important; font-size: 10px; line-height: 1.4; }
.auth-panel-login .auth-links { margin-top: 10px; font-size: 12px; }
.auth-panel-register .auth-form-wrap { width: min(100%, 700px); padding: 32px; }
.auth-panel-register .auth-subheading { margin-bottom: 18px; }
.auth-panel-register .auth-form .form-label { margin-bottom: 5px; }
.auth-panel-register .auth-form .form-control, .auth-panel-register .auth-form .form-select { min-height: 48px; padding: 10px 12px; }
.auth-panel-register .auth-password-wrap button { height: 48px; }
.auth-panel-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #596760; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.auth-panel-top a { color: #173b70; text-decoration: none; }
.auth-panel-top a:hover { color: #0d2850; text-decoration: underline; text-underline-offset: 3px; }
.auth-form-wrap { width: min(100%, 510px); margin: auto; padding: 38px; border: 1px solid #e5e9e2; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 18px 55px rgba(27,42,34,.08); }
.auth-heading { margin: 0; font-family: 'Manrope', sans-serif; font-size: clamp(29px, 4vw, 40px); font-weight: 800; line-height: 1.15; }
.auth-subheading { margin: 10px 0 28px; color: var(--auth-muted); font-size: 15px; line-height: 1.6; }
.auth-form .form-label { margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.auth-form .form-control, .auth-form .form-select { min-height: 52px; padding: 12px 14px; border-color: var(--auth-border); border-radius: 9px; background-color: #fbfcfa; }
.auth-form .form-control:focus, .auth-form .form-select:focus { border-color: #987300; box-shadow: 0 0 0 .2rem rgba(230,180,34,.2); }
.auth-form .form-control::placeholder { color: #89938d; }
.auth-form .invalid-feedback { font-size: 12px; }
.auth-form .form-text { color: #69756e; font-size: 11px; line-height: 1.5; }
.auth-google-button { display: flex; min-height: 50px; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--auth-border); border-radius: 9px; color: var(--auth-ink); font-size: 14px; font-weight: 700; text-decoration: none; transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.auth-google-button:hover { border-color: #aab2ad; background: #f8f9f6; box-shadow: 0 5px 14px rgba(27,42,34,.06); color: var(--auth-ink); transform: translateY(-1px); }
.auth-google-mark { display: block; width: 22px; height: 22px; flex: 0 0 22px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--auth-muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--auth-border); content: ''; }
.auth-password-wrap { position: relative; }
.auth-password-wrap .form-control { padding-right: 48px; }
.auth-password-wrap button { position: absolute; top: 0; right: 0; display: grid; width: 48px; height: 52px; place-items: center; border: 0; background: transparent; color: var(--auth-muted); }
.auth-submit { min-height: 52px; border: 0; border-radius: 9px; background: var(--auth-yellow); box-shadow: 0 6px 14px rgba(177,132,7,.15); color: #231d0c; font-weight: 800; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.auth-submit:hover { background: #d7a30c; box-shadow: 0 9px 18px rgba(177,132,7,.22); color: #231d0c; transform: translateY(-1px); }
.auth-submit:focus-visible, .auth-password-wrap button:focus-visible { outline: 3px solid #1b6f53; outline-offset: 2px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; }
.auth-links a { color: #24543e; font-weight: 700; text-decoration: none; }
.auth-links a:hover { color: #173a2c; text-decoration: underline; text-underline-offset: 3px; }
.auth-footer { display: flex; justify-content: space-between; color: #69756e; font-size: 11px; }
.auth-footer span { color: #735700; }
.auth-alert { border-radius: 9px; }
.auth-captcha-image { display: block; width: 174px; height: 68px; border: 1px solid var(--auth-border); border-radius: 8px; background: #fff8dc; }
.auth-password-wrap button:hover { color: #173b70; }
.auth-form .form-check-input:checked { border-color: #173b70; background-color: #173b70; }
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-shell-login { grid-template-rows: 220px minmax(0, 1fr); }
    .auth-shell-login .auth-brand { min-height: 220px; padding: 10px 22px; }
    .auth-shell-login .auth-brand > .auth-logo, .auth-shell-login .auth-brand-index { display: none; }
    .auth-shell-login .auth-brand-copy { display: flex; align-items: center; gap: 7px; width: 100%; max-width: none; padding: 0; }
    .auth-shell-login .auth-kicker { order: 1; flex: 1; margin: 0; font-size: 9px; letter-spacing: .1em; }
    .auth-shell-login .auth-brand-emblem, .auth-shell-login .auth-description, .auth-shell-login .auth-motto { display: none; }
    .auth-shell-login .auth-brand-copy h1 { order: 0; font-size: 30px; }
    .auth-shell-login .auth-panel { min-height: 0; padding: 12px 22px; }
    .auth-shell-login .auth-panel-top, .auth-shell-login .auth-footer { display: none; }
    .auth-shell-login .auth-form-wrap { margin: auto; padding: 22px 28px; }
    .auth-brand { height: 220px; min-height: 220px; padding: 18px 24px; }
    .auth-brand::after { right: -120px; bottom: -210px; width: 310px; }
    .auth-brand-emblem { width: 64px; height: 64px; margin: 0 0 10px; }
    .auth-brand-copy { padding: 14px 0 12px; }
    .auth-kicker { margin-bottom: 10px; font-size: 10px; }
    .auth-brand-copy h1 { font-size: 42px; }
    .auth-description { max-width: 420px; margin-top: 8px; font-size: 13px; }
    .auth-motto { margin-top: 10px; padding-top: 6px; font-size: 10px; }
    .auth-brand-index { display: none; }
    .auth-panel { min-height: calc(100vh - 220px); padding: 20px 24px 18px; }
    .auth-form-wrap { margin: 22px auto; padding: 28px; }
    .auth-panel-register .auth-form-wrap { padding: 28px; }
    .auth-footer { margin-top: auto; }
    .auth-panel-login .auth-subheading { margin: 6px 0 14px; font-size: 13px; }
    .auth-panel-login .auth-form .form-label { margin-bottom: 4px; font-size: 12px; }
    .auth-panel-login .auth-form .form-control { min-height: 44px; padding: 9px 12px; }
    .auth-panel-login .auth-password-wrap button { height: 44px; }
    .auth-panel-login .auth-form > .mb-3 { margin-bottom: 10px !important; }
    .auth-panel-login .auth-captcha-image { width: 142px; height: 48px; }
    .auth-panel-login .auth-form [for="captcha"] + .d-flex { margin-bottom: 6px !important; }
    .auth-panel-login #captcha { min-height: 42px; }
    .auth-panel-login .auth-form .mb-4 { margin-bottom: 10px !important; }
    .auth-panel-login .auth-submit { min-height: 44px; }
    .auth-panel-login .auth-divider { margin: 10px 0; }
    .auth-panel-login .auth-google-button { min-height: 44px; }
    .auth-panel-login .auth-form-wrap > .form-text { margin: 6px 0 !important; font-size: 10px; }
    .auth-panel-login .auth-links { margin-top: 10px; font-size: 12px; }
}

@media (max-width: 420px) {
    .auth-shell-login { grid-template-rows: 220px minmax(0, 1fr); }
    .auth-shell-login .auth-brand { padding: 8px 18px; }
    .auth-shell-login .auth-brand-copy h1 { font-size: 27px; }
    .auth-shell-login .auth-kicker { font-size: 8px; }
    .auth-shell-login .auth-panel { padding: 8px 14px; }
    .auth-shell-login .auth-form-wrap { padding: 17px 20px; border-radius: 13px; }
    .auth-shell-login .auth-heading { font-size: 25px; }
    .auth-shell-login .auth-subheading { font-size: 12px; }
    .auth-shell-login .auth-captcha-image { width: 126px; height: 44px; }
    .auth-brand { min-height: 210px; }
    .auth-panel { min-height: calc(100vh - 210px); padding: 18px 16px 16px; }
    .auth-form-wrap { margin: 18px auto; padding: 24px 20px; border-radius: 14px; }
    .auth-panel-register .auth-form-wrap { padding: 24px 20px; }
    .auth-panel-top { font-size: 10px; }
    .auth-links { font-size: 12px; }
}

@media (max-height: 680px) and (max-width: 900px) {
    .auth-shell-login { grid-template-rows: 66px minmax(0, 1fr); }
    .auth-shell-login .auth-brand { padding-block: 6px; }
    .auth-shell-login .auth-panel { padding-block: 4px; }
    .auth-shell-login .auth-brand-copy h1 { font-size: 25px; }
    .auth-shell-login .auth-form-wrap { padding-block: 8px; }
    .auth-shell-login .auth-subheading { margin-bottom: 6px; }
    .auth-shell-login .auth-form > .mb-3 { margin-bottom: 4px !important; }
    .auth-shell-login .auth-captcha-image { height: 34px; }
    .auth-shell-login #captcha { min-height: 36px; }
    .auth-shell-login .auth-submit, .auth-shell-login .auth-google-button { min-height: 40px; }
    .auth-shell-login .auth-divider { margin: 4px 0; }
    .auth-shell-login .auth-form-wrap > .form-text { display: none; }
    .auth-shell-login .auth-links { margin-top: 4px; }
}

@media (max-height: 620px) {
    .auth-shell-login { grid-template-rows: 54px minmax(0, 1fr); }
    .auth-shell-login .auth-brand { padding-block: 3px; }
    .auth-shell-login .auth-brand-copy h1 { font-size: 22px; }
    .auth-shell-login .auth-kicker { font-size: 7px; }
    .auth-shell-login .auth-form-wrap { padding: 5px 16px; }
    .auth-shell-login .auth-heading { font-size: 22px; }
    .auth-shell-login .auth-subheading { margin: 2px 0 4px; font-size: 11px; }
    .auth-shell-login .auth-form .form-control { min-height: 36px; padding: 6px 10px; }
    .auth-shell-login .auth-password-wrap button { height: 36px; }
    .auth-shell-login .auth-form .form-label { margin-bottom: 2px; font-size: 11px; }
    .auth-shell-login .auth-captcha-image { width: 112px; height: 30px; }
    .auth-shell-login .auth-form [for="captcha"] + .d-flex { margin-bottom: 3px !important; }
    .auth-shell-login #captcha { min-height: 32px; }
    .auth-shell-login .auth-submit, .auth-shell-login .auth-google-button { min-height: 36px; }
    .auth-shell-login .auth-divider { margin: 2px 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
