/*
 * Staff auth pages (site/login, site/forgotpassword) — glass-overlay design.
 *
 * Self-contained on purpose. The legacy usertemplate/style.css carries
 * hard-coded layout for these screens (.loginright{height:330px},
 * .bg-shadow-remove{width:90%} + a dark :after overlay, .text-wrap{height:100vh},
 * and Bootstrap's own .col-lg-8{width:66.66%}) which cannot be reliably
 * overridden piecemeal. The two views using this file therefore render their
 * own `lgn-*` markup and do not use those legacy classes at all — nothing here
 * depends on style.css, and style.css is left untouched so the other auth
 * pages that share it (userlogin, resetpassword, gauthenticate, share,
 * user/choose) are unaffected.
 */

body.lgn-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    background: #0b1f3d;
}

/* ---- Full-bleed backdrop ----
 * The gradient is a genuine fallback: when a school has no
 * admin_login_page_background set (or the file 404s) the inline
 * background-image simply never paints and this shows through instead of a
 * blank white page. The ::after scrim sits over the photo so the heading and
 * notice card keep their contrast no matter how bright the photo is. */
.lgn-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #0b1f3d;
    background-image: linear-gradient(160deg, #0b1f3d 0%, #16345f 45%, #2f5f93 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.lgn-bg.lgn-has-photo {
    background-blend-mode: normal;
}

.lgn-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(6, 14, 26, 0.62) 0%, rgba(10, 25, 50, 0.38) 45%, rgba(10, 25, 50, 0.66) 100%);
}

/* ---- Layout ---- */
.lgn-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 40px 5vw;
    box-sizing: border-box;
}

/* ---- Login card ----
 * A real gradient, not just a translucent tint — the card needs to look
 * identical (same height, same color) whether the school has a background
 * photo configured or not, instead of depending on backdrop-filter over
 * whatever happens to be behind it. Navy + orange to match the site's
 * brand palette, navy dominant from the top with orange as the accent
 * toward the bottom. */
.lgn-card {
    flex: 0 0 auto;
    width: 380px;
    max-width: 100%;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(165deg, #0a1f44 0%, #0a1f44 62%, #ff7a00 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    padding: 38px 34px;
    box-sizing: border-box;
}

.lgn-logo {
    display: inline-block;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    padding: 10px 14px;
    line-height: 0;
}

.lgn-logo img {
    max-width: 150px;
    max-height: 64px;
    object-fit: contain;
    display: block;
}

.lgn-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 24px 0 22px;
}

/* These pages no longer load bootstrap.min.css, so the one Bootstrap
 * utility their markup still uses is redefined here. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.lgn-field {
    position: relative;
    margin-bottom: 14px;
}

.lgn-field input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    color: #1f2430;
    font-size: 14.5px;
    padding: 13px 42px 13px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lgn-field input::placeholder { color: #8a93a0; }

.lgn-field input:focus {
    outline: none;
    border-color: #2fb8a3;
    box-shadow: 0 0 0 3px rgba(47, 184, 163, 0.28);
}

.lgn-field input.input-error {
    border-color: #e06a5a;
    box-shadow: 0 0 0 3px rgba(224, 106, 90, 0.22);
}

.lgn-field .lgn-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #97a0ad;
    font-size: 14px;
    pointer-events: none;
}

.lgn-error {
    color: #ff6b6b;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.lgn-error:not(:empty) {
    display: block;
    margin-top: 7px;
}

.lgn-error p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lgn-error p::before {
    font-family: FontAwesome;
    content: "\f06a";
    font-size: 12px;
    flex: 0 0 auto;
}

.lgn-radio-group {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.lgn-radio {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.lgn-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2fb8a3;
    cursor: pointer;
}

.lgn-btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #37b190, #1c8f7e);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 0;
    margin-top: 4px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(28, 143, 126, 0.35);
    transition: background .15s ease, transform .05s ease;
}

.lgn-btn:hover { background: linear-gradient(135deg, #2fa080, #157a6b); }
.lgn-btn:active { transform: translateY(1px); }
.lgn-btn:focus-visible { outline: 3px solid rgba(47, 184, 163, 0.6); outline-offset: 2px; }

.lgn-alt {
    display: inline-block;
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13.5px;
    text-decoration: none;
}

.lgn-alt:hover,
.lgn-alt:focus { color: #fff; text-decoration: underline; }

.lgn-alert {
    border-radius: 10px;
    font-size: 13.5px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.lgn-alert-danger { background: rgba(192, 57, 43, 0.18); border-color: rgba(255, 138, 122, 0.5); color: #ffd0c9; }
.lgn-alert-success { background: rgba(18, 135, 90, 0.18); border-color: rgba(87, 214, 168, 0.5); color: #c7f2e0; }

/* Captcha row */
.lgn-captcha {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.lgn-captcha-img { display: inline-flex; align-items: center; gap: 8px; }
.lgn-captcha-img img { border-radius: 8px; display: block; }
.lgn-captcha .lgn-refresh { color: rgba(255, 255, 255, 0.9); cursor: pointer; font-size: 15px; }
.lgn-captcha .lgn-field { flex: 1 1 130px; margin-bottom: 0; }
.lgn-captcha .lgn-field input { padding-right: 14px; }

/* ---- Notice panel ---- */
.lgn-notice {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1040px;
}

.lgn-notice-title {
    color: #fff;
    font-size: 23px;
    font-weight: 700;
    margin: 0 0 18px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.lgn-notice-box {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    padding: 8px 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
    max-height: 58vh;
    overflow-y: auto;
}

.lgn-notice-item { padding: 20px 0; border-bottom: 1px solid #e9edf1; }
.lgn-notice-item:last-child { border-bottom: none; }

.lgn-notice-item h4 {
    font-size: 16.5px;
    font-weight: 700;
    color: #12262f;
    margin: 0 0 7px;
    line-height: 1.35;
}

.lgn-notice-item p {
    font-size: 14px;
    line-height: 1.6;
    color: #5b6b73;
    margin: 0;
    word-break: normal;
    overflow-wrap: anywhere;
}

.lgn-notice-item p a.more,
.lgn-notice-item a.more {
    display: inline-block;
    margin-top: 2px;
    color: #1c8f7e;
    font-weight: 700;
    text-decoration: none;
}

.lgn-notice-item a.more:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 1199px) {
    .lgn-layout { gap: 32px; padding: 40px 4vw; }
    .lgn-notice-title { font-size: 21px; }
}

/* Tablet / small laptop: stack, notice below the card, page scrolls */
@media (max-width: 991px) {
    .lgn-layout {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 28px;
        padding: 48px 24px;
    }

    .lgn-card { width: 420px; }

    .lgn-notice { width: 100%; max-width: 560px; flex: 0 0 auto; }
    .lgn-notice-title { font-size: 20px; text-align: center; }
    .lgn-notice-box { max-height: none; }
}

@media (max-width: 575px) {
    .lgn-layout { padding: 32px 16px; gap: 22px; }
    .lgn-card { width: 100%; padding: 30px 22px; }
    .lgn-title { font-size: 20px; margin: 20px 0 18px; }
    .lgn-logo img { max-width: 120px; max-height: 54px; }
    .lgn-notice-box { padding: 4px 18px; }
    .lgn-notice-item { padding: 16px 0; }
    .lgn-notice-item h4 { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .lgn-btn { transition: none; }
}
