/* Student-side UI layer, loaded after Bootstrap */

:root {
    --brand: #d6943e;
    --brand-dark: #c98a38;
    --brand-soft: #e6f0ec;
    --accent: #7e0000;
    --accent-dark: #6a0303;
    --btn: #ffc107;
    --btn-dark: #d5a106;
    --accent-soft: #fbf1e6;
    --accent-ring: rgba(138, 74, 15, .2);
    --notice-bg: #1f2937;
    --ink: #1f2430;
    --muted: #6c757d;
    --line: #e3e7ec;
    --page-bg: #f5f7fa;
    --mobile-btn: #d97706;
    --mobile-btn-dark: #b45309;
    --font: "Plus Jakarta Sans", "Hind", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
    background: var(--page-bg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body, h1, h2, h3, h4, h5, h6, p, a, li, td, th, label,
.btn, input, select, textarea, button, .form-control, .form-select {
    font-family: var(--font);
}
.site-main {
    flex: 1 0 auto;
}

/* The theme adds a sweeping ::before on every .btn; keep Bootstrap buttons clean */
.btn::before {
    display: none;
}

/* Dashboard buttons follow the portal palette */
.btn-warning,
.btn-warning:disabled {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
    color: #fff !important;
}
.btn-primary,
.btn-primary:disabled {
    background: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
}

/* ---------- Header ---------- */
.notice-bar {
    background: var(--notice-bg);
    color: #fff;
    font-size: 13px;
    padding: 5px 0;
}
.notice-bar marquee {
    min-width: 0;
}
.notice-bar .header-info-left p {
    margin: 0;
    line-height: 1.6;
    font-size: 13px;
}
.notice-bar .header-info-left {
    font-size: 13px;
    line-height: 1.6;
    white-space: nowrap;
}
.notice-bar .notice-sep {
    color: #fbbf24;
    margin: 0 14px;
    font-size: 10px;
    vertical-align: middle;
}
.notice-badge {
    flex-shrink: 0;
    background: #c62828;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.notice-clock {
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    font-family: monospace;
    font-size: 13px;
    opacity: .9;
}

.site-nav {
    background: var(--brand);
    padding: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 75%;
    color: #fff;
    line-height: 1.2;
    white-space: normal;
}
.site-brand .brand-logo {
    flex-shrink: 0;
    width: auto;
    height: 56px;
    object-fit: contain;
}
.site-brand .brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.site-brand:hover,
.site-brand:focus {
    color: #fff;
}
.site-brand .brand-title {
    font-weight: 700;
    font-size: 1.05rem;
}
.site-brand .brand-sub {
    font-size: .8rem;
    opacity: .85;
}
.site-nav .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, .5);
    color: #fff;
    font-size: 1.5rem;
    padding: 2px 10px;
}
.site-nav .navbar-toggler:focus {
    box-shadow: none;
}
.site-nav .nav-link {
    color: rgba(255, 255, 255, .88);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 14px !important;
    border-radius: 6px;
}
.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}
.site-nav .nav-link.active {
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--accent);
    border-radius: 0;
}
.site-nav .nav-signout {
    background: var(--accent);
    color: #fff;
    margin-left: 6px;
}
.site-nav .nav-signout:hover {
    background: var(--accent-dark);
}

/* ---------- Hero ---------- */
.site-hero {
    background: linear-gradient(180deg, #fff 0%, var(--page-bg) 100%);
    border-bottom: 1px solid var(--line);
    padding: 24px 0 22px;
}
.site-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-soft);
    border: 1px solid #cfe0d8;
    color: var(--brand);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.site-hero .hero-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
}
.site-hero .hero-title {
    color: var(--brand);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.5px;
    font-size: clamp(1.3rem, 4.2vw, 2.75rem);
    line-height: 1.15;
    margin-bottom: 6px;
}
.site-hero .hero-subtitle {
    color: var(--ink);
    font-weight: 1000;
    font-size: clamp(1.1rem, 3.2vw, 1.9rem);
    margin-bottom: 14px;
}
.site-hero .hero-pill {
    display: inline-block;
    background: var(--accent);
    border: 2px solid var(--accent-dark);
    color: #fff;
    font-weight: 600;
    padding: 4px 22px;
    border-radius: 10px;
    font-size: 13px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, .85);
    padding: 28px 0;
    margin-top: 40px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.footer-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}
.footer-sub {
    font-size: .9rem;
    margin-bottom: 6px;
}
.footer-copy {
    font-size: .85rem;
    opacity: .85;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    padding: 0;
    margin: 0;
}
.footer-links li {
    list-style: none;
}
.footer-links a {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}
.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ---------- Cards ---------- */
.section-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    overflow: hidden;
}
.section-card > .card-header {
    background-color: var(--accent);
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    border: 0;
}
.portal-card > .card-header {
    text-align: left;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.portal-card > .card-body {
    padding: 20px 18px;
}

/* ---------- Home page ---------- */
.portal-home .form-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}
.portal-home .input-group-text {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-color: #ddd;
}
.portal-home .form-control {
    min-height: 40px;
    border-color: #ddd;
}
.portal-home .input-group > :first-child {
    border-radius: 3px 0 0 3px;
}
.portal-home .input-group > .form-control {
    border-radius: 0 3px 3px 0;
}
.portal-home .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem var(--accent-ring);
}
.btn-portal {
    background: var(--btn);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 3px;
    border: 0;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-portal:hover,
.btn-portal:focus,
.btn-portal:active {
    background: var(--btn-dark) !important;
    color: #fff !important;
}
.btn-portal:disabled {
    background: var(--btn-dark);
    color: #fff;
    opacity: .7;
}

.otp-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.otp-sent {
    font-weight: 600;
    color: var(--ink);
}
.otp-sent.small {
    font-weight: 400;
    color: var(--muted);
}
.portal-home .otp-container {
    margin: 16px 0 4px;
}
.portal-home .otp-form {
    gap: 8px;
}
.portal-home .otp-input {
    width: 44px;
    height: 50px;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    border: 1.5px solid #ccc;
    border-radius: 8px;
}
.portal-home .otp-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem var(--accent-ring);
}
.resend-link,
.resend-link:hover {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration: none;
}
.forgot_password,
.forgot_password:hover {
    color: var(--brand);
    font-weight: 500;
    text-decoration: none;
}
.portal-note {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
}
.registration-success h1 {
    color: #198754;
    font-size: 1.4rem;
    font-weight: 700;
}
.registration-success p {
    line-height: 1.6;
}

