:root {
    --mes-blue: #1e4f9c;
    --mes-blue-deep: #153a74;
    --mes-yellow: #f5d021;
    --mes-green: #2f9e4a;
    --mes-orange: #f07a1a;
    --ink: #1a2b4a;
    --muted: #5b6b82;
    --card: #ffffff;
    --line: rgba(30, 79, 156, 0.12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f4f7fb;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.login-atmosphere {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 10%, rgba(245, 208, 33, 0.35), transparent 55%),
        radial-gradient(ellipse 60% 50% at 90% 85%, rgba(47, 158, 74, 0.22), transparent 50%),
        radial-gradient(ellipse 50% 40% at 70% 15%, rgba(240, 122, 26, 0.12), transparent 45%),
        linear-gradient(160deg, #0f2f63 0%, #1e4f9c 42%, #1a6b45 100%);
}

.login-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: 0.35;
    pointer-events: none;
}

.login-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--card);
    border-radius: 20px;
    box-shadow:
        0 24px 60px rgba(10, 30, 70, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset;
    animation: rise 0.45s ease-out both;
}

.login-panel-landscape {
    max-width: 860px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 420px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand-pane {
    background:
        radial-gradient(circle at 30% 20%, rgba(245, 208, 33, 0.28), transparent 45%),
        linear-gradient(165deg, #eff6ff 0%, #f8fafc 55%, #ecfdf5 100%);
    border-right: 1px solid var(--line);
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.login-form-pane {
    padding: 28px 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {
    width: 132px;
    height: 132px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(30, 79, 156, 0.18));
}

.school-name {
    font-family: Nunito, "Source Sans 3", sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    line-height: 1.15;
    color: var(--mes-blue);
    margin: 0 0 4px;
}

.district {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.system-name {
    display: inline-block;
    margin: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(245, 208, 33, 0.28), rgba(47, 158, 74, 0.16));
    color: var(--mes-blue-deep);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
    max-width: 100%;
}

.login-heading {
    font-family: Nunito, sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--mes-blue-deep);
    margin: 0 0 4px;
}

.login-lead {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-alert {
    background: #fff1f0;
    color: #a11b1b;
    border: 1px solid #f5c2c0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.login-status {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.login-form .form-group {
    margin-bottom: 12px;
}

.login-form label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--mes-blue-deep);
    margin-bottom: 5px;
}

.login-form .form-control {
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: #f8fbff;
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
}

.login-form .form-control:focus {
    border-color: var(--mes-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 79, 156, 0.15);
}

.remember-row {
    margin: 2px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--muted);
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--mes-blue);
}

.forgot-link {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--mes-blue);
    text-decoration: none;
    white-space: nowrap;
}

.forgot-link:hover {
    text-decoration: underline;
    color: var(--mes-blue-deep);
}

.btn-login {
    width: 100%;
    border: 0;
    border-radius: 10px;
    height: 44px;
    font-family: Nunito, sans-serif;
    font-weight: 800;
    font-size: 0.98rem;
    color: #fff;
    background: linear-gradient(135deg, var(--mes-blue) 0%, var(--mes-blue-deep) 55%, #1a6b45 140%);
    box-shadow: 0 10px 22px rgba(30, 79, 156, 0.28);
    cursor: pointer;
}

.btn-login:hover {
    filter: brightness(1.05);
}

.auth-back {
    margin: 12px 0 0;
    font-size: 0.88rem;
}

.auth-back a {
    color: var(--mes-blue);
    font-weight: 600;
    text-decoration: none;
}

.login-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.login-footer strong {
    color: var(--mes-blue);
    font-weight: 700;
}

@media (max-width: 800px) {
    .login-panel-landscape {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: auto;
    }

    .login-brand-pane {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 22px 18px 16px;
    }

    .login-logo {
        width: 104px;
        height: 104px;
    }

    .login-form-pane {
        padding: 20px 18px 16px;
    }
}

@media (max-height: 620px) and (min-width: 801px) {
    .login-logo { width: 96px; height: 96px; margin-bottom: 6px; }
    .school-name { font-size: 1.15rem; }
    .login-form-pane { padding: 18px 24px 14px; }
    .login-form .form-control { height: 38px; }
    .btn-login { height: 40px; }
}
