:root {
    --ip-primary: #1A3A6B;
    --ip-primary-dark: #0F2447;
    --ip-accent: #4BB8E8;
    --ip-accent-light: #E8F4FC;
    --ip-bg: #F5F7FA;
    --ip-surface: #FFFFFF;
    --ip-surface-soft: #F8FAFC;
    --ip-border: #E2E8F0;
    --ip-text-primary: #0F172A;
    --ip-text-secondary: #64748B;
    --ip-text-muted: #94A3B8;
    --ip-success: #22C55E;
    --ip-success-bg: #DCFCE7;
    --ip-success-text: #15803D;
    --ip-warning: #F59E0B;
    --ip-warning-bg: #FEF3C7;
    --ip-warning-text: #92400E;
    --ip-danger: #EF4444;
    --ip-danger-bg: #FEE2E2;
    --ip-danger-text: #991B1B;
    --ip-info-bg: #E8F4FC;
    --ip-info-text: #1A3A6B;
    --ip-gray-bg: #F1F5F9;
    --ip-gray-text: #475569;
    --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --admin-sidebar-width: 220px;
}

[data-theme="dark"] {
    --ip-bg: #0B1220;
    --ip-surface: #111827;
    --ip-surface-soft: #172033;
    --ip-border: #263248;
    --ip-text-primary: #F8FAFC;
    --ip-text-secondary: #CBD5E1;
    --ip-text-muted: #94A3B8;
    --ip-accent-light: rgba(75, 184, 232, 0.14);
    --ip-info-bg: rgba(75, 184, 232, 0.14);
    --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--ip-bg);
    color: var(--ip-text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.student-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.student-page--form {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 10%, rgba(75, 184, 232, 0.12), transparent 28%),
        radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.08), transparent 30%),
        radial-gradient(circle at 48% 92%, rgba(26, 58, 107, 0.06), transparent 34%),
        linear-gradient(180deg, #F7FAFF 0%, var(--ip-bg) 48%, #F8FAFC 100%);
}

.student-page--form::before,
.student-page--form::after {
    content: "";
    position: fixed;
    inset: 76px 0 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.72;
    transform: translate3d(0, 0, 0);
}

.student-page--form::before {
    background:
        radial-gradient(circle at 18% 34%, rgba(75, 184, 232, 0.14) 0 2px, transparent 3px),
        radial-gradient(circle at 76% 28%, rgba(26, 58, 107, 0.11) 0 2px, transparent 3px),
        radial-gradient(circle at 68% 70%, rgba(75, 184, 232, 0.1) 0 1px, transparent 2px),
        linear-gradient(115deg, transparent 0 28%, rgba(26, 58, 107, 0.04) 28.2% 28.45%, transparent 28.7% 100%),
        linear-gradient(35deg, transparent 0 64%, rgba(75, 184, 232, 0.05) 64.2% 64.45%, transparent 64.7% 100%);
    background-size: 420px 260px, 520px 320px, 360px 260px, 760px 420px, 680px 380px;
    animation: form-bg-drift 34s ease-in-out infinite alternate;
}

.student-page--form::after {
    background:
        radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.86), transparent 16%),
        radial-gradient(circle at 72% 42%, rgba(75, 184, 232, 0.1), transparent 18%),
        radial-gradient(circle at 36% 72%, rgba(26, 58, 107, 0.06), transparent 18%);
    filter: blur(18px);
    animation: form-bg-breathe 28s ease-in-out infinite alternate;
}

.student-page--form .student-main {
    position: relative;
    z-index: 1;
    animation: form-page-enter 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.student-main {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 16px 96px;
    flex: 1;
}

.student-page--dashboard {
    background:
        radial-gradient(circle at 16% 10%, rgba(75, 184, 232, 0.14), transparent 26%),
        radial-gradient(circle at 84% 8%, rgba(53, 109, 255, 0.10), transparent 24%),
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.86), transparent 34%),
        linear-gradient(180deg, #F8FBFF 0%, #F6F9FF 28%, #F7FAFF 100%);
}