.instructions-box {
    background: #f8fafc;
    border-top: 1px solid var(--line);
    padding: 14px 18px;
}
.instructions-box .instructions-title {
    color: #c62828;
    font-weight: 600;
    margin-bottom: 8px;
}
.instructions-box ul {
    padding-left: 1.2rem;
}
.instructions-box li {
    list-style: disc;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.instruction-list {
    counter-reset: step;
    padding: 0;
}
.instruction-list > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 12px 40px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0ece6;
    line-height: 1.6;
}
.instruction-list > li:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}
.instruction-list > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.instruction-list p {
    margin: 0;
    line-height: 1.6;
    font-size: 15px;
    color: var(--ink);
}

.mobile-tabs {
    display: flex;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.mobile-tab {
    flex: 1;
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}
.mobile-tab i {
    font-size: 1.2rem;
}
.mobile-tab.active {
    color: var(--brand);
    background: var(--brand-soft);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

/* ---------- Dashboard ---------- */
.student-details {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 12px 16px;
}
.student-details .row,
.student-details .info-item {
    margin-bottom: 0;
}
.student-details .info-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.student-details .info-value {
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}

.stats-table {
    margin-bottom: 0;
    text-align: center;
    font-size: 14px;
}
.stats-table th {
    background: var(--accent-soft);
    white-space: nowrap;
}

.listbox-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 0;
}
.listbox-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
    min-height: 32px;
}
.info-tip {
    color: var(--brand);
    font-size: 1.15rem;
    line-height: 1;
    text-decoration: none;
}
.info-tip:hover,
.info-tip:focus {
    color: var(--brand-dark);
}
.info-popover {
    max-width: 300px;
    font-size: 14px;
    line-height: 1.6;
}
.info-popover .popover-header {
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.info-popover li {
    list-style: disc;
    margin-bottom: 4px;
}
.listbox {
    width: 100%;
    height: 340px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}
.listbox:empty::before {
    content: attr(data-placeholder);
    display: block;
    padding: 24px 12px;
    text-align: center;
    color: var(--muted);
}
.listbox .list-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}
.listbox .list-item.selected {
    background: var(--muted);
    color: #fff;
}
.listbox.disabled {
    background: #f1f1f1;
}
.listbox.disabled .list-item {
    cursor: default;
}
.listbox .list-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    font-size: 13px;
    color: var(--muted);
}
.listbox .list-loader .spinner-border {
    color: var(--accent);
}
.list-arrows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.list-arrows .btn {
    min-width: 48px;
    min-height: 44px;
}
.action-bar .btn {
    min-width: 140px;
}

/* ---------- Tablet & mobile ---------- */
@media (max-width: 991.98px) {
    .home-col {
        display: none;
    }
    .home-col.is-active {
        display: block;
    }

    .site-nav .navbar-collapse {
        margin-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, .2);
        padding-top: 6px;
    }
    .site-nav .nav-link.active {
        box-shadow: inset 3px 0 0 var(--accent);
    }
    .site-nav .nav-signout {
        margin: 6px 0 0;
        display: inline-block;
    }
}

@media (max-width: 991.98px) {
    /* Mobile mockup: rounded orange action buttons */
    .btn-portal {
        background: var(--mobile-btn);
        border-radius: 8px;
        box-shadow: 0 3px 8px rgba(217, 119, 6, .3);
    }
    .btn-portal:hover,
    .btn-portal:focus,
    .btn-portal:active {
        background: var(--mobile-btn-dark) !important;
    }
    .btn-portal:disabled {
        background: var(--mobile-btn);
    }
    .portal-home .input-group > :first-child {
        border-radius: 8px 0 0 8px;
    }
    .portal-home .input-group > .form-control {
        border-radius: 0 8px 8px 0;
    }
}

@media (max-width: 767.98px) {
    .site-brand .brand-logo {
        width: auto;
        height: 44px;
    }
    .site-hero .hero-badge {
        font-size: 11.5px;
        margin-bottom: 10px;
    }
    .site-hero .hero-pill {
        display: block;
    }
    .site-footer {
        text-align: center;
        padding: 22px 0;
    }
    .footer-inner {
        flex-direction: column;
    }
    .footer-links {
        justify-content: center;
    }
    .site-brand .brand-title {
        font-size: .95rem;
    }
    .site-brand .brand-sub {
        font-size: .75rem;
    }
    .site-hero {
        padding: 16px 0 14px;
    }

    .portal-home .otp-input {
        width: 40px;
        height: 46px;
    }

    .listbox-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .listbox {
        height: 260px;
    }
    .list-arrows {
        flex-direction: row;
        justify-content: center;
    }
    /* Arrows point down (add) / up (remove) when lists are stacked */
    .list-arrows .fa {
        transform: rotate(90deg);
    }
    .list-arrows .btn {
        flex: 1;
    }

    .action-bar .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .modal-body .card-header {
        font-size: 14px;
    }
}
