:root {
    color-scheme: light;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f4f7fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: #f4f7fb;
    line-height: 1.6;
}

a {
    color: #0d6efd;
}

.site-header {
    color: #fff;
    background: linear-gradient(120deg, #0d6efd, #084298);
    box-shadow: 0 4px 18px rgb(20 49 91 / 14%);
}

.header-inner,
.page-container,
.footer-inner {
    width: min(1120px, calc(100% - 36px));
    margin-inline: auto;
}

.header-inner {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    color: inherit;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: .01em;
    text-decoration: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-nav a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.page-container {
    padding-block: 48px 64px;
}

.hero {
    overflow: hidden;
    padding: clamp(32px, 7vw, 72px);
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgb(255 255 255 / 18%), transparent 25%),
        linear-gradient(125deg, #0d6efd, #084298);
    box-shadow: 0 16px 42px rgb(13 110 253 / 18%);
}

.hero h1 {
    max-width: 760px;
    margin: 0 0 14px;
    font-size: clamp(2.15rem, 5vw, 3.55rem);
    line-height: 1.12;
}

.hero p {
    max-width: 700px;
    margin: 0;
    color: rgb(255 255 255 / 88%);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #0d6efd;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: #0b5ed7;
    box-shadow: 0 6px 16px rgb(13 110 253 / 20%);
}

.button-light {
    background: #fff;
    color: #084298;
}

.button-light:hover {
    background: #eef4ff;
}

.button-outline {
    border-color: rgb(255 255 255 / 60%);
    background: transparent;
    color: #fff;
}

.button-outline:hover {
    background: rgb(255 255 255 / 12%);
}

.section-heading {
    margin: 48px 0 18px;
}

.section-heading h2 {
    margin: 0 0 6px;
    color: #172033;
    font-size: clamp(1.55rem, 3vw, 2rem);
}

.section-heading p {
    margin: 0;
    color: #5c6678;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.module-card,
.form-card,
.dashboard-card {
    border: 1px solid #e3eaf3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 26px rgb(19 41 75 / 5%);
}

.module-card {
    padding: 24px;
}

.module-card h3 {
    margin: 0 0 8px;
    font-size: 1.18rem;
}

.module-card p {
    margin: 0;
    color: #5c6678;
}

.coming-soon {
    display: inline-block;
    margin-top: 18px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff4d6;
    color: #795600;
    font-size: .83rem;
    font-weight: 700;
}

.form-page {
    display: grid;
    min-height: calc(100vh - 150px);
    place-items: center;
    padding: 38px 18px;
}

.form-card {
    width: min(100%, 520px);
    padding: clamp(24px, 5vw, 38px);
}

.form-card h1 {
    margin: 0 0 5px;
    font-size: 1.9rem;
}

.form-intro {
    margin: 0 0 24px;
    color: #5c6678;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.field {
    margin-bottom: 16px;
}

.form-grid .field {
    margin-bottom: 0;
}

.field-full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: #273449;
    font-size: .94rem;
    font-weight: 700;
}

.field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.field select:focus {
    border-color: #0d6efd;
    outline: 3px solid rgb(13 110 253 / 15%);
}

.field input:focus {
    border-color: #0d6efd;
    outline: 3px solid rgb(13 110 253 / 15%);
}

.field input[aria-invalid="true"],
.checkbox-field input[aria-invalid="true"] {
    border-color: #b42318;
}

.field-error {
    display: block;
    min-height: 0;
    margin-top: 4px;
    color: #b42318;
    font-size: .85rem;
}

.field-error:empty {
    display: none;
}

.password-hint {
    display: block;
    margin-top: 4px;
    color: #5c6678;
    font-size: .85rem;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 18px 0;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 3px;
    accent-color: #0d6efd;
}

.checkbox-field label {
    color: #4b5565;
    font-size: .93rem;
}

.password-wrap {
    display: flex;
    gap: 8px;
}

.password-wrap input {
    min-width: 0;
}

.password-toggle {
    flex: 0 0 auto;
    padding-inline: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #273449;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 20px;
    font-size: .92rem;
}

.form-options .checkbox-field {
    margin: 0;
}

.form-options .checkbox-field label {
    font-size: .92rem;
}

.form-submit {
    width: 100%;
}

.form-footer {
    margin: 20px 0 0;
    color: #5c6678;
    text-align: center;
}

.home-return {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid #e3eaf3;
    text-align: center;
}

.home-return a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #b8d2f5;
    border-radius: 8px;
    background: #f0f7ff;
    color: #084298;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.home-return a:hover,
.home-return a:focus-visible {
    transform: translateY(-1px);
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
}

.home-return a:focus-visible {
    outline: 3px solid rgb(13 110 253 / 25%);
    outline-offset: 2px;
}

.alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #f1b8b5;
    border-radius: 8px;
    background: #fff1f0;
    color: #8f1d17;
}

.alert-success {
    border-color: #a7d9bd;
    background: #edfbf2;
    color: #17653a;
}

.dashboard-card {
    padding: clamp(24px, 5vw, 40px);
}

.dashboard-card h1 {
    margin: 0 0 8px;
}

.dashboard-card p {
    color: #5c6678;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.stat-card {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border: 1px solid #dce8f8;
    border-radius: 12px;
    background: #f5f9ff;
    color: #43516a;
}

.stat-card strong {
    color: #084298;
    font-size: 2rem;
    line-height: 1;
}

.student-management {
    margin-top: 38px;
}

.student-management .section-heading {
    margin-top: 0;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 240px) auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e3eaf3;
    border-radius: 12px;
    background: #f8faff;
}

.filter-form .field {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e3eaf3;
    border-radius: 12px;
}

.student-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    text-align: left;
}

.student-table th,
.student-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8edf4;
    vertical-align: middle;
}

.student-table th {
    background: #f5f8fc;
    color: #34425a;
    font-size: .9rem;
    white-space: nowrap;
}

.student-table tbody tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.status-active {
    background: #e8f7ee;
    color: #17653a;
}

.status-inactive {
    background: #fff1f0;
    color: #8f1d17;
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: .85rem;
}

.button-danger {
    background: #b42318;
}

.button-danger:hover {
    background: #912018;
}

.button-success {
    background: #198754;
}

.button-success:hover {
    background: #146c43;
}

.empty-state {
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #5c6678;
    text-align: center;
}

.profile-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    margin: 24px 0 0;
}

.profile-list div {
    padding: 14px 0;
    border-bottom: 1px solid #e8edf4;
}

.profile-list dt {
    color: #5c6678;
    font-size: .88rem;
    font-weight: 700;
}

.profile-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

.button-secondary {
    border-color: #cbd5e1;
    background: #fff;
    color: #273449;
}

.site-footer {
    padding-block: 20px;
    color: #6b7280;
    font-size: .9rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 640px) {
    .header-inner,
    .page-container,
    .footer-inner {
        width: min(100% - 28px, 1120px);
    }

    .header-inner {
        min-height: 66px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding-block: 10px;
    }

    .header-nav {
        gap: 14px;
        font-size: .92rem;
    }

    .page-container {
        padding-block: 24px 42px;
    }

    .module-grid,
    .form-grid,
    .profile-list {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }

    .section-heading {
        margin-top: 34px;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
    }
}
