* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 12% 18%, rgba(252, 191, 218, .42), transparent 27%),
        radial-gradient(circle at 88% 80%, rgba(193, 167, 241, .38), transparent 30%),
        linear-gradient(135deg, #fff8fc 0%, #f8f4ff 52%, #fffafd 100%);
    color: #33283d;
}

.admin-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 18px 20px;
}

.login-card {
    width: min(960px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(74, 47, 91, .16);
    border: 1px solid rgba(114, 78, 137, .08);
}

.brand-panel {
    position: relative;
    padding: 58px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background:
        radial-gradient(circle at 82% 12%, rgba(255,255,255,.2), transparent 22%),
        linear-gradient(150deg, #72205d 0%, #923071 48%, #6a245e 100%);
    color: white;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: -72px;
    bottom: -72px;
    width: 230px;
    height: 230px;
    border: 30px solid rgba(255,255,255,.06);
    border-radius: 50%;
}

.brand-logo {
    width: 180px;
    max-height: 180px;
    object-fit: contain;
    margin-bottom: 28px;
    filter: drop-shadow(0 10px 18px rgba(42, 8, 38, .18));
}

.brand-copy { position: relative; z-index: 1; max-width: 360px; }
.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.7px;
    text-transform: uppercase;
    color: #ffd8eb;
}
.brand-copy h1 { margin: 0 0 14px; font-size: 38px; line-height: 1.08; }
.brand-copy p { margin: 0; font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.84); }

.form-panel {
    padding: 64px 60px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.form-heading { margin-bottom: 30px; }
.form-heading h2 { margin: 0 0 8px; font-size: 30px; color: #3f2947; }
.form-heading p { margin: 0; color: #7f7286; line-height: 1.5; }

.field-group { margin-bottom: 20px; }
.field-group > label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: #594a60; }
.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    fill: #9b8aa4;
    pointer-events: none;
}
.input-icon svg { width: 100%; height: 100%; }
.login-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 46px;
    border: 1px solid #e3dce7;
    border-radius: 13px;
    background: #fcfbfd;
    color: #34283a;
    font-size: 15px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-input:focus {
    border-color: #9b4f87;
    box-shadow: 0 0 0 4px rgba(146, 48, 113, .10);
    background: #fff;
}
.login-input::placeholder { color: #b4a8ba; }
.password-wrap .login-input { padding-right: 48px; }
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    fill: #94839d;
}
.password-toggle:hover { background: #f4eef6; fill: #72205d; }
.password-toggle svg { width: 100%; height: 100%; }
.field-error { display: block; margin-top: 7px; color: #c6415f; font-size: 12px; }

.login-options { display: flex; align-items: center; justify-content: space-between; margin: -1px 0 22px; }
.remember-check { display: inline-flex; align-items: center; gap: 8px; color: #716476; font-size: 13px; cursor: pointer; }
.remember-check input { width: 16px; height: 16px; accent-color: #87286d; }

.login-button {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #76205f, #9a3479);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 11px 24px rgba(126, 32, 102, .20);
    transition: transform .18s ease, box-shadow .18s ease;
}
.login-button:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(126, 32, 102, .27); }
.login-button:active { transform: translateY(0); }

.back-link { align-self: center; margin-top: 22px; color: #806c87; font-size: 13px; text-decoration: none; }
.back-link:hover { color: #72205d; }
.login-message {
    margin: 0 0 22px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.45;
}
.login-message.info { background: #f7eff8; border: 1px solid #ead8ec; color: #6a3e68; }
.login-message.error { background: #fff1f3; border: 1px solid #f1c7cf; color: #a93048; }
.login-footer { margin: 20px 0 0; color: #95869a; font-size: 12px; text-align: center; }

@media (max-width: 760px) {
    .admin-login-page { justify-content: flex-start; padding: 20px 14px; }
    .login-card { grid-template-columns: 1fr; min-height: auto; border-radius: 22px; }
    .brand-panel { padding: 28px 26px 24px; flex-direction: row; align-items: center; gap: 18px; }
    .brand-logo { width: 90px; height: 90px; margin: 0; flex: 0 0 auto; }
    .brand-copy h1 { font-size: 27px; margin-bottom: 7px; }
    .brand-copy p { font-size: 13px; line-height: 1.45; }
    .eyebrow { margin-bottom: 6px; font-size: 10px; }
    .form-panel { padding: 34px 26px 30px; }
    .form-heading { margin-bottom: 24px; }
    .form-heading h2 { font-size: 25px; }
}

@media (max-width: 430px) {
    .brand-panel { padding: 22px 20px; }
    .brand-logo { width: 72px; height: 72px; }
    .brand-copy p { display: none; }
    .form-panel { padding: 30px 20px 26px; }
    .login-input, .login-button { height: 48px; }
}

.login-message.success {
    background: #eefaf2;
    border: 1px solid #b8e1c4;
    color: #25643a;
}
.login-message a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* Multi-school branding */
.login-button,.btn-primary{background:var(--school-theme,#6d43a3)!important;}
.admin-nav a.active{border-left-color:var(--school-theme,#6d43a3)!important;}
