:root{
    --brand-red: #e10d05;
    --brand-red-deep: #be1207;
    --brand-orange: #ff7a00;
    --text-dark: #161616;
    --text-soft: #6b6b6b;
    --surface: #f3f3f3;
    --surface-2: #ececec;
    --card: #ffffff;
    --line: #e6e6e6;
    --shadow-soft: 0 12px 35px rgba(0,0,0,0.06);
    --shadow-card: 0 8px 24px rgba(0,0,0,0.05);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1180px;
}

*{
    box-sizing: border-box;
}

body{
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
    color: var(--text-dark);
}

img{
    max-width: 100%;
    display: block;
}

.container{
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

/* =========================================================
   HEADER OVERRIDES
   This styles both logged-in and logged-out header states.
   It assumes your public_header.php already outputs nav links.
========================================================= */

.site-header,
.public-header,
header.public-navbar,
header.site-header{
    position: sticky;
    top: 0;
    z-index: 1200;
    background: linear-gradient(90deg, #ff7a00 0%, #ed1b00 55%, #e30000 100%);
    border-bottom: 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.site-header .container,
.public-header .container,
header.public-navbar .container,
header.site-header .container{
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.site-header a,
.public-header a,
header.public-navbar a,
header.site-header a{
    text-decoration: none;
}

.site-header .logo img,
.public-header .logo img,
header.public-navbar .logo img,
header.site-header .logo img{
    height: 54px;
    width: auto;
    object-fit: contain;
}

.site-header nav,
.public-header nav,
header.public-navbar nav,
header.site-header nav{
    display: flex;
    align-items: center;
    gap: 34px;
}

.site-header nav a,
.public-header nav a,
header.public-navbar nav a,
header.site-header nav a{
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.site-header .header-actions,
.public-header .header-actions,
header.public-navbar .header-actions,
header.site-header .header-actions{
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-header .header-search-btn,
.site-header .header-icon-btn,
.public-header .header-search-btn,
.public-header .header-icon-btn,
header.public-navbar .header-search-btn,
header.public-navbar .header-icon-btn,
header.site-header .header-search-btn,
header.site-header .header-icon-btn{
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.7);
    background: #fff;
    color: var(--brand-red-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.site-header .login-btn,
.public-header .login-btn,
header.public-navbar .login-btn,
header.site-header .login-btn{
    padding: 16px 24px;
    border-radius: 999px;
    background: #fff;
    color: var(--brand-red-deep);
    font-weight: 700;
    font-size: 16px;
}

.site-header .register-btn,
.site-header .create-account-btn,
.public-header .register-btn,
.public-header .create-account-btn,
header.public-navbar .register-btn,
header.public-navbar .create-account-btn,
header.site-header .register-btn,
header.site-header .create-account-btn{
    padding: 16px 28px;
    border-radius: 999px;
    background: #bc1608;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.site-header .profile-avatar,
.public-header .profile-avatar,
header.public-navbar .profile-avatar,
header.site-header .profile-avatar{
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.85);
}

.site-header .profile-avatar img,
.public-header .profile-avatar img,
header.public-navbar .profile-avatar img,
header.site-header .profile-avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================
   HERO
========================================================= */

.home-hero{
    position: relative;
    background: linear-gradient(90deg, #ff7200 0%, #f14000 40%, #dd0303 100%);
    overflow: hidden;
    min-height: 620px;
    display: flex;
    align-items: center;
}

.home-hero-bg{
    position: absolute;
    inset: 0;
    z-index: 1;
}

.home-hero-bg img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    opacity: 0.95;
}

.home-hero::after{
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.18)),
        linear-gradient(90deg, rgba(255,122,0,0.15), rgba(227,0,0,0.15));
    z-index: 2;
}

.home-hero .container{
    position: relative;
    z-index: 3;
}

.home-hero-content{
    max-width: 540px;
    padding: 90px 0 110px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
}

.home-hero-content h1{
    margin: 0 0 14px;
    font-size: 56px;
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -1px;
}

.home-hero-content p{
    margin: 0 0 26px;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
}

.home-search-form{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.home-search-form input{
    width: 100%;
    max-width: 430px;
    height: 56px;
    border: none;
    outline: none;
    border-radius: 999px;
    background: #fff;
    padding: 0 22px;
    font-size: 15px;
    box-shadow: var(--shadow-soft);
}

.home-search-form button{
    border: none;
    outline: none;
    height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
}

.home-search-form button:hover{
    transform: translateY(-2px);
    background: #000;
}

/* =========================================================
   GENERAL SECTIONS
========================================================= */

.home-section{
    padding: 82px 0;
}

.light-bg{
    background: #f5f5f5;
}

.features-band{
    background: #efeded;
}

.section-heading{
    margin-bottom: 34px;
}

.section-heading.center{
    text-align: center;
}

.section-heading h2,
.section-title-row h2{
    margin: 0;
    font-size: 50px;
    line-height: 1.06;
    letter-spacing: -1px;
    font-weight: 800;
    color: #111;
}

.section-heading p{
    margin: 12px auto 0;
    max-width: 550px;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.65;
}

.big-heading h2{
    max-width: 760px;
    margin: 0 auto;
}

.section-title-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.home-cards-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

/* =========================================================
   OPPORTUNITY CARD OVERRIDE
   Works with included opportunity_card.php
========================================================= */

.cards-grid,
.scholarship-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.opportunity-card,
.cards-grid > *{
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    transition: 0.28s ease;
    overflow: hidden;
}

.opportunity-card:hover,
.cards-grid > *:hover{
    transform: translateY(-5px);
    box-shadow: 0 16px 35px rgba(0,0,0,0.08);
}

.section-cta{
    text-align: center;
    margin-top: 34px;
}

.primary-pill-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 210px;
    height: 56px;
    padding: 0 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, #da1a08 0%, #b70f06 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(197, 30, 11, 0.25);
    transition: 0.25s ease;
}

.primary-pill-btn:hover{
    transform: translateY(-2px);
}

/* =========================================================
   CATEGORY BLOCKS
========================================================= */

.category-grid{
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.category-box{
    min-height: 170px;
    border-radius: 16px;
    padding: 28px 22px;
    text-decoration: none;
    color: #111;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.28s ease;
}

.category-box span{
    font-size: 19px;
    font-weight: 700;
}

.category-box:hover{
    transform: translateY(-4px);
}

.category-icon{
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-size: 22px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.category-awards{ background: #ece9df; }
.category-bursary{ background: #dfedf0; }
.category-competitions{ background: #e4eaf4; }
.category-conferences{ background: #e7eee0; }
.category-contests{ background: #deedf1; }

/* =========================================================
   ACCOUNT FEATURES
========================================================= */

.account-feature-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 38px;
}

.account-feature-card{
    background: #fff;
    border-radius: 16px;
    padding: 30px 26px;
    box-shadow: var(--shadow-card);
    min-height: 295px;
}

.account-feature-icon{
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 22px;
    color: #fff;
}

.account-feature-icon.amber{ background: #d47611; }
.account-feature-icon.cyan{ background: #11b4c4; }
.account-feature-icon.purple{ background: #8b1cf1; }

.account-feature-card h3{
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
}

.account-feature-card p{
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 14px;
}

/* =========================================================
   DESTINATIONS
========================================================= */

.destination-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.destination-card{
    position: relative;
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-card);
}

.destination-card img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.45s ease;
}

.destination-card::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.05));
}

.destination-card span{
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.destination-card:hover img{
    transform: scale(1.06);
}

/* =========================================================
   HOW IT WORKS
========================================================= */

.how-grid{
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

.how-left h2{
    margin: 0;
    font-size: 54px;
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -1px;
}

.how-right{
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: relative;
}

.how-right::before{
    content: "";
    position: absolute;
    left: 24px;
    top: 28px;
    bottom: 28px;
    width: 2px;
    background: #d7d7d7;
}

.how-step{
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 22px;
    position: relative;
}

.how-step-number{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ecebdc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    position: relative;
    z-index: 2;
}

.how-step:nth-child(2) .how-step-number{ background: #ddecf0; }
.how-step:nth-child(3) .how-step-number{ background: #e6e7f5; }
.how-step:nth-child(4) .how-step-number{ background: #e4edde; }

.how-step-content h3{
    margin: 2px 0 8px;
    font-size: 31px;
    line-height: 1.15;
    font-weight: 800;
}

.how-step-content p{
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
    max-width: 650px;
    font-size: 15px;
}

/* =========================================================
   TIPS
========================================================= */

.tips-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.tip-card{
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    color: #111;
    transition: 0.25s ease;
}

.tip-card:hover{
    transform: translateY(-4px);
}

.tip-card img{
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tip-card-body{
    padding: 16px;
}

.tip-card-body h3{
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 700;
}

.tip-card-body span{
    color: var(--text-soft);
    font-size: 13px;
}

/* =========================================================
   FOOTER POLISH
========================================================= */

footer,
.site-footer,
.public-footer{
    background: #f2f2f2;
    padding-top: 35px;
    border-top: 1px solid #e5e5e5;
}

footer a,
.site-footer a,
.public-footer a{
    text-decoration: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px){
    .home-cards-grid,
    .cards-grid,
    .scholarship-grid,
    .destination-grid,
    .tips-grid{
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .category-grid{
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px){
    .home-hero{
        min-height: 520px;
    }

    .home-hero-content h1{
        font-size: 44px;
    }

    .section-heading h2,
    .section-title-row h2{
        font-size: 40px;
    }

    .how-grid{
        grid-template-columns: 1fr;
    }

    .how-left h2{
        font-size: 42px;
    }

    .home-cards-grid,
    .cards-grid,
    .scholarship-grid,
    .destination-grid,
    .tips-grid,
    .account-feature-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px){
    .container{
        width: min(100% - 24px, var(--container));
    }

    .home-section{
        padding: 58px 0;
    }

    .home-hero{
        min-height: 430px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .home-hero-bg img{
        object-position: center bottom;
    }

    .home-hero-content{
        padding: 78px 0 70px;
        max-width: 100%;
    }

    .home-hero-content h1{
        font-size: 28px;
        line-height: 1.14;
    }

    .home-hero-content p{
        font-size: 14px;
        margin-bottom: 20px;
    }

    .home-search-form input{
        height: 48px;
        max-width: 280px;
        font-size: 13px;
    }

    .home-search-form button{
        height: 44px;
        padding: 0 22px;
        font-size: 13px;
    }

    .section-heading h2,
    .section-title-row h2{
        font-size: 24px;
        line-height: 1.15;
    }

    .section-heading p{
        font-size: 13px;
    }

    .section-title-row{
        margin-bottom: 20px;
    }

    .section-title-row-center-mobile{
        justify-content: center;
        text-align: center;
    }

    .home-cards-grid,
    .cards-grid,
    .scholarship-grid,
    .destination-grid,
    .tips-grid,
    .account-feature-grid,
    .category-grid{
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .category-box{
        min-height: 128px;
    }

    .account-feature-card{
        min-height: auto;
        padding: 24px 20px;
    }

    .destination-card{
        height: 210px;
    }

    .how-left h2{
        font-size: 24px;
        line-height: 1.2;
    }

    .how-right::before{
        left: 21px;
    }

    .how-step{
        grid-template-columns: 54px 1fr;
        gap: 16px;
    }

    .how-step-number{
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .how-step-content h3{
        font-size: 20px;
    }

    .how-step-content p{
        font-size: 13px;
    }

    .tip-card img{
        height: 155px;
    }

    .primary-pill-btn{
        min-width: 170px;
        height: 48px;
        font-size: 13px;
        padding: 0 20px;
    }

    .site-header .container,
    .public-header .container,
    header.public-navbar .container,
    header.site-header .container{
        min-height: 72px;
    }

    .site-header .logo img,
    .public-header .logo img,
    header.public-navbar .logo img,
    header.site-header .logo img{
        height: 40px;
    }

    .site-header nav,
    .public-header nav,
    header.public-navbar nav,
    header.site-header nav{
        display: none;
    }

    .site-header .login-btn,
    .site-header .register-btn,
    .site-header .create-account-btn,
    .public-header .login-btn,
    .public-header .register-btn,
    .public-header .create-account-btn,
    header.public-navbar .login-btn,
    header.public-navbar .register-btn,
    header.public-navbar .create-account-btn,
    header.site-header .login-btn,
    header.site-header .register-btn,
    header.site-header .create-account-btn{
        display: none;
    }

    .site-header .header-search-btn,
    .site-header .header-icon-btn,
    .public-header .header-search-btn,
    .public-header .header-icon-btn,
    header.public-navbar .header-search-btn,
    header.public-navbar .header-icon-btn,
    header.site-header .header-search-btn,
    header.site-header .header-icon-btn{
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .site-header .profile-avatar,
    .public-header .profile-avatar,
    header.public-navbar .profile-avatar,
    header.site-header .profile-avatar{
        width: 40px;
        height: 40px;
    }
}