/*
 * Government of Makueni County - Vocational Training Portal
 * Lightweight public-facing theme (no build step, no external assets).
 */

:root {
    /* Makueni County brand */
    --mak-blue: #124491;
    --mak-blue-dark: #0d356f;
    --mak-blue-deep: #0a2a58;
    --mak-blue-soft: #e8eef9;
    --mak-teal: #00a69c;
    --mak-teal-dark: #00857d;
    --mak-yellow: #ffdd00;
    /* Green is reserved for success / action states */
    --portal-green: #1b7a43;
    --portal-green-dark: #135c32;
    --portal-green-deep: #0d3f22;
    --portal-green-soft: #e7f4ec;
    --portal-ink: #1d2733;
    --portal-muted: #5b6672;
    --portal-bg: #f5f6f8;
    --portal-footer-bg: #0c1f3d;
    --portal-radius: 0.75rem;
    --portal-shadow: 0 6px 20px rgba(15, 33, 60, 0.08);
    --portal-shadow-lg: 0 14px 30px rgba(15, 33, 60, 0.14);
}

html { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
    background-color: var(--portal-bg);
    color: var(--portal-ink);
    -webkit-font-smoothing: antialiased;
    /* Keep the footer pinned to the bottom on short pages */
    min-height: 100%;
    display: flex;
    flex-direction: column;
    /* Guard against accidental horizontal scroll from decorative shapes.
       `clip` (unlike `hidden`) does not create a scroll container, so the
       sticky nav keeps working. */
    overflow-x: clip;
}

/* ---------- Bootstrap accents remapped to county brand blue ---------- */
.btn-primary {
    --bs-btn-bg: var(--mak-blue);
    --bs-btn-border-color: var(--mak-blue);
    --bs-btn-hover-bg: var(--mak-blue-dark);
    --bs-btn-hover-border-color: var(--mak-blue-dark);
    --bs-btn-active-bg: var(--mak-blue-deep);
    --bs-btn-active-border-color: var(--mak-blue-deep);
    --bs-btn-disabled-bg: #8ba3c9;
    --bs-btn-disabled-border-color: #8ba3c9;
    --bs-btn-focus-shadow-rgb: 18, 68, 145;
}

.btn-primary:hover,
.btn-primary:focus-visible { box-shadow: inset 0 -3px 0 var(--mak-yellow); }

.btn-outline-primary {
    --bs-btn-color: var(--mak-blue);
    --bs-btn-border-color: var(--mak-blue);
    --bs-btn-hover-bg: var(--mak-blue);
    --bs-btn-hover-border-color: var(--mak-blue);
    --bs-btn-active-bg: var(--mak-blue-dark);
    --bs-btn-active-border-color: var(--mak-blue-dark);
    --bs-btn-focus-shadow-rgb: 18, 68, 145;
}

.text-primary { color: var(--mak-blue) !important; }

.bg-success,
.badge.bg-success { background-color: var(--portal-green) !important; }

.form-control:focus,
.form-select:focus { border-color: var(--mak-blue); box-shadow: 0 0 0 0.25rem rgba(18, 68, 145, 0.15); }

.form-check-input:checked { background-color: var(--mak-blue); border-color: var(--mak-blue); }

.alert-success { --bs-alert-color: var(--portal-green-deep); --bs-alert-bg: var(--portal-green-soft); --bs-alert-border-color: #c4e3d1; }

/* ---------- Sticky top navigation ---------- */
.portal-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    /* Thin county-yellow accent line under the nav */
    border-bottom: 3px solid var(--mak-yellow);
    box-shadow: 0 1px 0 rgba(15, 33, 60, 0.06), 0 6px 18px rgba(15, 33, 60, 0.06);
}

.portal-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1rem;
}

.portal-brand { display: inline-flex; align-items: center; text-decoration: none; }

.portal-brand img { height: 52px; width: auto; }

.portal-nav-toggle {
    display: none;
    margin-left: auto;
    border: 0;
    background: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--portal-ink);
    padding: 0.25rem 0.4rem;
    cursor: pointer;
}

.portal-nav nav { margin-left: auto; }