.student-page--success {
    background:
        radial-gradient(circle at top center, rgba(75, 184, 232, 0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(26, 58, 107, 0.08), transparent 28%),
        radial-gradient(circle at right center, rgba(245, 158, 11, 0.07), transparent 24%),
        linear-gradient(180deg, #F7F9FC 0%, #F7F9FC 100%);
}

.student-page--dashboard .student-main {
    max-width: 1280px;
    padding: 40px 24px 120px;
}

.student-main--success {
    max-width: 1280px;
    padding: 18px 24px 80px;
}

.admin-shell {
    min-height: 100vh;
    background: var(--ip-bg);
}

.admin-main {
    min-height: 100vh;
    margin-left: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
}

.admin-content {
    flex: 1;
    padding: 24px;
}

.student-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--ip-primary);
    color: #FFFFFF;
    padding: 16px;
}

.student-header__inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.student-page--dashboard .student-header {
    position: sticky;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ip-text-primary);
    padding: 22px 24px;
    backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.82);
    box-shadow: 0 10px 40px rgba(137, 169, 232, 0.08);
}

.student-page--dashboard .student-header__inner {
    max-width: 1280px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark__logo {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: var(--radius-md);
    background: #FFFFFF;
    padding: 5px;
}

.brand-mark__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-mark__title,
.brand-mark__subtitle {
    display: block;
    line-height: 1.1;
}

.brand-mark__title {
    font-size: 13px;
    font-weight: 700;
}

.brand-mark__subtitle {
    margin-top: 3px;
    color: var(--ip-accent);
    font-size: 10px;
    font-weight: 600;
}

.student-page--dashboard .brand-mark__logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(26, 58, 107, 0.08);
}

.student-page--dashboard .brand-mark__title {
    font-size: 18px;
    font-weight: 800;
}

.student-page--dashboard .brand-mark__subtitle {
    font-size: 14px;
    color: #356DFF;
}

.brand-mark--dark {
    color: #FFFFFF;
}

.avatar-pill,
.admin-shield,
.icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
}

.avatar-pill,
.admin-shield {
    background: var(--ip-accent-light);
    color: var(--ip-primary);
    font-size: 12px;
    font-weight: 700;
}

.student-header__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.student-header__nav {
    display: none;
}

.student-header__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--ip-text-secondary);
    font-size: 14px;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 160ms ease, border-color 160ms ease;
}

.student-header__link i {
    font-size: 18px;
}

.student-header__link:hover,
.student-header__link.is-active {
    color: #2563EB;
}

.student-header__link.is-active {
    border-bottom-color: #2563EB;
}

.student-header__profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ip-text-secondary);
}

.student-header__profile i {
    font-size: 18px;
}

.student-header__notify {
    border-radius: 999px;
}

.student-header__logout {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
    transition: background-color 160ms ease, transform 160ms ease;
}

.student-header__logout:hover {
    background: rgba(255, 255, 255, 0.18);
}

.student-header__logout:active {
    transform: scale(0.98);
}

.student-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    border-top: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -14px 40px rgba(148, 163, 184, 0.14);
}

.student-bottom-nav__inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-bottom-nav__item {
    display: inline-flex;
    position: relative;
    min-height: 86px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--ip-text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: color 180ms ease, transform 180ms ease;
}

.student-bottom-nav__item i {
    font-size: 24px;
}

.student-bottom-nav__item::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: 10px;
    left: 24px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #356DFF 0%, #6AA0FF 100%);
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.student-bottom-nav__item.is-active {
    color: var(--ip-primary);
}

.student-bottom-nav__item.is-active::after {
    transform: scaleX(1);
    opacity: 1;
}

@media (min-width: 901px) {
    .student-page--dashboard .student-header__nav {
        display: inline-flex;
        align-items: center;
        gap: 26px;
        margin-left: auto;
        margin-right: 12px;
    }

    .student-bottom-nav {
        display: none;
    }
}

.admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: var(--admin-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--ip-primary-dark);
}

.admin-sidebar__brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 12px;
}

.admin-sidebar__footer {
    display: grid;
    gap: 8px;
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.admin-sidebar__theme {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    width: 100%;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: #94A3B8;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
}

.admin-sidebar__theme i {
    font-size: 19px;
}

.admin-sidebar__theme:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    color: #94A3B8;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-sidebar__link i {
    font-size: 19px;
}

