/* Login page. Self-contained: no Bootstrap, no web fonts, no external requests. */
:root {
    --maroon-900: #2e0b0e;
    --maroon-700: #5a1519;
    --maroon-600: #74191f;
    --gold-500: #e9a227;
    --gold-400: #f2b84b;
    --gold-100: #fdf3df;
    --ink: #1f1a17;
    --muted: #6b625b;
    --line: #ddd5cc;
    --surface: #ffffff;
    --page: #f6f2ec;
    --danger: #a3262d;
    --danger-bg: #fbeceb;
    --focus: #2f6fd1;
    --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 100% 0%, var(--gold-100), transparent 60%),
        var(--page);
    -webkit-font-smoothing: antialiased;
}

.login {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-card {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 5fr 6fr;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(46, 11, 14, .06), 0 20px 50px -12px rgba(46, 11, 14, .22);
}

/* ---- Brand panel ---- */
.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    padding: 48px 40px;
    color: #fff;
    background: linear-gradient(160deg, var(--maroon-600) 0%, var(--maroon-700) 45%, var(--maroon-900) 100%);
    overflow: hidden;
}

/* Decorative gold rings echoing the school crest */
.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(233, 162, 39, .22);
    pointer-events: none;
}
.login-brand::before { width: 420px; height: 420px; right: -210px; bottom: -160px; }
.login-brand::after  { width: 260px; height: 260px; right: -130px; bottom: -80px; border-color: rgba(233, 162, 39, .14); }

.login-crest {
    width: 104px;
    height: 104px;
    padding: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(233, 162, 39, .35);
}
.login-crest img { display: block; width: 100%; height: 100%; object-fit: contain; }

.login-school {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .01em;
}
.login-place {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-400);
}
.login-tagline {
    margin: 0;
    max-width: 30ch;
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
}

/* ---- Form panel ---- */
.login-main {
    padding: 48px 48px 40px;
}

.login-title {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}
.login-sub {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 15px;
}

.login-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(163, 38, 45, .25);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
}
.login-alert svg { flex: none; margin-top: 2px; }

.field { margin-bottom: 18px; }

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.input-wrap { position: relative; }

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.input-wrap input::placeholder { color: #a39a92; }
.input-wrap input:hover { border-color: #c6bcb1; }
.input-wrap input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(47, 111, 209, .18);
}
.input-wrap input.has-toggle { padding-right: 52px; }

.toggle-pass {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.toggle-pass:hover { color: var(--ink); background: #f3eee8; }
.toggle-pass:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.toggle-pass .icon-hide { display: none; }
.toggle-pass[aria-pressed="true"] .icon-show { display: none; }
.toggle-pass[aria-pressed="true"] .icon-hide { display: block; }

.btn-login {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--maroon-900);
    background: var(--gold-500);
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn-login:hover { background: var(--gold-400); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-login[disabled] { opacity: .7; cursor: progress; }

.login-help {
    margin: 22px 0 0;
    padding-top: 20px;
    border-top: 1px solid #eee7df;
    color: var(--muted);
    font-size: 14px;
}
.login-help a { color: var(--maroon-600); font-weight: 600; }
.login-help a:hover { color: var(--maroon-900); }

.login-foot {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* ---- Small screens: brand becomes a compact header ---- */
@media (max-width: 760px) {
    .login { justify-content: flex-start; padding-top: 24px; }
    .login-card { grid-template-columns: 1fr; max-width: 460px; }
    .login-brand {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 22px 20px;
    }
    .login-brand::before { width: 220px; height: 220px; right: -90px; bottom: -120px; }
    .login-brand::after  { display: none; }
    .login-crest { width: 64px; height: 64px; padding: 4px; box-shadow: 0 0 0 3px rgba(233, 162, 39, .35); }
    .login-school { font-size: 18px; }
    .login-place { font-size: 11px; }
    .login-tagline { display: none; }
    .login-main { padding: 28px 20px 24px; }
    .login-title { font-size: 21px; }
    .login-sub { margin-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