.portal-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.portal-menu a {
    display: block;
    padding: 0.5rem 0.9rem;
    color: var(--portal-ink);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.portal-menu a:hover { color: var(--mak-blue); background: var(--mak-blue-soft); }

.portal-menu a.active { color: #fff; background: var(--mak-blue); }

.portal-menu a.portal-login-link {
    border: 1.5px solid var(--mak-blue);
    color: var(--mak-blue);
    margin-left: 0.35rem;
    padding: 0.45rem 1.1rem;
}

.portal-menu a.portal-login-link:hover,
.portal-menu a.portal-login-link.active { background: var(--mak-blue); color: #fff; }

/* Dropdown (E-Services) */
.portal-dropdown { position: relative; }

.portal-dropdown > a .bi { font-size: 0.75em; margin-left: 0.2rem; }

.portal-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0.6rem;
    box-shadow: var(--portal-shadow-lg);
    padding: 0.4rem;
    margin: 0.35rem 0 0;
    list-style: none;
    display: none;
    z-index: 1040;
}

.portal-dropdown.open > .portal-dropdown-menu { display: block; }

.portal-dropdown-menu a {
    border-radius: 0.45rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    font-size: 0.92rem;
}

@media (min-width: 992px) {
    .portal-dropdown:hover > .portal-dropdown-menu { display: block; }
}

/* Mobile navigation */
@media (max-width: 991.98px) {
    /* 44px+ touch target for the toggle */
    .portal-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    .portal-nav nav { margin-left: 0; }

    .portal-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        background: #fff;
        padding: 0.75rem 1rem 1rem;
        box-shadow: var(--portal-shadow-lg);
    }

    .portal-nav.open .portal-menu { display: flex; }

    .portal-menu a,
    .portal-menu a.portal-login-link {
        border-radius: 0.5rem;
        margin-left: 0;
        text-align: left;
        /* Comfortable 44px+ touch targets in the mobile panel */
        padding: 0.7rem 0.9rem;
    }

    .portal-dropdown-menu {
        position: static;
        box-shadow: none;
        padding: 0 0 0 1rem;
        margin: 0;
    }
}

/* ---------- Hero ---------- */
.portal-hero {
    background: linear-gradient(135deg, var(--mak-blue-deep) 0%, var(--mak-blue) 55%, var(--mak-teal) 100%);
    color: #fff;
    padding: 4rem 0;
    position: relative;
}

.portal-hero-img { background-size: cover; background-position: center; }

.portal-hero-img::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(120deg, rgba(18, 68, 145, 0.85) 20%, rgba(14, 60, 124, 0.75) 60%, rgba(0, 166, 156, 0.55) 100%);
}

.portal-hero > .container { position: relative; z-index: 2; }

/* ---------- Hero background slider (crossfading layers) ---------- */
.portal-hero-slider {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.portal-hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
}

.portal-hero-slide.is-active { opacity: 1; }

.portal-hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.9rem;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 0.15rem;
}

.portal-hero-dots button {
    /* 40px touch target around a small visual dot */
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.portal-hero-dots button::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.portal-hero-dots button:hover::before,
.portal-hero-dots button:focus-visible::before { background: rgba(255, 255, 255, 0.85); }

.portal-hero-dots button.is-active::before {
    background: var(--mak-yellow);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
    .portal-hero-slide { transition: none; }
}

.portal-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; }

.portal-hero p { color: rgba(255, 255, 255, 0.88); max-width: 560px; }

.portal-hero .btn-light,
.portal-hero .btn-outline-light { font-weight: 600; }

.portal-hero .btn-outline-light { border-width: 1.5px; }

/* Login card used on the landing hero */
.portal-login-card {
    background: #fff;
    color: var(--portal-ink);
    border-radius: 1rem;
    box-shadow: 0 18px 44px rgba(6, 26, 15, 0.35);
}

/* ---------- Page head (breadcrumb strip) ---------- */
.portal-page-head { background: linear-gradient(120deg, var(--mak-blue-deep) 0%, var(--mak-blue) 55%, var(--mak-teal-dark) 100%); color: #fff; padding: 2.1rem 0; }

.portal-page-head h2 { font-weight: 800; margin: 0; font-size: 1.6rem; }

.portal-page-head .portal-crumbs {
    margin: 0.3rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.portal-page-head .portal-crumbs a { color: #fff; text-decoration: none; }

.portal-page-head .portal-crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: rgba(255, 255, 255, 0.45); }

/* ---------- Sections and titles ---------- */
.portal-section { padding: 3rem 0 4rem; }

.section-title h2 { font-weight: 800; color: var(--portal-ink); font-size: clamp(1.4rem, 3vw, 1.9rem); }

.section-title h2::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--mak-blue), var(--mak-teal));
    margin: 0.65rem auto 0;
}

