/* ============================================================
   app.css — KKHSOU Convocation Learner Portal
   Professional theme: Clean white + Maroon accent + Gold
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --brand:        #7B1D2A;
    --brand-hover:  #5E1520;
    --brand-light:  #f8ebed;
    --brand-gold:   #C9A02A;
    --text-dark:    #1a1e2d;
    --text-muted:   #6c757d;
    --border:       #e2e6ea;
    --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:    0 4px 12px rgba(0,0,0,.08);
    --radius:       8px;

    --bs-primary:           #7B1D2A;
    --bs-primary-rgb:       123,29,42;
    --bs-link-color:        #7B1D2A;
    --bs-link-hover-color:  #5E1520;
    --bs-border-radius:     8px;
    --bs-body-bg:           #F4F6F9;
    --bs-body-color:        #1a1e2d;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    background: #F4F6F9;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1a1e2d;
    font-size: 15px;
}
a { color: #7B1D2A; }
a:hover { color: #5E1520; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { border-radius: 6px; font-weight: 500; letter-spacing: .01em; }
.btn-primary {
    background: #7B1D2A !important;
    border-color: #7B1D2A !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: #5E1520 !important;
    border-color: #5E1520 !important;
    box-shadow: 0 0 0 .2rem rgba(123,29,42,.25) !important;
}
.btn-outline-primary {
    color: #7B1D2A !important;
    border-color: #7B1D2A !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: #7B1D2A !important;
    color: #fff !important;
}
.btn-lg { padding: .6rem 1.5rem; font-size: 1rem; }

/* ── Utilities ──────────────────────────────────────────────── */
.text-primary   { color: #7B1D2A !important; }
.text-brand     { color: #7B1D2A !important; }
.bg-primary     { background: #7B1D2A !important; }
.border-primary { border-color: #7B1D2A !important; }

/* ── Navbar ─────────────────────────────────────────────────── */
.site-navbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    padding: 0;
}
.site-navbar .container { min-height: 64px; }
.site-navbar .navbar-brand { padding: 10px 0; }
.site-navbar .navbar-toggler { border: none; padding: 6px; }
.site-navbar .navbar-toggler:focus { box-shadow: none; }
.site-navbar .nav-link {
    color: #444 !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px !important;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.site-navbar .nav-link:hover { background: #f5f5f5; color: #7B1D2A !important; }
.site-navbar .nav-link.active { color: #7B1D2A !important; font-weight: 600; }
.site-navbar .btn-nav-cta {
    background: #7B1D2A;
    color: #fff !important;
    padding: 7px 18px !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}
.site-navbar .btn-nav-cta:hover { background: #5E1520; }

/* ── Page hero / header strip ────────────────────────────────── */
.page-hero {
    background: linear-gradient(135deg, #7B1D2A 0%, #9B2535 100%);
    color: #fff;
    padding: 20px 0;
    margin-bottom: 28px;
}
.page-hero h1, .page-hero h2 { color: #fff; font-size: 1.4rem; margin: 0; font-weight: 600; }
.page-hero p { color: rgba(255,255,255,.8); margin: 4px 0 0; font-size: 13px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    border: 1px solid #e8ecf0;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f3;
    font-weight: 600;
    padding: 14px 20px;
}
.card.form-card     { border-top: 3px solid #7B1D2A !important; }
.card.form-card .card-body { padding: 28px 32px; }

/* ── Form controls ───────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: 14px; color: #374151; margin-bottom: 5px; }
.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: 6px;
    font-size: 14.5px;
    padding: .45rem .75rem;
}
.form-control:focus, .form-select:focus {
    border-color: #7B1D2A;
    box-shadow: 0 0 0 .2rem rgba(123,29,42,.12);
}

/* ── Step indicator ──────────────────────────────────────────── */
.step-indicator {
    display: flex;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}
.step-indicator .step {
    flex: 1; text-align: center; padding: 12px 8px;
    font-size: 13px; color: #9ca3af; font-weight: 500;
    border-right: 1px solid #e8ecf0; position: relative;
}
.step-indicator .step:last-child { border-right: none; }
.step-indicator .step.active {
    background: #f8ebed; color: #7B1D2A; font-weight: 700;
    border-bottom: 3px solid #7B1D2A;
}
.step-indicator .step.done {
    background: #f0faf5; color: #198754; font-weight: 600;
    border-bottom: 3px solid #198754;
}

/* ── OTP input ── */
.otp-input { font-size: 2.2rem; letter-spacing: .6em; text-align: center; font-weight: 600; }

/* ── Alert brand ── */
.alert-brand {
    background: #f8ebed; border: 1px solid #e8b4ba; color: #5E1520;
    border-radius: 6px;
}

/* ── Badges ── */
.badge.bg-primary { background: #7B1D2A !important; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    background: #1a1e2d;
    color: rgba(255,255,255,.55);
    font-size: 13px;
    padding: 18px 0;
    margin-top: 40px;
}
.site-footer a { color: rgba(255,255,255,.7); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    .otp-input { font-size: 1.6rem; letter-spacing: .4em; }
    .card.form-card .card-body { padding: 20px 16px; }
    .page-hero { padding: 16px 0; }
}

/* ── Header top strip ────────────────────────────────────────── */
.header-top {
    background: linear-gradient(90deg, #5E1520 0%, #7B1D2A 50%, #5E1520 100%);
    color: rgba(255,255,255,.88);
    font-size: 12px;
    padding: 7px 0;
    letter-spacing: .01em;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.header-top .university-name-en {
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-top .university-name-as {
    font-size: 12.5px;
    opacity: .85;
    font-weight: 400;
    margin-left: 10px;
    border-left: 1px solid rgba(255,255,255,.3);
    padding-left: 10px;
}
.header-top .header-top-right {
    font-size: 11.5px;
    opacity: .8;
    white-space: nowrap;
}
@media (max-width: 575px) {
    .header-top .university-name-as { display: none; }
    .header-top .header-top-right   { display: none !important; }
}

/* ── Navbar updates ──────────────────────────────────────────── */
.site-navbar {
    background: #fff !important;
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    padding: 0;
}
.site-navbar .container { min-height: 68px; }
.site-navbar .navbar-brand { padding: 10px 0; display: flex; align-items: center; gap: 12px; }
.site-navbar .brand-text { line-height: 1.2; }
.site-navbar .brand-text .portal-title {
    font-size: 15px; font-weight: 700; color: #1a1e2d; display: block;
}
.site-navbar .brand-text .portal-sub {
    font-size: 11px; color: #7B1D2A; font-weight: 500;
    text-transform: uppercase; letter-spacing: .06em; display: block;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: #15181f;
    color: rgba(255,255,255,.68);
    font-size: 13.5px;
    padding: 0;
    margin-top: 56px;
    border-top: 3px solid #7B1D2A;
}
.site-footer a { color: rgba(255,255,255,.6); text-decoration: none; transition: color .15s; }
.site-footer a:hover { color: #C9A02A; text-decoration: none; }

.site-footer .footer-main { padding: 44px 0 36px; }

/* brand block */
.footer-brand-block {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.footer-brand-block img { height: 50px; width: auto; opacity: .88; flex-shrink: 0; }
.footer-brand-name {
    font-size: 14px; font-weight: 700;
    color: rgba(255,255,255,.9); line-height: 1.35;
}
.footer-brand-sub {
    font-size: 10.5px; color: #C9A02A;
    letter-spacing: .07em; text-transform: uppercase; margin-top: 4px;
}
.footer-about {
    font-size: 13px; line-height: 1.7;
    color: rgba(255,255,255,.45); max-width: 460px; margin: 0;
}

/* section title */
.footer-col-title {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .12em; color: #C9A02A; margin-bottom: 18px;
    padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.07);
}

/* contact items */
.footer-contact-item {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 13px; font-size: 13px; line-height: 1.55;
}
.footer-contact-item .fc-icon { color: #C9A02A; flex-shrink: 0; margin-top: 2px; opacity: .85; }
.footer-addr-label {
    font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: #C9A02A; display: inline-block; margin-bottom: 2px;
}

/* bottom bar */
.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 14px 0;
    font-size: 12px;
    color: rgba(255,255,255,.32);
}
.site-footer .footer-bottom a { color: rgba(255,255,255,.48); }

/* ═══════════════════════════════════════════════════════════════
   HEADER — top-bar + navbar
   ═══════════════════════════════════════════════════════════════ */

/* Desktop/tablet top bar (sm+) */
.header-topbar {
    background: #7B1D2A;
    color: rgba(255,255,255,.88);
    font-size: 12.5px;
    padding: 7px 0;
    line-height: 1.4;
}
.header-topbar .topbar-assamese {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
}
.header-topbar .topbar-english {
    font-size: 12px;
    opacity: .85;
}
.header-topbar .topbar-divider { opacity: .4; }
.header-topbar .topbar-links a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 12px;
    transition: color .15s;
}
.header-topbar .topbar-links a:hover { color: #fff; }
.header-topbar .topbar-links span { opacity: .4; }

/* Mobile-only top bar (xs) */
.mobile-topbar {
    background: #7B1D2A;
    color: rgba(255,255,255,.85);
    font-size: 11px;
    padding: 5px 0;
    line-height: 1.3;
}
.mobile-topbar-text {
    font-size: 11px;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main navbar */
.site-navbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    padding: 0;
}
.site-navbar .container { min-height: 64px; }

/* Mobile brand block (xs only: circular logo + text) */
.nav-brand-logo { height: 38px; width: auto; }
.nav-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #7B1D2A;
    line-height: 1.2;
}
.nav-brand-sub {
    font-size: 10px;
    color: #8a9098;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Desktop portal title */
.portal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1e2d;
    line-height: 1.2;
}
.portal-subtitle {
    font-size: 11px;
    color: #8a9098;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Toggler */
.site-navbar .navbar-toggler { border: none; padding: 6px; }
.site-navbar .navbar-toggler:focus { box-shadow: none; }

/* Nav links */
.site-navbar .nav-link {
    color: #444 !important;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px !important;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.site-navbar .nav-link:hover {
    background: #f5f5f5;
    color: #7B1D2A !important;
}
.site-navbar .nav-logout-link { color: #dc3545 !important; }
.site-navbar .nav-logout-link:hover { background: #fff5f5; color: #b02a37 !important; }

/* Mobile collapsed nav menu */
@media (max-width: 991.98px) {
    .nav-mobile-menu {
        border-top: 1px solid #f0f0f0;
        padding: 10px 0 6px;
        margin-top: 6px;
        gap: 2px;
    }
    .nav-mobile-menu .nav-link {
        padding: 10px 14px !important;
        border-radius: 8px;
        font-size: 14.5px;
    }
    .nav-mobile-menu .nav-item:last-child { margin-top: 6px; }
    .nav-mobile-menu .btn {
        display: block;
        text-align: center;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14.5px;
    }
    .w-lg-auto { width: auto !important; }
}

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────── */
.home-hero {
    background: linear-gradient(135deg, #7B1D2A 0%, #4a1018 60%, #2a0a10 100%);
    color: #fff;
    padding: 64px 0 72px;
    position: relative;
    overflow: hidden;
}
.home-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(201,160,42,.12) 0%, transparent 60%);
    pointer-events: none;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; color: #C9A02A;
    border: 1px solid rgba(201,160,42,.4);
    border-radius: 20px; padding: 4px 14px; margin-bottom: 18px;
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800; line-height: 1.15;
    color: #fff; margin-bottom: 18px;
}
.hero-title-accent { color: #C9A02A; }
.hero-desc {
    font-size: 16px; line-height: 1.75;
    color: rgba(255,255,255,.72); max-width: 560px; margin-bottom: 0;
}
.btn-hero-primary {
    background: #C9A02A; border-color: #C9A02A; color: #1a1e2d;
    font-weight: 700; font-size: 15px; padding: 12px 28px;
    border-radius: 8px; transition: background .2s, transform .15s;
}
.btn-hero-primary:hover {
    background: #b08920; border-color: #b08920; color: #1a1e2d;
    transform: translateY(-1px);
}
.btn-hero-outline {
    background: transparent; border: 2px solid rgba(255,255,255,.35);
    color: rgba(255,255,255,.85); font-weight: 600; font-size: 15px;
    padding: 12px 28px; border-radius: 8px; transition: border-color .2s, color .2s;
}
.btn-hero-outline:hover {
    border-color: rgba(255,255,255,.7); color: #fff;
}
.hero-seal {
    width: 180px; opacity: .88;
    filter: drop-shadow(0 8px 32px rgba(0,0,0,.4));
}

/* ── Active Event Card ─────────────────────────────────────── */
.event-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    overflow: hidden;
}
.event-card-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.event-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em;
    padding: 3px 12px; border-radius: 20px; margin-bottom: 8px;
}
.badge-open     { background: #e8f5e9; color: #2e7d32; }
.badge-upcoming { background: #fff8e1; color: #f57f17; }
.badge-closed   { background: #fce4e4; color: #b71c1c; }
.event-name {
    font-size: 1.4rem; font-weight: 800; color: #1a1e2d; margin: 0;
}
.event-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    padding: 0 8px;
}
.event-meta-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 18px 20px;
    border-right: 1px solid #f0f0f0;
}
.event-meta-item:last-child { border-right: none; }
.emi-icon {
    color: #7B1D2A; flex-shrink: 0; margin-top: 2px; opacity: .8;
}
.emi-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: #999; font-weight: 600; margin-bottom: 3px;
}
.emi-value {
    font-size: 14px; font-weight: 700; color: #1a1e2d; line-height: 1.3;
}

/* No active event notice */
.no-event-notice {
    background: #fff9f0;
    border: 1px solid #ffe0a0;
    border-radius: 10px;
    padding: 36px 28px;
    text-align: center;
    color: #856404;
}
.no-event-notice h5 { font-weight: 700; color: #5d4300; }
.no-event-notice a  { color: #7B1D2A; font-weight: 600; }

/* ── How it Works ──────────────────────────────────────────── */
.home-steps-section {
    background: #f4f6f9;
    padding: 64px 0;
    margin-top: 16px;
}
.section-eyebrow {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; color: #C9A02A; margin-bottom: 8px;
}
.section-title {
    font-size: 1.75rem; font-weight: 800; color: #1a1e2d;
    margin-bottom: 8px;
}
.section-sub {
    color: #6c757d; font-size: 15px; margin: 0;
}
.step-tile {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 24px;
    height: 100%;
    position: relative;
    transition: box-shadow .2s, transform .2s;
}
.step-tile:hover {
    box-shadow: 0 8px 28px rgba(123,29,42,.10);
    transform: translateY(-3px);
}
.step-number {
    font-size: 11px; font-weight: 800; letter-spacing: .1em;
    color: #C9A02A; margin-bottom: 12px;
}
.step-icon-wrap {
    width: 44px; height: 44px;
    background: #f8ebed;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #7B1D2A;
    margin-bottom: 14px;
}
.step-heading {
    font-size: 15px; font-weight: 700; color: #1a1e2d; margin-bottom: 8px;
}
.step-desc {
    font-size: 13.5px; color: #6c757d; line-height: 1.65; margin-bottom: 14px;
}
.step-link {
    font-size: 13px; font-weight: 700; color: #7B1D2A;
    text-decoration: none;
}
.step-link:hover { text-decoration: underline; }

/* ── Info Cards ────────────────────────────────────────────── */
.home-info-section {
    padding: 48px 0;
}
.info-card {
    display: flex; gap: 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px;
    height: 100%;
}
.info-card-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    background: #f8ebed; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #7B1D2A;
}
.info-card-title {
    font-size: 14px; font-weight: 700; color: #1a1e2d; margin-bottom: 12px;
}
.info-list {
    font-size: 13.5px; color: #555; line-height: 1.7;
    padding-left: 16px; margin: 0;
}
.info-list li { margin-bottom: 4px; }

/* ── Bottom CTA ────────────────────────────────────────────── */
.home-cta-section {
    background: linear-gradient(135deg, #7B1D2A 0%, #4a1018 100%);
    padding: 56px 0;
    margin-top: 0;
}
.cta-title {
    font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 8px;
}
.cta-sub {
    color: rgba(255,255,255,.7); font-size: 15px; margin-bottom: 0;
}
.btn-cta-primary {
    background: #C9A02A; border-color: #C9A02A; color: #1a1e2d;
    font-weight: 700; font-size: 15px; padding: 12px 32px; border-radius: 8px;
    transition: background .2s;
}
.btn-cta-primary:hover { background: #b08920; border-color: #b08920; color: #1a1e2d; }
.btn-cta-outline {
    background: transparent; border: 2px solid rgba(255,255,255,.4);
    color: rgba(255,255,255,.85); font-weight: 600; font-size: 15px;
    padding: 12px 32px; border-radius: 8px; transition: border-color .2s, color .2s;
}
.btn-cta-outline:hover { border-color: rgba(255,255,255,.8); color: #fff; }

/* ── Mobile adjustments ────────────────────────────────────── */
@media (max-width: 767.98px) {
    .home-hero { padding: 40px 0 52px; }
    .hero-title { font-size: 1.7rem; }
    .event-meta-grid { grid-template-columns: 1fr 1fr; }
    .event-meta-item { border-right: none; border-bottom: 1px solid #f0f0f0; }
    .event-meta-item:nth-child(odd) { border-right: 1px solid #f0f0f0; }
    .event-meta-item:last-child { border-bottom: none; }
    .home-steps-section { padding: 44px 0; }
    .home-cta-section { padding: 40px 0; }
}

/* Full-width pages (home): footer attaches directly to last section */
.page-fullwidth .site-footer { margin-top: 0; }

/* ── Reservation countdown bar (fixed bottom) ─────────────── */
/* ── Reservation countdown bar ─────────────────────────────── */

/* Inline variant — dashboard, sits above the info card */
.countdown-bar-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-left: 4px solid #7B1D2A;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: #4b5563;
}
.countdown-bar-inline .cb-icon { color: #7B1D2A; flex-shrink: 0; }
.countdown-bar-inline .cb-label { color: #6b7280; }
.countdown-bar-inline .cb-time {
    font-size: 15px;
    font-weight: 700;
    color: #7B1D2A;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    display: inline-block;
}
.countdown-bar-inline.cb-expired {
    border-left-color: #dc2626;
    background: #fff5f5;
}
.countdown-bar-inline.cb-expired .cb-icon { color: #dc2626; }
.countdown-bar-inline.cb-expired .cb-time { color: #dc2626; }

/* Fixed variant — documents & payment pages, pinned to bottom */
.countdown-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1031;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    border-top: 3px solid #7B1D2A;
    box-shadow: 0 -2px 12px rgba(0,0,0,.10);
    padding: 10px 20px;
    font-size: 13.5px;
    color: #4b5563;
}
.countdown-bar .cb-icon { color: #7B1D2A; flex-shrink: 0; }
.countdown-bar .cb-label { color: #6b7280; }
.countdown-bar .cb-time {
    font-size: 15px;
    font-weight: 700;
    color: #7B1D2A;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    display: inline-block;
    text-align: center;
}
.countdown-bar.cb-expired { border-top-color: #dc2626; background: #fff5f5; }
.countdown-bar.cb-expired .cb-icon { color: #dc2626; }
.countdown-bar.cb-expired .cb-time { color: #dc2626; }
.countdown-bar-spacer { height: 52px; }

/* ── Learner step pages — mobile polish ────────────────────── */
@media (max-width: 575.98px) {

    /* Step headings: slightly smaller on xs */
    h2.fw-bold { font-size: 1.35rem; }

    /* Documents table: enforce column widths on xs */
    .table-responsive .table th,
    .table-responsive .table td { font-size: 0.82rem; }

    /* File input inside table cell: full column width */
    .table-responsive .form-control-sm.flex-grow-1 {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100%;
    }

    /* Dashboard status badge: keep it readable */
    .badge.fs-6 { font-size: 0.82rem !important; }

    /* Countdown bar: abbreviate on xs */
    .countdown-bar-inline .cb-label { display: none; }

    /* Card padding reduction on xs */
    .card-body.p-4 { padding: 1rem !important; }

    /* Form inside table upload cell: stack vertically */
    td .d-flex.flex-wrap { flex-direction: column; align-items: stretch; }
    td .d-flex.flex-wrap .btn { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE OVERFLOW FIX — prevent horizontal scrollbar/gap
   ═══════════════════════════════════════════════════════════════ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevent any section from breaking out */
main, footer, header, nav, section {
    max-width: 100%;
}

@media (max-width: 767.98px) {

    /* Footer gutter: reduce g-5 (24px) to avoid negative-margin overflow */
    .site-footer .row.g-5 {
        --bs-gutter-x: 1.5rem;
        --bs-gutter-y: 2rem;
    }

    /* Step indicator: allow wrapping on very small screens */
    .step-indicator {
        flex-wrap: wrap;
    }
    .step-indicator .step {
        flex: 1 0 auto;
        min-width: 0;
        font-size: 11.5px;
        padding: 10px 6px;
        word-break: break-word;
    }

    /* Countdown bar: wrap on narrow screens */
    .countdown-bar-inline {
        flex-wrap: wrap;
    }
    .countdown-bar {
        flex-wrap: wrap;
        padding: 8px 12px;
    }

    /* Event card header: stack on mobile */
    .event-card-header {
        padding: 16px 18px 14px;
    }

    /* Event meta grid: single column on mobile */
    .event-meta-grid {
        grid-template-columns: 1fr;
    }
    .event-meta-item {
        border-right: none !important;
        border-bottom: 1px solid #f0f0f0;
    }
    .event-meta-item:last-child {
        border-bottom: none;
    }

    /* Tables: ensure they don't break out */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cards: prevent padding overflow */
    .card-body.p-4 {
        padding: 1rem !important;
    }

    /* Footer brand: stack vertically if needed */
    .footer-brand-block {
        flex-wrap: wrap;
    }

    /* Fieldset within forms: avoid overflow */
    fieldset.border {
        padding: 0.75rem !important;
    }
}
