/* ==========================================
   KEDAH SISWA CARE
   PUBLIC LANDING PAGE
   ========================================== */

/* Theme Colors */

:root {
    --ksc-green: #00542a;
    --ksc-green-dark: #003a20;
    --ksc-gold: #c08329;
    --ksc-gold-hover: #d89b3f;
    --ksc-white: #ffffff;
    --ksc-ink: #17382a;
    --ksc-border: #e6ebe8;
    --ksc-header-height: 84px;
}

/* ==========================================
   GLOBAL
   ========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', Arial, sans-serif;
    color: var(--ksc-ink);
    background: var(--ksc-white);
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

a {
    text-underline-offset: .18em;
}

:focus-visible {
    outline: 3px solid var(--ksc-gold);
    outline-offset: 3px;
}

/* Accessibility */

.skip-link {
    position: fixed;
    z-index: 1100;
    top: -100px;
    left: 12px;
    padding: 10px 16px;
    background: var(--ksc-white);
    color: var(--ksc-green);
}

.skip-link:focus {
    top: 10px;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */

.site-header {
    position: relative;
    z-index: 20;
    background: var(--ksc-white);
    border-top: 3px solid var(--ksc-green);
    box-shadow: 0 2px 14px rgba(0, 45, 24, .08);
}

.site-header .navbar {
    min-height: var(--ksc-header-height);
}

/* Logos */

.brand-logos {
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;
    gap: clamp(8px, 1.2vw, 15px);
    margin: 0;
    padding: 2px 0;
}

.brand-logos img {
    display: block;
    height: auto;
    object-fit: contain;
}

.brand-jata {
    width: clamp(40px, 4vw, 50px);
    max-height: 100px;
}

.brand-tgk {
    width: clamp(92px, 10vw, 120px);
    max-height: 52px;
}

.brand-divider {
    display: block;
    height: 36px;
    width: 1px;
    background: #d9e3dc;
}

/* Mobile Navigation */

.navbar-toggler {
    border: 1px solid #ccd9d0;
    padding: 6px 9px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(192, 131, 41, .28);
}

/* Navigation Links */

.site-header .nav-link {
    font-size: .9rem;
    font-weight: 500;
    padding: .72rem .9rem !important;
    color: var(--ksc-ink);
    border-radius: 6px;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible {
    color: var(--ksc-green);
    background: #edf5ef;
}

.site-header .nav-link.active {
    color: var(--ksc-green);
    font-weight: 700;
}

/* Registration Button */

.btn-register-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .7rem 1.25rem;
    border: 2px solid var(--ksc-green);
    border-radius: 7px;
    background: var(--ksc-green);
    color: var(--ksc-white);
    font-weight: 600;
    font-size: .89rem;
    white-space: nowrap;
}

.btn-register-nav:hover,
.btn-register-nav:focus-visible {
    background: var(--ksc-green-dark);
    color: var(--ksc-white);
    border-color: var(--ksc-green-dark);
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero {
    position: relative;
    isolation: isolate;
    flex: 1;
    min-height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--ksc-white);
    background: #102b23;
}

/* Background Carousel */

.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-carousel .hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Background Overlay */

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;

    background: linear-gradient(
        100deg,
        rgba(0, 39, 23, .88) 0%,
        rgba(0, 36, 23, .77) 53%,
        rgba(8, 28, 25, .63) 100%
    );
}

/* Hero Content */

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: 72px;
    padding-bottom: 85px;
    pointer-events: none;
}

.hero-content a {
    pointer-events: auto;
}

.hero-inner {
    max-width: 870px;
    margin-inline: auto;
    text-align: center;
}

.hero-eyebrow {
    display: block;
    margin-bottom: 22px;
    color: #eed3a0;
    font-size: clamp(.66rem, 1.2vw, .78rem);
    font-weight: 700;
    letter-spacing: .13em;
    line-height: 1.9;
}

/* Heading */