.section-title p { color: var(--portal-muted); max-width: 760px; margin: 0.75rem auto 0; }

.section-title { margin-bottom: 1.75rem; }

/* ---------- Cards ---------- */
.card { border: 0; border-radius: var(--portal-radius); box-shadow: 0 2px 10px rgba(15, 33, 60, 0.06); }

.portal-lift { transition: transform 0.18s ease, box-shadow 0.18s ease; }

.portal-lift:hover { transform: translateY(-4px); box-shadow: var(--portal-shadow-lg); }

.portal-card-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    background: var(--mak-blue-soft);
    color: var(--mak-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

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

a.card:hover h3,
a.card:hover .h6 { color: var(--mak-blue); }

/* ---------- Footer ---------- */
.portal-footer { background: var(--portal-footer-bg); color: #cfdcee; margin-top: auto; border-top: 3px solid var(--mak-yellow); }

.portal-footer-top { padding: 3rem 0 2rem; }

.portal-footer h5 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.portal-footer p { color: #a7bad6; }

.portal-footer ul { list-style: none; margin: 0; padding: 0; }

.portal-footer ul li { margin-bottom: 0.55rem; }

.portal-footer a { color: #cfdcee; text-decoration: none; }

.portal-footer a:hover { color: var(--mak-yellow); text-decoration: underline; }

.portal-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 0;
    font-size: 0.85rem;
    color: #9bb0cc;
}

/* ---------- Typography helpers ---------- */
.portal-overline {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-overline::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: currentColor; opacity: 0.65; }

.portal-section-alt { background: #fff; }

/* ---------- Home hero (richer composition) ---------- */
.portal-hero-home { padding: 5rem 0 7.25rem; overflow: hidden; }

.portal-hero-home::before {
    background: linear-gradient(100deg,
        rgba(10, 42, 88, 0.95) 0%,
        rgba(18, 68, 145, 0.85) 45%,
        rgba(0, 166, 156, 0.55) 82%,
        rgba(0, 166, 156, 0.35) 100%);
}

.portal-hero-home::after {
    content: "";
    position: absolute;
    right: -160px;
    top: -160px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 166, 156, 0.35), transparent 68%);
    pointer-events: none;
    z-index: 1;
}

.portal-hero-home .portal-overline { color: var(--mak-yellow); }

.portal-hero-home h1 {
    font-size: clamp(2.1rem, 5vw, 3.3rem);
    letter-spacing: -0.02em;
    max-width: 18ch;
}

.portal-hero-home p { font-size: 1.05rem; max-width: 620px; }

/* Sits on dark blue/teal gradients only; never place on white */
.portal-accent { color: var(--mak-yellow); }

/* ---------- Floating stats strip ---------- */
.portal-stats { position: relative; z-index: 2; margin-top: -3.5rem; }

.portal-stat {
    background: #fff;
    border-radius: 1rem;
    border-bottom: 3px solid var(--mak-teal);
    box-shadow: var(--portal-shadow-lg);
    padding: 1.2rem 1.3rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.portal-stat .portal-card-icon { width: 46px; height: 46px; flex: 0 0 46px; font-size: 1.25rem; border-radius: 12px; }

.portal-stat-value {
    font-size: clamp(1.5rem, 2.6vw, 1.95rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--portal-ink);
    font-variant-numeric: tabular-nums;
}

.portal-stat-label { color: var(--portal-muted); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }

/* ---------- Offer cards (accent top border on hover) ---------- */
.portal-offer-card { position: relative; overflow: hidden; }

.portal-offer-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mak-blue), var(--mak-teal));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.portal-offer-card:hover::before { transform: scaleX(1); }

/* ---------- How it works steps ---------- */
.portal-step { text-align: center; position: relative; padding: 0 0.75rem; }

.portal-step-num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--mak-blue);
    color: var(--mak-blue);
    font-weight: 800;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 16px rgba(18, 68, 145, 0.16);
}

.portal-step h3 { font-size: 1rem; font-weight: 700; margin: 0.9rem 0 0.35rem; }

.portal-step p { color: var(--portal-muted); font-size: 0.88rem; margin: 0; }

