/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #127BE8;
    --primary-dark: #0D5BB0;
    --primary-light: #4A9AF5;
    --accent: #EE7F13;
    --accent-dark: #CC6A0A;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-section: #EEF4FC;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== GLOBAL RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--primary-dark);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-bar a {
    color: var(--white);
    opacity: 0.85;
}

.top-bar a:hover {
    opacity: 1;
    color: var(--accent);
}

/* ===== NAVIGATION ===== */
.main-nav {
    background: var(--white);
    padding: 0.6rem 0;
    box-shadow: var(--shadow);
}

.navbar-brand {
    color: var(--text-dark) !important;
}

.brand-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.brand-icon {
    font-size: 2rem;
    color: var(--accent);
}

.brand-name {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-tagline {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: -3px;
}

.main-nav .nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: var(--transition);
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--primary) !important;
    background: rgba(18, 123, 232, 0.08);
}

.nav-cta {
    background: var(--accent) !important;
    color: var(--white) !important;
    border: none;
    font-weight: 600;
    padding: 0.5rem 1.3rem !important;
    border-radius: 50px !important;
}

.nav-cta:hover {
    background: var(--accent-dark) !important;
    transform: translateY(-1px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(238, 127, 19, 0.08);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

.hero-section h1 .text-accent {
    color: var(--accent);
}

.hero-section .lead {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
}

.hero-btns .btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.95rem;
}

.btn-accent {
    background: var(--accent);
    color: var(--white);
    border: 2px solid var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(238, 127, 19, 0.4);
}

.btn-outline-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.hero-stats {
    position: relative;
    z-index: 2;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SECTION STYLES ===== */
.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--bg-section);
}

.section-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.section-heading h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.section-heading .underline {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 1rem;
    border-radius: 3px;
}

.section-heading p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SERVICE CARDS ===== */
.service-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 1.6rem;
    color: var(--white);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    transform: scale(1.1);
}

.service-card h5 {
    color: var(--primary-dark);
    margin-bottom: 0.7rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== ABOUT PREVIEW ===== */
.about-preview-img {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.about-preview-img::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: -20px;
    bottom: -20px;
    border: 3px solid var(--accent);
    border-radius: var(--radius);
    z-index: -1;
}

.about-logo {
    max-height: 250px;
    max-width: 80%;
    object-fit: contain;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.feature-item .icon-box {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 10px;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.feature-item h6 {
    margin-bottom: 0.2rem;
    color: var(--primary-dark);
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== PARTNERS ===== */
.partner-logo {
    height: 70px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: var(--transition);
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

/* ===== NEWS CARDS ===== */
.news-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-card-img {
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    position: relative;
}

.news-card-body {
    padding: 1.5rem;
}

.news-date {
    font-size: 0.8rem;
    color: var(--accent-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card-body h5 {
    font-size: 1.05rem;
    margin: 0.5rem 0;
    color: var(--primary-dark);
}

.news-card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.news-tag {
    display: inline-block;
    background: var(--bg-section);
    color: var(--primary);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== GALLERY ===== */
.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    height: 250px;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: rgba(18, 123, 232, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay i {
    font-size: 2rem;
    color: var(--white);
}

.gallery-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ===== CONTACT ===== */
.contact-info-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    height: 100%;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-item .icon-circle {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    margin-right: 1rem;
}

.contact-info-item h6 {
    margin-bottom: 0.2rem;
    color: var(--primary-dark);
}

.contact-info-item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.contact-form .form-control,
.contact-form .form-select {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.contact-form .form-control:focus,
.contact-form .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 123, 232, 0.1);
}

.btn-primary-custom {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(18, 123, 232, 0.3);
}

/* ===== PAGE HEADER ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.page-header .breadcrumb {
    justify-content: center;
    position: relative;
    z-index: 2;
}

.page-header .breadcrumb-item a {
    color: var(--accent);
}

.page-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ===== TIMELINE / AWARDS ===== */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
    border-left: 2px solid var(--primary-light);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--white);
}

.timeline-year {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ===== TEAM CARD ===== */
.team-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: 100%;
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.team-photo {
    width: 140px;
    min-height: 140px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.team-info {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.team-info h5 {
    color: var(--primary-dark);
    margin-bottom: 0.1rem;
    font-size: 1rem;
}

.team-info .team-role {
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.team-info .team-bio {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .team-photo {
        width: 110px;
        min-height: 110px;
    }
}

/* ===== DOWNLOADS ===== */
.download-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.download-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.download-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-info h6 {
    margin-bottom: 0.15rem;
    color: var(--primary-dark);
    word-break: break-word;
}

/* ===== PAYMENT TABLE ===== */
.payment-table {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.payment-table .table {
    margin-bottom: 0;
}

.payment-table .table thead {
    background: var(--primary);
    color: var(--white);
}

.payment-table .table thead th {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem;
    border: none;
}

.payment-table .table td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* ===== MPESA / BANK CARD ===== */
.payment-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    height: 100%;
    border-top: 4px solid var(--primary);
}

.payment-card h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.payment-card .step-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
}

.payment-card .step-list li {
    counter-increment: step;
    padding: 0.5rem 0 0.5rem 2.5rem;
    position: relative;
    font-size: 0.9rem;
}

.payment-card .step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    line-height: 28px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1E293B;
    color: rgba(255, 255, 255, 0.85);
    padding: 4rem 0 1.5rem;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
}

.footer-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.footer-brand i {
    color: var(--accent);
}

.footer-heading {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-contact li i {
    color: var(--accent);
    margin-right: 0.75rem;
    margin-top: 0.3rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    margin-right: 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 2rem 0 1.5rem;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
}

/* ===== VALUES CARD ===== */
.value-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.value-card .icon-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 2rem;
    color: var(--primary);
    transition: var(--transition);
}

.value-card:hover .icon-lg {
    background: var(--primary);
    color: var(--white);
}

/* ===== MAP PLACEHOLDER ===== */
.map-placeholder {
    height: 350px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 3.5rem 0 3rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .section {
        padding: 3.5rem 0;
    }

    .section-heading h2 {
        font-size: 1.7rem;
    }

    .navbar-collapse {
        background: var(--white);
        padding: 1rem;
        border-radius: var(--radius);
        margin-top: 0.5rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    .main-nav .nav-link {
        padding: 0.7rem 1rem !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-cta {
        margin-top: 0.5rem;
        display: inline-block;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2.5rem 0 2rem;
    }

    .hero-section h1 {
        font-size: 1.7rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .section {
        padding: 3rem 0;
    }

    .section-heading h2 {
        font-size: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.7rem;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .gallery-item {
        height: 180px;
    }
}

@media (max-width: 575.98px) {
    .hero-btns .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .contact-form,
    .contact-info-card {
        padding: 1.5rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}