.hero h1 {
    margin: 0 0 22px;
    font-size: clamp(2.15rem, 4.4vw, 4.3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.hero h1 span {
    color: #efc783;
}

/* Description */

.hero p {
    max-width: 720px;
    margin: 0 auto 34px;
    color: #f3f5f1;
    font-size: clamp(.93rem, 1.35vw, 1.08rem);
    line-height: 1.9;
    text-wrap: pretty;
}

/* Main Registration Button */

.btn-hero-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 52px;
    padding: 13px 31px;
    border: 2px solid var(--ksc-gold);
    border-radius: 8px;
    background: var(--ksc-gold);
    color: #172b1f;
    font-weight: 700;
    font-size: .95rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.btn-hero-register:hover,
.btn-hero-register:focus-visible {
    color: #12241b;
    border-color: var(--ksc-gold-hover);
    background: var(--ksc-gold-hover);
    transform: translateY(-1px);
}

/* ==========================================
   CAROUSEL ARROWS
   ORIGINAL DESIGN - NO CIRCLES
   ========================================== */

.hero-carousel .hero-carousel-control {
    z-index: 4;
    width: clamp(38px, 6vw, 76px);
    opacity: .8;
}

.hero-carousel .hero-carousel-control:hover,
.hero-carousel .hero-carousel-control:focus-visible {
    opacity: 1;
}

/* ==========================================
   CAROUSEL INDICATORS
   CLEAN CIRCULAR DOTS / LARGE TOUCH TARGETS
   ========================================== */

.hero-carousel .hero-indicators {
    z-index: 4;
    bottom: 16px;
    margin-bottom: 0;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

/* The button remains large enough for touch; the visible dot is ::before. */
.hero-carousel .hero-indicators [data-bs-target] {
    box-sizing: border-box;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    background-clip: border-box;
    opacity: 1;
    cursor: pointer;
    text-indent: 0;
}

.hero-carousel .hero-indicators [data-bs-target]::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
    transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.hero-carousel .hero-indicators [data-bs-target]:hover::before {
    background: #ffffff;
    transform: scale(1.2);
}

.hero-carousel .hero-indicators [data-bs-target].active::before {
    background: var(--ksc-gold);
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 2px 8px rgba(0, 0, 0, .35);
}

.hero-carousel .hero-indicators [data-bs-target]:focus-visible {
    outline: 3px solid var(--ksc-gold);
    outline-offset: -4px;
}

/* ==========================================
   REGISTRATION PENDING PAGE
   ========================================== */

.pending-page {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 55px 0;
    background: #f3f7f4;
}

.pending-card {
    max-width: 680px;
    margin: 0 auto;
    padding: clamp(26px, 5vw, 56px);
    border: 1px solid var(--ksc-border);
    border-radius: 14px;
    background: var(--ksc-white);
    text-align: center;
    box-shadow: 0 14px 42px rgba(0, 45, 24, .07);
}

.pending-bar {
    height: 5px;
    width: 68px;
    margin: 0 auto 26px;
    background: var(--ksc-gold);
    border-radius: 999px;
}

.pending-eyebrow {
    color: var(--ksc-green);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.pending-card h1 {
    color: var(--ksc-green);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 700;
}

.pending-card > p:not(.pending-eyebrow) {
    margin: 16px 0 28px;
    color: #4f6055;
    line-height: 1.85;
}

/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 991.98px) {

    .site-header .navbar {
        min-height: 72px;
    }

    .site-header .navbar-collapse {
        margin-top: 12px;
        padding: 8px 0 14px;
        border-top: 1px solid var(--ksc-border);
    }

    .site-header .nav-link {
        display: block;
        padding: 11px 12px !important;
    }

    .site-header .btn-register-nav {
        display: flex;
        width: 100%;
        margin-top: 5px;
    }

    .hero {
        min-height: 530px;
    }


}

/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 575.98px) {

    .brand-jata {
        width: 35px;
    }

    .brand-tgk {
        width: 92px;
    }

    .brand-divider {
        height: 30px;
    }

    .hero {
        min-height: 540px;
    }

    /* Keep Original Arrow Style */

    .hero-carousel .hero-carousel-control {
        width: 34px;
    }

    .hero-carousel .carousel-control-prev-icon,
    .hero-carousel .carousel-control-next-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Hero Content */

    .hero-content {
        padding-top: 60px;
        padding-bottom: 78px;
    }

    .hero-eyebrow {
        margin-bottom: 16px;
        letter-spacing: .085em;
    }

    .hero h1 {
        margin-bottom: 18px;
    }

    .hero p {
        margin-bottom: 26px;
        line-height: 1.7;
    }

    .btn-hero-register {
        width: min(100%, 320px);
    }

    /* Keep the dots clear of the bottom edge on small screens. */
    .hero-carousel .hero-indicators {
        bottom: 8px;
    }

}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

    .hero-carousel.carousel-fade .carousel-item {
        transition: none !important;
    }

}

/* KSC public actions */
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.btn-hero-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 28px;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 8px;
    background: rgba(0, 42, 25, .34);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    backdrop-filter: blur(3px);
}

