:root {
    --navy-950: #07152d;
    --navy-900: #0b2347;
    --navy-800: #123666;
    --blue-600: #1167d8;
    --blue-500: #2684ff;
    --blue-100: #eaf3ff;
    --slate-900: #142033;
    --slate-700: #46556b;
    --slate-500: #748197;
    --slate-300: #cfd8e6;
    --slate-200: #e5eaf2;
    --slate-100: #f5f7fb;
    --white: #ffffff;
    --danger: #c63845;
    --danger-bg: #fff1f2;
    --success: #12784a;
    --success-bg: #ecfdf5;
    --shadow: 0 30px 80px rgba(7, 21, 45, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--slate-900);
    background:
        radial-gradient(circle at 12% 12%, rgba(38, 132, 255, 0.15), transparent 28%),
        radial-gradient(circle at 88% 82%, rgba(17, 103, 216, 0.11), transparent 26%),
        #eef3fa;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(1240px, 100%);
    min-height: min(760px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.login-visual {
    position: relative;
    isolation: isolate;
    min-height: 100%;
    overflow: hidden;
    color: var(--white);
    background: var(--navy-950);
}

.login-visual::before {
    position: absolute;
    inset: 0;
    z-index: -4;
    content: "";
    background-image: var(--user-background);
    background-position: center;
    background-size: cover;
    transform: scale(1.02);
    transition: background-image 0.28s ease, transform 0.8s ease;
}

.login-shell.is-admin .login-visual::before {
    background-image: var(--admin-background);
    transform: scale(1.055);
}

.visual-overlay {
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        linear-gradient(155deg, rgba(5, 20, 45, 0.78) 0%, rgba(6, 30, 66, 0.9) 58%, rgba(17, 103, 216, 0.74) 125%),
        linear-gradient(0deg, rgba(7, 21, 45, 0.35), transparent 55%);
}

.visual-overlay::after {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.12;
    background-image: radial-gradient(rgba(255, 255, 255, 0.9) 0.65px, transparent 0.65px);
    background-size: 13px 13px;
}

.visual-orb {
    position: absolute;
    z-index: -2;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(3px);
}

.visual-orb-one {
    top: -110px;
    right: -80px;
    width: 310px;
    height: 310px;
}

.visual-orb-two {
    right: 38px;
    bottom: -150px;
    width: 360px;
    height: 360px;
}

.visual-content {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(38px, 5vw, 70px);
}

.visual-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: rgba(255, 255, 255, 0.93);
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(2, 10, 25, 0.12);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.visual-copy {
    max-width: 520px;
    margin: auto 0 38px;
}

.visual-kicker {
    margin: 0 0 16px;
    color: #9dccff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.visual-copy h1 {
    margin: 0;
    font-size: clamp(38px, 4.2vw, 60px);
    font-weight: 730;
    letter-spacing: -0.048em;
    line-height: 1.05;
    text-wrap: balance;
}

.visual-copy > p:last-child {
    max-width: 495px;
    margin: 22px 0 0;
    color: rgba(236, 245, 255, 0.84);
    font-size: 16px;
    line-height: 1.7;
}

.notice-card {
    width: min(100%, 530px);
    overflow: hidden;
    background: rgba(5, 20, 45, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(2, 10, 25, 0.22);
    backdrop-filter: blur(16px);
}

.notice-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    font-size: 13px;
    font-weight: 700;
}

.notice-heading i {
    margin-right: 7px;
    color: #a9d2ff;
}

.notice-count {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    color: var(--navy-900);
    background: #dcecff;
    border-radius: 99px;
    font-size: 11px;
}

.notice-list {
    max-height: 210px;
    overflow: auto;
}

.notice-item {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 13px 18px;
    color: var(--white);
    text-decoration: none;
    transition: background 0.2s ease;
}

.notice-item + .notice-item {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.notice-item:hover,
.notice-item:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.notice-dot {
    width: 7px;
    height: 7px;
    background: #69afff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(105, 175, 255, 0.12);
}

.notice-item strong,
.notice-item small {
    display: block;
}

.notice-item strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-item small {
    margin-top: 4px;
    overflow: hidden;
    color: rgba(236, 245, 255, 0.68);
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-item > i {
    color: rgba(255, 255, 255, 0.58);
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    color: rgba(235, 245, 255, 0.78);
    font-size: 12px;
    font-weight: 600;
}

.trust-row i {
    margin-right: 7px;
    color: #8dc5ff;
}

.login-panel {
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.97);
}

.login-panel-inner {
    width: min(100%, 500px);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    padding: clamp(34px, 4vw, 58px) clamp(30px, 4.5vw, 64px) 30px;
}

.brand-header {
    min-height: 62px;
    display: flex;
    align-items: center;
}

.brand-logo {
    width: auto;
    max-width: min(265px, 82%);
    max-height: 68px;
    object-fit: contain;
    object-position: left center;
}

.mobile-school-name {
    display: none;
}

.login-intro {
    margin-top: clamp(26px, 4vh, 48px);
}

.eyebrow {
    display: block;
    margin-bottom: 9px;
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-intro h2 {
    margin: 0;
    color: var(--navy-950);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 760;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.login-intro p {
    margin: 10px 0 0;
    color: var(--slate-500);
    font-size: 14px;
    line-height: 1.6;
}

.login-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 27px 0 22px;
    padding: 5px;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: 13px;
}

.login-tabs.single-tab {
    grid-template-columns: 1fr;
}

.login-tab {
    position: relative;
    z-index: 2;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--slate-500);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: color 0.22s ease;
}

.login-tab:hover {
    color: var(--navy-800);
}

.login-tab:focus-visible {
    outline: 3px solid rgba(38, 132, 255, 0.25);
    outline-offset: 1px;
}

.login-tab.active {
    color: var(--navy-900);
}

.tab-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 1;
    width: calc(50% - 5px);
    height: calc(100% - 10px);
    background: var(--white);
    border: 1px solid rgba(210, 220, 234, 0.8);
    border-radius: 9px;
    box-shadow: 0 5px 16px rgba(18, 54, 102, 0.09);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-shell.is-admin .tab-indicator {
    transform: translateX(100%);
}

.single-tab .tab-indicator {
    width: calc(100% - 10px);
    transform: none !important;
}

.portal-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.portal-alert i {
    margin-top: 2px;
    font-size: 14px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #fecdd3;
}

.alert-success {
    color: var(--success);
    background: var(--success-bg);
    border-color: #bbf7d0;
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel.active {
    animation: panel-in 0.26s ease both;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-heading {
    margin-bottom: 19px;
}

.panel-heading h3 {
    margin: 0;
    color: var(--navy-950);
    font-size: 16px;
    font-weight: 750;
}

.panel-heading p {
    margin: 5px 0 0;
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.5;
}

.field-group {
    margin-bottom: 17px;
}

.field-group > label,
.label-row label {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.label-row a {
    margin-bottom: 7px;
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.label-row a:hover {
    text-decoration: underline;
}

.input-wrap {
    position: relative;
}

.input-wrap input,
.captcha-row input {
    width: 100%;
    height: 48px;
    color: var(--slate-900);
    background: var(--white);
    border: 1px solid var(--slate-300);
    border-radius: 11px;
    outline: none;
    font-size: 13px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-wrap input {
    padding: 0 46px 0 43px;
}

.input-wrap input::placeholder,
.captcha-row input::placeholder {
    color: #9ba7b9;
}

.input-wrap input:hover,
.captcha-row input:hover {
    border-color: #aebacd;
}

.input-wrap input:focus,
.captcha-row input:focus {
    background: #fbfdff;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(38, 132, 255, 0.12);
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    color: #8492a7;
    font-size: 15px;
    transform: translateY(-50%);
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #7c899c;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--blue-600);
    background: var(--blue-100);
    outline: none;
}

.field-error {
    display: block;
    margin: 6px 2px 0;
    color: var(--danger);
    font-size: 11px;
    line-height: 1.4;
}

.captcha-row {
    display: grid;
    grid-template-columns: 150px 34px minmax(110px, 1fr);
    align-items: center;
    gap: 8px;
}

.captcha-image {
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #edf3ed;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
}

.captcha-image:empty::after {
    width: 22px;
    height: 22px;
    content: "";
    border: 2px solid #c1cada;
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.captcha-error {
    padding: 0 8px;
    color: var(--danger);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
}

.captcha-refresh {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--blue-600);
    background: var(--blue-100);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.captcha-refresh:hover,
.captcha-refresh:focus-visible {
    color: var(--white);
    background: var(--blue-600);
    outline: none;
}

.captcha-refresh.loading i {
    animation: spin 0.7s linear infinite;
}

.captcha-row input {
    min-width: 0;
    padding: 0 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.submit-button {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 7px;
    padding: 12px 17px 12px 20px;
    color: var(--white);
    background: linear-gradient(135deg, var(--blue-600), #0b58bd);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 12px 24px rgba(17, 103, 216, 0.23);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit-button i {
    transition: transform 0.18s ease;
}

.submit-button:hover {
    box-shadow: 0 15px 29px rgba(17, 103, 216, 0.3);
    filter: brightness(1.035);
    transform: translateY(-1px);
}

.submit-button:hover i {
    transform: translateX(3px);
}

.submit-button:focus-visible {
    outline: 4px solid rgba(38, 132, 255, 0.22);
    outline-offset: 2px;
}

.submit-button:active {
    box-shadow: 0 8px 16px rgba(17, 103, 216, 0.2);
    transform: translateY(0);
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 27px;
    color: #8b97a9;
    font-size: 10px;
    text-align: center;
}

.login-footer i {
    color: #6e7d91;
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: minmax(0, 0.82fr) minmax(410px, 1fr);
    }

    .visual-content {
        padding: 42px 36px;
    }

    .visual-copy h1 {
        font-size: 40px;
    }

    .notice-item small {
        display: none;
    }
}

@media (max-width: 780px) {
    .login-page {
        display: block;
        padding: 0;
        background: var(--white);
    }

    .login-shell {
        min-height: 100vh;
        display: block;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .login-visual {
        min-height: 210px;
    }

    .visual-content {
        min-height: 210px;
        justify-content: flex-end;
        padding: 28px 26px;
    }

    .visual-badge,
    .notice-card,
    .trust-row,
    .visual-copy > p:last-child {
        display: none;
    }

    .visual-copy {
        margin: 0;
    }

    .visual-kicker {
        margin-bottom: 7px;
        font-size: 10px;
    }

    .visual-copy h1 {
        max-width: 500px;
        font-size: clamp(29px, 8vw, 40px);
    }

    .login-panel {
        max-height: none;
        overflow: visible;
    }

    .login-panel-inner {
        width: min(100%, 560px);
        padding: 28px 24px 24px;
    }

    .brand-header {
        min-height: 44px;
        justify-content: space-between;
        gap: 18px;
    }

    .brand-logo {
        max-width: 210px;
        max-height: 52px;
    }

    .mobile-school-name {
        display: block;
        overflow: hidden;
        margin: 0;
        color: var(--slate-500);
        font-size: 11px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .login-intro {
        margin-top: 25px;
    }
}

@media (max-width: 430px) {
    .login-visual {
        min-height: 180px;
    }

    .visual-content {
        min-height: 180px;
        padding: 24px 20px;
    }

    .login-panel-inner {
        padding: 24px 18px 22px;
    }

    .brand-logo {
        max-width: 180px;
    }

    .mobile-school-name {
        display: none;
    }

    .login-intro h2 {
        font-size: 30px;
    }

    .login-tabs {
        margin-top: 23px;
    }

    .login-tab {
        gap: 6px;
        padding-inline: 8px;
        font-size: 12px;
    }

    .captcha-row {
        grid-template-columns: 1fr 38px;
    }

    .captcha-row input {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
