/* ============================================
   01. CSS VARIABLES
============================================ */
:root {
    /* PRIMARY BRAND */
    --primary:      #2563EB;
    --primary-soft: #DBEAFE;
    --primary-dark: #1E40AF;

    /* ECO SECONDARY */
    --eco:          #10B981;
    --eco-soft:     #D1FAE5;

    /* BACKGROUND */
    --bg-main:      #F8FAFC;
    --bg-section:   #EEF2F7;

    /* TEXT */
    --text-main:    #1E293B;
    --text-muted:   #64748B;

    /* BORDER */
    --border-soft:  #CBD5E1;

    /* SEMANTIC */
    --success:      #16A34A;
    --warning:      #F59E0B;
    --danger:       #DC2626;
    --info:         #0284C7;
}

/* ============================================
   02. BASE & RESET
============================================ */
html, 
body {
    overflow-x: hidden;
}

body {
    color: var(--text-main);
    background-color: var(--bg-main);
}

section {
    scroll-margin-top: 60px; /* Layar HP */
}

@media (min-width: 992px) {
    section {
        scroll-margin-top: 84px; /* Layar Desktop */
    }
}

/* ============================================
   03. LAYOUT (Navbar, Footer, Hero)
============================================ */
/* Navbar */
.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-color: var(--border-soft) !important;
}

.navbar > .container-fluid {
    max-width: 1600px;
    margin-right: auto;
    margin-left: auto;
}

#main-logo {
    /* Font clamp menimpa 1.8rem dari versi sebelumnya */
    font-size: clamp(1rem, 3vw, 1.3rem) !important;
    line-height: 1.25;
    white-space: normal;
}

#mainMenu .navbar-nav .nav-link {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

/* Footer */
.footer-brand {
    font-size: 1.15rem;
    line-height: 1.3;
}

.footer-heading {
    font-size: 1.05rem;
}

/* Hero Section */
@media (max-width: 576px) {
    #hero h1 {
        font-size: 1.8rem;
    }
    #hero .fs-5 {
        font-size: 1rem !important;
    }
}

/* Layout Media Queries */
@media (min-width: 576px) {
    .footer-heading {
        font-size: 1.15rem;
    }
}

@media (min-width: 768px) {
    .navbar {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
    .footer-brand {
        font-size: 1.5rem;
    }
    .footer-heading {
        font-size: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    #mainMenu {
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        padding-bottom: 0.5rem;
        border-top: 1px solid var(--border-soft);
    }
}

/* ============================================
   04. NAVIGATION (Menus & Tabs)
============================================ */
/* Main Nav Link */
.custom-nav-link {
    position: relative;
    padding: 0.4rem 0.6rem !important; /* Menimpa padding-bottom 4px */
    font-size: 0.92rem;
    font-weight: 600;
    color: #4a5568 !important;
    transition: color 0.3s ease;
}

.custom-nav-link:hover,
.custom-nav-link.active {
    color: #0d6efd !important;
}

/* Underline Animation */
.custom-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0d6efd;
    transform: scaleX(0);
    transform-origin: bottom left;
    transition: transform 0.25s ease-out;
}

.custom-nav-link:hover::after,
.custom-nav-link.active::after {
    transform: scaleX(1);
}

/* Nav Tab (Tentang) */
.nav-tab-item:hover {
    color: var(--primary) !important;
    background-color: var(--bg-section);
}

.nav-tab-item.active {
    font-weight: 600 !important;
    color: var(--primary) !important;
    background-color: var(--primary-soft);
}

.overflow-auto::-webkit-scrollbar {
    display: none;
}

/* ============================================
   05. BUTTONS
============================================ */
/* Btn Primary */
.btn-primary {
    position: relative;
    overflow: hidden;
    background-color: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(1px) scale(0.98);
}

/* Btn Outline Success (Eco) */
.btn-outline-success {
    color: var(--eco);
    border-color: var(--eco);
}

.btn-outline-success:hover {
    background-color: var(--eco);
    border-color: var(--eco);
}

/* Btn Kontribusi */
.btn-kontribusi {
    animation: pulse-primary 2s ease 1s 3;
}

.btn-kontribusi::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
}

.btn-kontribusi:hover {
    color: white !important;
    background-color: var(--primary-dark) !important;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-3px) !important;
}

.btn-kontribusi:active {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
    transform: translateY(-1px) !important;
}

.btn-kontribusi:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
}