.btn-hero-status:hover,
.btn-hero-status:focus-visible {
    border-color: #fff;
    background: rgba(0, 58, 32, .72);
    color: #fff;
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }
}


/* ==========================================================================
   PUBLIC NAVIGATION CLEANUP
   Main navigation keeps public journeys grouped by service.
   ========================================================================== */

.site-header .ksc-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 0;
    background: transparent;
}

.site-header .ksc-dropdown-toggle::after {
    margin-left: .25rem;
    vertical-align: .12em;
}

.ksc-dropdown-menu {
    width: min(330px, calc(100vw - 2rem));
    margin-top: .45rem !important;
    padding: .45rem;
    border: 1px solid #dfe8e2;
    border-radius: .65rem;
    background: #fff;
    box-shadow: 0 16px 36px rgba(0, 45, 24, .12);
}

.ksc-dropdown-menu .dropdown-item {
    display: block;
    padding: .68rem .75rem;
    border-radius: .45rem;
    color: var(--ksc-ink);
    white-space: normal;
}

.ksc-dropdown-menu .dropdown-item:hover,
.ksc-dropdown-menu .dropdown-item:focus {
    background: #f0f6f2;
    color: var(--ksc-green);
}

.ksc-dropdown-menu .dropdown-item.active,
.ksc-dropdown-menu .dropdown-item:active {
    background: #edf5ef;
    color: var(--ksc-green);
}

.ksc-dropdown-item-title {
    display: block;
    font-size: .82rem;
    font-weight: 700;
}

.ksc-dropdown-menu small {
    display: block;
    margin-top: .12rem;
    color: #77867e;
    font-size: .68rem;
    line-height: 1.45;
}

.site-header .ksc-admin-link {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    color: #697970;
    font-size: .78rem;
    font-weight: 500;
    text-transform: none;
}

.site-header .ksc-admin-link:hover,
.site-header .ksc-admin-link:focus-visible {
    color: var(--ksc-green);
    background: transparent;
}

.ksc-admin-lock {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.site-header .btn-register-nav {
    min-width: 116px;
}

/* Returning users still get a prominent status action on the KSC landing hero,
   while the global header remains uncluttered. */
.hero-actions .btn-hero-status {
    min-width: 185px;
}

@media (max-width: 991.98px) {
    .site-header .ksc-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 11px 12px !important;
    }

    .ksc-dropdown-menu {
        width: 100%;
        margin: .15rem 0 .45rem !important;
        border: 0;
        border-left: 3px solid #dce8e1;
        border-radius: .35rem;
        box-shadow: none;
    }

    .site-header .ksc-admin-link {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        margin-top: .3rem;
        padding: .62rem .75rem !important;
        border-top: 1px solid #edf1ef;
    }
}


/* Final public header: Kedah Siswa Care itself is the visible action button. */
.site-header .ksc-portal-menu-button{
    min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;
    padding:.7rem 1.05rem;border:1px solid #00542a;border-radius:.55rem;
    background:#00542a;color:#fff;font-size:.82rem;font-weight:700;letter-spacing:.01em;box-shadow:none
}
.site-header .ksc-portal-menu-button:hover,
.site-header .ksc-portal-menu-button:focus,
.site-header .ksc-portal-menu-button.show{
    border-color:#003a20;background:#003a20;color:#fff
}
.site-header .ksc-portal-menu-button::after{margin-left:.2rem;vertical-align:.12em}
.ksc-dropdown-menu{width:min(340px,calc(100vw - 2rem))}
.ksc-dropdown-menu .dropdown-item{padding:.78rem .82rem}
.ksc-dropdown-item-title{font-size:.83rem}
.ksc-dropdown-menu small{font-size:.7rem}
.site-header .ksc-admin-link{white-space:nowrap}
@media(max-width:991.98px){
    .site-header .ksc-portal-menu-button{width:100%;justify-content:space-between;margin:.2rem 0}
    .ksc-public-dropdown .ksc-dropdown-menu{width:100%;margin-top:.2rem!important}
}