/* Connector line between steps: desktop/tablet only, hidden on mobile */
@media (min-width: 768px) {
    .portal-step::before { content: ""; position: absolute; top: 27px; right: 50%; width: 100%; border-top: 2px dashed #bccde8; z-index: 0; }

    .portal-steps .portal-step-first::before { display: none; }
}

/* ---------- Image mosaic ---------- */
.portal-mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.portal-mosaic figure {
    margin: 0;
    position: relative;
    border-radius: var(--portal-radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: var(--portal-shadow);
}

.portal-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }

.portal-mosaic figure:hover img { transform: scale(1.05); }

.portal-mosaic figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.8rem 0.9rem 0.7rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    background: linear-gradient(180deg, rgba(10, 42, 88, 0) 0%, rgba(9, 32, 66, 0.88) 100%);
}

.portal-checklist { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.portal-checklist li { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; color: var(--portal-muted); }

.portal-checklist li .bi { color: var(--portal-green); font-size: 1.05rem; line-height: 1.4; }

/* ---------- CTA band ---------- */
.portal-cta-band {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, var(--mak-blue-deep) 0%, var(--mak-blue) 50%, var(--mak-teal) 100%);
    color: #fff;
    padding: 3.25rem 0;
    border-top: 3px solid var(--mak-yellow);
}

.portal-cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.6px);
    background-size: 22px 22px;
}

.portal-cta-band .container { position: relative; z-index: 1; }

.portal-cta-band h2 { font-weight: 800; font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 0.4rem; }

.portal-cta-band p { color: rgba(255, 255, 255, 0.85); }

/* ---------- Page head refinements ---------- */
.portal-page-head { position: relative; overflow: hidden; padding: 2.75rem 0; }

.portal-page-head::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.6px);
    background-size: 20px 20px;
}

.portal-page-head::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -140px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 166, 156, 0.32), transparent 70%);
}

.portal-page-head .container { position: relative; z-index: 1; }

.portal-page-head .portal-overline { color: var(--mak-yellow); }

.portal-page-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

.portal-page-head .portal-head-sub {
    color: rgba(255, 255, 255, 0.82);
    max-width: 660px;
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
}

/* ---------- Count badge (used on the dark page-head band) ---------- */
.portal-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--mak-yellow);
    color: var(--mak-blue-deep);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: middle;
}

/* ---------- Center cards ---------- */
.portal-center-num {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mak-blue), var(--mak-teal));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(18, 68, 145, 0.25);
}

.portal-center-card .portal-map-hint { color: var(--portal-muted); font-size: 0.82rem; }

.portal-center-card .portal-map-hint .bi { color: var(--mak-teal); }

.portal-center-card:hover .portal-map-hint { color: var(--mak-blue); }

/* ---------- Scholarship cards ---------- */
.portal-sch-card { border-top: 4px solid var(--mak-blue); }

.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.28rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-chip-open { background: var(--portal-green-soft); color: var(--portal-green-dark); }

.portal-chip-open::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--portal-green); box-shadow: 0 0 0 3px rgba(27, 122, 67, 0.18); }

.portal-deadline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff7e6;
    color: #8a5a00;
    border: 1px solid #f0dcb0;
    border-radius: 0.6rem;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.83rem;
}

.portal-deadline.urgent { background: #fdecea; color: #a5231b; border-color: #f3c1bd; }

/* ---------- Empty state ---------- */
.portal-empty { text-align: center; padding: 3.25rem 1.5rem; }

.portal-empty-icons { display: inline-flex; align-items: center; margin-bottom: 1.25rem; }

.portal-empty-icons span {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--mak-blue-soft);
    color: var(--mak-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 -9px;
    border: 3px solid #fff;
    box-shadow: var(--portal-shadow);
}

.portal-empty-icons span:nth-child(2) { width: 86px; height: 86px; font-size: 2.3rem; position: relative; z-index: 1; }

/* ---------- Scroll reveal utility ---------- */
.portal-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }

.portal-reveal.revealed { opacity: 1; transform: none; }

.portal-reveal-2 { transition-delay: 0.1s; }

.portal-reveal-3 { transition-delay: 0.2s; }

.portal-reveal-4 { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .portal-reveal { opacity: 1; transform: none; transition: none; }

    .portal-lift,
    .portal-mosaic img,
    .portal-offer-card::before { transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 575.98px) {
    .portal-hero { padding: 2.75rem 0; }

    .portal-hero-home { padding: 3.25rem 0 5.5rem; }

    .portal-stats { margin-top: -3rem; }

    .portal-stat { padding: 0.95rem 1rem; gap: 0.7rem; }

    .portal-mosaic { gap: 0.75rem; }

    .portal-section { padding: 2.25rem 0 3rem; }

    .portal-brand img { height: 44px; }
}