/* Btn Pelajari */
.btn-pelajari {
    color: white !important;
    background-color: var(--eco) !important;
    border-color: var(--eco) !important;
    animation: pulse-eco 2s ease 1.3s 3;
}

.btn-pelajari:hover {
    color: white !important;
    background-color: #0da271 !important;
    border-color: #0da271 !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-3px) !important;
}

.btn-pelajari:active {
    transform: translateY(-1px) !important;
}

/* Btn CTA Wrapper */
.btn-cta-wrapper .btn {
    padding: 0.4rem 1.1rem;
    font-size: 0.85rem;
}

.btn-submit-kontribusi {
    background-color: var(--eco);
    border-color: var(--eco);
    color: white;
    transition: all 0.25s ease;
}

.btn-submit-kontribusi:hover:not(:disabled) {
    background-color: #2f855a; /* sedikit lebih gelap dari var(--eco) saat hover */
    border-color: #2f855a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(47, 133, 90, 0.3);
}

.btn-submit-kontribusi:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-submit-kontribusi:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-close-custom {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: background 0.2s ease;
}
.btn-close-custom:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Btn Mobile Media Queries */
@media (max-width: 576px) {
    .btn-kontribusi,
    .btn-pelajari {
        justify-content: center !important;
        width: 100% !important;
        padding: 12px 24px !important;
        font-size: 0.95rem !important;
    }
}

/* ============================================
   06. CARDS & COMPONENTS
============================================ */
/* Cards */
.card {
    border-color: var(--border-soft);
}

.custom-card-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-card-shadow:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* Hover Cards variations */
.hover-card {
    cursor: default;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
    transform: translateY(-5px);
}

.product-card {
    cursor: pointer;
}

.product-card:hover {
    background-color: rgba(var(--bg-section), 0.8) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-4px);
}

.product-card:hover .flex-shrink-0 i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.feature-card {
    background-color: var(--bg-section);
    transition: all 0.3s ease-in-out;
}

.feature-card:hover {
    background-color: #FFFFFF !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
    transform: translateY(-8px);
}

/* Accordions (Global & FAQ Specific) */
.accordion-item .accordion-button.collapsed {
    color: var(--text-main) !important;
    background-color: var(--bg-section) !important;
}

#faqAccordion .accordion-button.collapsed {
    background-color: #FFFFFF !important;
    box-shadow: none !important;
}

.accordion-item .accordion-button:not(.collapsed),
#faqAccordion .accordion-button:not(.collapsed) {
    color: var(--primary) !important;
    background-color: var(--primary-soft) !important;
    box-shadow: none !important;
}

#faqAccordion .accordion-button:not(.collapsed) {
    border-bottom-right-radius: 0px !important;
    border-bottom-left-radius: 0px !important;
}

.accordion-button:focus {
    border-color: transparent !important;
    box-shadow: none !important;
}

#faqAccordion .accordion-button::after {
    filter: brightness(0) saturate(100%) invert(0%);
}

/* Foto Preview Item */
.foto-preview-item {
    position: relative;
    overflow: hidden;
    width: 90px;
    height: 90px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
}

.foto-preview-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.foto-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.foto-preview-item .btn-hapus {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
    line-height: 1;
    color: white;
    background-color: rgba(220, 38, 38, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Step Circles */
.step-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background-color: var(--border-soft);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.step-circle.active {
    color: white;
    background-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.step-circle.done {
    color: white;
    background-color: var(--eco);
}

/* Form Step */
.form-step {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.form-step.active {
    display: block;
}

/* ============================================
   07. UTILITIES OVERRIDES (Bootstrap)
============================================ */
/* Colors & Backgrounds */
.text-success           { color: var(--eco) !important; }
.bg-success             { background-color: var(--eco) !important; }
.bg-primary-subtle      { background-color: var(--primary-soft) !important; }
.bg-success-subtle      { background-color: var(--eco-soft) !important; }
.bg-light               { background-color: var(--bg-section) !important; }

/* Text */
.text-secondary         { color: var(--text-muted) !important; }
.text-muted             { color: var(--text-muted) !important; }
.text-danger            { color: var(--danger) !important; }
.text-warning-emphasis  { color: var(--warning) !important; }
.text-info              { color: var(--info) !important; }

/* Borders */
.border                 { border-color: var(--border-soft) !important; }

/* ============================================
   08. ANIMATIONS KEYFRAMES
============================================ */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-eco {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-primary {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    70%  { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}