:root {
    --portal-blue: #123d75;
    --portal-blue-dark: #092a54;
    --portal-cyan: #12a6b8;
    --portal-gold: #f2b544;
    --portal-bg: #f3f6fa;
    --portal-border: #dce4ee;
    --portal-text: #172b43;
}

html {
    min-width: 320px;
    min-height: 100%;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: var(--portal-text);
    background:
        radial-gradient(circle at 8% 8%, rgba(18, 166, 184, .08), transparent 25rem),
        var(--portal-bg);
}

.site-header {
    color: #082d3e;
    background: #fff;
    border-top: 1px solid #eadfed;
    border-bottom: 1px solid #edf0f2;
    box-shadow: 0 4px 16px rgba(18, 45, 60, .04);
}

.header-container {
    max-width: 1480px;
}

.header-layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr) auto;
    min-height: 110px;
    align-items: center;
    gap: 1.3rem;
}

.ministry-logo {
    display: block;
    padding-right: 1.3rem;
    border-right: 2px solid #dde2e5;
}

.ministry-logo img {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
}

.department-name h1 {
    margin: 0 0 .3rem;
    color: #032c3e;
    font-size: clamp(1.05rem, 1.35vw, 1.4rem);
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.department-name p {
    margin: 0;
    color: #5c7a85;
    font-size: 1.05rem;
}

.header-action {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: .65rem 1.25rem;
    color: #fff;
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    background: #174a85;
    border: 3px solid #3979ba;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(23, 74, 133, .16);
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.header-action:hover,
.header-action:focus-visible {
    color: #fff;
    background: #0f3768;
    transform: translateY(-1px);
}

.header-action-closed,
.header-action-closed:hover {
    color: #fff;
    cursor: default;
    background: #68798b;
    border-color: #aeb9c4;
    box-shadow: none;
    transform: none;
}

.header-action:focus-visible {
    outline: 3px solid rgba(18, 61, 117, .25);
    outline-offset: 3px;
}

.main-content {
    width: 100%;
    max-width: 1120px;
    flex: 1 1 auto;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.system-title {
    max-width: 960px;
    margin: 0 auto 1.25rem;
    padding: .5rem 1.5rem;
    text-align: center;
}

.system-title h2 {
    margin: 0;
    color: var(--portal-blue);
    font-size: clamp(1.15rem, 2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.system-title h2 span {
    display: block;
    margin-top: .25rem;
    color: #3979ba;
}

.portal-card {
    overflow: hidden;
    border: 1px solid rgba(220, 228, 238, .92);
    border-radius: 1.15rem;
    box-shadow: 0 14px 36px rgba(27, 54, 85, .08);
}

.portal-card-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, #fff, #f8fbfe);
    border-bottom-color: var(--portal-border);
}

.closed-system-card {
    max-width: 720px;
    margin-right: auto;
    margin-left: auto;
}

.closed-system-icon {
    display: grid;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.25rem;
    place-items: center;
    color: #fff;
    font-size: 2rem;
    background: #68798b;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(50, 70, 90, .16);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.step-badge {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    place-items: center;
    color: #fff;
    font-weight: 800;
    background: var(--portal-blue);
    border-radius: .8rem;
}

.step-complete {
    background: #16825d;
}

.input-group-text {
    color: var(--portal-blue);
    background: #edf5fc;
    border-color: #cbd8e6;
}

.form-control,
.form-select {
    border-color: #cbd8e6;
}

.form-control:focus,
.form-select:focus {
    border-color: #65a3d8;
    box-shadow: 0 0 0 .25rem rgba(18, 61, 117, .13);
}

.ts-wrapper.form-select {
    height: auto;
    padding: 0;
    border: 0;
}

.ts-wrapper.form-select-lg .ts-control {
    min-height: 3.25rem;
    align-items: center;
    padding: .75rem 2.5rem .75rem 1rem;
    font-size: 1rem;
    border-color: #cbd8e6;
    border-radius: var(--bs-border-radius-lg);
}

.ts-wrapper.focus .ts-control {
    border-color: #65a3d8;
    box-shadow: 0 0 0 .25rem rgba(18, 61, 117, .13);
}

.ts-dropdown {
    z-index: 1080;
    overflow: hidden;
    border-color: #b9c9da;
    border-radius: .65rem;
    box-shadow: 0 12px 30px rgba(20, 49, 79, .16);
}

.ts-dropdown .dropdown-input-wrap {
    padding: .75rem;
    background: #f3f7fb;
    border-bottom: 1px solid #dce4ee;
}

.ts-dropdown .dropdown-input {
    min-height: 2.75rem;
    padding: .6rem .8rem;
    border: 1px solid #aebfd1;
    border-radius: .5rem;
    outline: 0;
}

.ts-dropdown .dropdown-input:focus {
    border-color: #3979ba;
    box-shadow: 0 0 0 .2rem rgba(57, 121, 186, .14);
}

.ts-dropdown-content {
    max-height: 18rem;
}

.ts-dropdown .option {
    padding: .7rem .85rem;
    line-height: 1.35;
}

.ts-dropdown .active {
    color: #fff;
    background: #174a85;
}

.ts-dropdown .no-results {
    padding: 1rem;
    color: #68798b;
    text-align: center;
}

.ts-wrapper.disabled .ts-control {
    color: #7a8794;
    background: #e9ecef;
    opacity: 1;
}

.btn-primary {
    --bs-btn-bg: var(--portal-blue);
    --bs-btn-border-color: var(--portal-blue);
    --bs-btn-hover-bg: var(--portal-blue-dark);
    --bs-btn-hover-border-color: var(--portal-blue-dark);
}

@media (min-width: 992px) {
    .check-button-column {
        padding-top: 2rem;
    }
}

.student-details > div {
    padding: 1rem 1.15rem;
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: .85rem;
}

.detail-label {
    display: block;
    margin-bottom: .35rem;
    color: #60728a;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.detail-value {
    display: inline;
    line-height: 1.55;
}

.code-badge {
    margin-left: .35rem;
    color: var(--portal-blue) !important;
    vertical-align: .1rem;
}

.choice-card {
    min-width: 0;
    padding: 1.4rem;
    background: #fbfcfe;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
}

.choice-card legend {
    float: none;
    width: auto;
    margin: 0 0 1.4rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.choice-number {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    margin-right: .45rem;
    place-items: center;
    color: var(--portal-blue);
    background: #e5f1fb;
    border-radius: 50%;
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    color: #536674;
    background: #fff;
    border-top: 1px solid var(--portal-border);
}

.loading-overlay {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    padding: 1.25rem;
    place-items: center;
    background: rgba(9, 28, 50, .66);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.swal2-container {
    z-index: 3000 !important;
}

.loading-card {
    width: min(100%, 22rem);
    padding: 2rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.loading-card .spinner-border {
    width: 3rem;
    height: 3rem;
}

body.is-loading {
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .header-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .header-action {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 575.98px) {
    .site-header .container {
        padding-right: 1.15rem;
        padding-left: 1.15rem;
    }

    .header-layout {
        grid-template-columns: 1fr;
        gap: .85rem;
        padding-top: 1.1rem;
        padding-bottom: 1.1rem;
        text-align: center;
    }

    .ministry-logo {
        padding: 0 0 .9rem;
        border-right: 0;
        border-bottom: 1px solid #dde2e5;
    }

    .ministry-logo img {
        max-width: 205px;
        margin: 0 auto;
    }

    .department-name h1 {
        font-size: 1rem;
    }

    .department-name p {
        font-size: .92rem;
    }

    .header-action {
        grid-column: auto;
        width: 100%;
        padding-right: .9rem;
        padding-left: .9rem;
        font-size: .78rem;
    }

    .system-title {
        margin-bottom: .8rem;
        padding: .25rem;
    }

    .system-title h2 {
        font-size: 1.05rem;
    }

    .site-footer {
        font-size: .78rem;
        line-height: 1.6;
    }

    .portal-card,
    .choice-card {
        border-radius: .85rem;
    }

    .portal-card-header {
        padding: 1rem;
    }

    .choice-card {
        padding: 1rem;
    }

    .form-select-lg,
    .form-control-lg,
    .input-group-lg > .form-control,
    .input-group-lg > .input-group-text {
        min-height: 3.25rem;
        font-size: 1rem;
    }

    .btn-lg {
        min-height: 3.25rem;
        font-size: 1rem;
    }
}

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