.admin-sidebar__link:hover,
.admin-sidebar__link.is-active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar__link.is-active {
    color: var(--ip-accent);
    border-left: 2px solid var(--ip-accent);
    background: rgba(75, 184, 232, 0.14);
}

.admin-sidebar__link--danger:hover {
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.12);
}

.admin-sidebar__group {
    display: grid;
    gap: 4px;
}

.admin-sidebar__chevron {
    margin-left: auto;
    font-size: 14px !important;
}

.admin-sidebar__submenu {
    display: grid;
    gap: 2px;
    margin-left: 28px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-sidebar__sublink {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: #94A3B8;
    font-size: 12px;
    font-weight: 650;
    transition: background-color 160ms ease, color 160ms ease;
}

.admin-sidebar__sublink:hover,
.admin-sidebar__sublink.is-active {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar__sublink.is-active {
    color: var(--ip-accent);
}

.admin-topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--ip-border);
    background: var(--ip-surface);
}

.admin-topbar h1 {
    margin: 0;
    color: var(--ip-text-primary);
    font-size: 17px;
    font-weight: 700;
}

.admin-topbar p {
    margin: 4px 0 0;
    color: var(--ip-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.admin-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-shell {
    width: min(100%, 390px);
}

.auth-brand {
    margin-bottom: 28px;
    text-align: center;
}

.auth-brand__logo {
    width: 68px;
    height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: var(--radius-xl);
    background: var(--ip-primary);
    padding: 10px;
    box-shadow: var(--shadow-card);
}

.auth-brand h1 {
    margin: 0;
    color: var(--ip-text-primary);
    font-size: 24px;
    font-weight: 800;
}

.auth-brand p,
.auth-admin-link {
    color: var(--ip-text-secondary);
    font-size: 13px;
}

.auth-brand p {
    margin: 5px 0 0;
}

.auth-admin-link {
    margin: 18px 0 0;
    text-align: center;
}

.auth-admin-link a {
    color: var(--ip-accent);
    font-weight: 700;
}

.auth-admin-link a:hover {
    color: var(--ip-primary);
}

.icon-button {
    cursor: pointer;
    color: var(--ip-text-secondary);
    background: var(--ip-surface);
    border-color: var(--ip-border);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
    color: var(--ip-primary);
    background: var(--ip-accent-light);
}

.icon-button:active {
    transform: scale(0.98);
}

@media (max-width: 900px) {
    .student-page--dashboard .student-main {
        padding: 24px 16px 110px;
    }

    .student-page--dashboard .student-header {
        padding: 16px;
    }

    .student-page--dashboard .student-header__inner {
        max-width: 820px;
        gap: 14px;
    }

    .student-page--dashboard .student-header__nav {
        display: none;
    }

    .student-page--dashboard .brand-mark {
        gap: 12px;
    }

    .student-page--dashboard .brand-mark__logo {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        padding: 5px;
        box-shadow: 0 16px 30px rgba(26, 58, 107, 0.12);
    }

    .student-page--dashboard .brand-mark__title {
        font-size: 16px;
    }

    .student-page--dashboard .brand-mark__subtitle {
        font-size: 13px;
        margin-top: 2px;
    }

    .student-header__notify,
    .student-header__profile .avatar-pill {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .student-header__profile {
        gap: 8px;
    }

    .student-header__profile i,
    .student-header__notify i {
        font-size: 18px;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-topbar {
        min-height: 64px;
        padding: 14px 16px;
    }
}

@media (min-width: 901px) {
    .student-main,
    .student-header__inner,
    .student-bottom-nav__inner {
        max-width: 1120px;
    }

    .student-main {
        padding-right: 28px;
        padding-left: 28px;
    }

    .student-main--success {
        max-width: 1280px;
    }
}

@media (min-width: 1024px) {
    .student-page--dashboard .student-main {
        max-width: 1100px;
        padding: 24px 24px 88px;
    }

    .student-page--dashboard .student-header {
        padding: 8px 24px;
    }

    .student-page--dashboard .student-header__inner {
        max-width: 1100px;
        min-height: 52px;
    }

    .student-page--dashboard .brand-mark__logo {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }

    .student-page--dashboard .brand-mark__title {
        font-size: 16px;
    }

    .student-page--dashboard .brand-mark__subtitle {
        font-size: 12px;
    }
}
