:root {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --primary-soft: #dbeafe;
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --surface: #ffffff;
    --background: #f4f7fb;
    --success: #15803d;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(1px);
}

.login-page::before {
    width: 420px;
    height: 420px;
    top: -210px;
    right: -100px;
    background: rgba(37, 99, 235, .10);
}

.login-page::after {
    width: 330px;
    height: 330px;
    bottom: -170px;
    left: -100px;
    background: rgba(16, 185, 129, .09);
}

.login-card {
    width: min(1080px, 100%);
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    background: var(--surface);
    border: 1px solid rgba(219, 227, 239, .9);
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(30, 58, 138, .14);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.brand-panel {
    min-height: 100%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 84% 18%, rgba(96, 165, 250, .42), transparent 25%),
        linear-gradient(145deg, #0f3d91 0%, #1d4ed8 54%, #2563eb 100%);
}

.brand-panel::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -170px;
    bottom: -130px;
    border: 70px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
}

.brand-panel::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    left: -80px;
    bottom: 75px;
    background: rgba(96, 165, 250, .16);
    border-radius: 28px;
    transform: rotate(28deg);
}

.brand-panel > * {
    position: relative;
    z-index: 1;
}

.school-mark {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
}

.school-mark svg {
    width: 40px;
    height: 40px;
}

.brand-eyebrow {
    margin: 42px 0 12px;
    color: #bfdbfe;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.brand-panel h1 {
    max-width: 470px;
    margin: 0;
    font-size: clamp(2.25rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -.045em;
}

.brand-panel .lead {
    max-width: 430px;
    margin: 22px 0 0;
    color: #dbeafe;
    font-size: 1.03rem;
    line-height: 1.7;
}

.journal-preview {
    width: min(390px, 100%);
    margin-top: 44px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 18px;
    background: rgba(255, 255, 255, .11);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .15);
    backdrop-filter: blur(12px);
}

.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.preview-label {
    color: #dbeafe;
    font-size: .78rem;
}

.preview-value {
    margin-top: 5px;
    font-size: 1.15rem;
    font-weight: 750;
}

.preview-status {
    align-self: flex-start;
    padding: 7px 11px;
    color: #dcfce7;
    background: rgba(34, 197, 94, .18);
    border: 1px solid rgba(220, 252, 231, .25);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 750;
}

.brand-footer {
    margin-top: 38px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #dbeafe;
    font-size: .82rem;
}

.brand-footer .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #86efac;
    box-shadow: 0 0 0 5px rgba(134, 239, 172, .13);
}

.form-panel {
    padding: 54px 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}

.form-panel .mobile-brand {
    display: none;
}

.form-heading {
    margin-bottom: 32px;
}

.form-heading .eyebrow {
    margin: 0 0 9px;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.form-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.form-heading p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid;
    border-radius: 12px;
    font-size: .87rem;
    line-height: 1.45;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 900;
}

.alert-danger {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.alert-danger .alert-icon {
    color: #fff;
    background: var(--danger);
}

.alert-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.alert-success .alert-icon {
    color: #fff;
    background: var(--success);
}

.login-form .form-group {
    margin-bottom: 19px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: .84rem;
    font-weight: 700;
}

.input-shell {
    position: relative;
}

.input-shell svg {
    width: 19px;
    height: 19px;
    color: #94a3b8;
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-shell input {
    width: 100%;
    height: 50px;
    padding: 0 50px 0 48px;
    color: var(--ink);
    background: #fbfdff;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-shell input::placeholder {
    color: #a0aec0;
}

.input-shell input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, .1);
}

.password-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #64748b;
    background: transparent;
    border: 0;
    border-radius: 9px;
    position: absolute;
    top: 4px;
    right: 4px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--primary);
    background: var(--primary-soft);
    outline: none;
}

.password-toggle svg {
    width: 19px;
    height: 19px;
    position: static;
    transform: none;
}

.login-button {
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    color: #fff;
    background: var(--primary);
    border: var(--primary);
    border-radius: 12px;
    font-weight: 750;
    box-shadow: 0 10px 24px rgba(29, 78, 216, .24);
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.login-button:hover,
.login-button:focus-visible {
    color: #fff;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 14px 30px rgba(29, 78, 216, .3);
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
}

.form-note {
    margin: 19px 0 0;
    padding-top: 18px;
    color: var(--muted);
    border-top: 1px solid #edf1f6;
    font-size: .78rem;
    text-align: center;
}

.form-note strong {
    color: #475569;
}

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    color: #718096;
    font-size: .75rem;
}

.security-note svg {
    width: 15px;
    height: 15px;
    color: #16a34a;
}

@media (max-width: 900px) {
    .login-page {
        padding: 18px;
    }

    .login-card {
        grid-template-columns: 1fr;
        max-width: 570px;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 44px 42px;
    }

    .form-panel .mobile-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 38px;
    }

    .mobile-brand .mini-mark {
        width: 43px;
        height: 43px;
        display: grid;
        place-items: center;
        color: #fff;
        background: linear-gradient(145deg, #0f3d91, #2563eb);
        border-radius: 13px;
    }

    .mobile-brand .mini-mark svg {
        width: 25px;
        height: 25px;
    }

    .mobile-brand strong {
        display: block;
        font-size: .99rem;
    }

    .mobile-brand span {
        color: var(--muted);
        font-size: .75rem;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 0;
        align-items: stretch;
    }

    .login-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .form-panel {
        padding: 34px 24px;
        justify-content: center;
    }

    .form-panel .mobile-brand {
        margin-bottom: 45px;
    }

    .form-heading h2 {
        font-size: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
