/* ============================================================
   app.css — CSS Variables, Typography, Reset, Utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
    /* Brand Colors — Mentawai Palette */
    --primary:        #1B6B3A;
    --primary-light:  #2A8C4E;
    --primary-dark:   #124D2A;
    --primary-50:     #F0F9F3;
    --primary-100:    #D1EDD9;
    --primary-200:    #A3DBBB;

    --accent:         #C8860A;
    --accent-light:   #E6A020;
    --accent-dark:    #9C6808;
    --accent-50:      #FDF8EE;
    --accent-100:     #F9EDCA;

    --secondary:      #1A5276;
    --secondary-50:   #EAF2FB;

    --danger:         #C0392B;
    --danger-50:      #FDEDEC;
    --warning:        #D68910;
    --warning-50:     #FEF9E7;
    --info:           #1A6BA0;
    --info-50:        #EAF4FB;

    --white:          #FFFFFF;
    --gray-50:        #F8FAFB;
    --gray-100:       #F1F4F6;
    --gray-200:       #E2E8ED;
    --gray-300:       #CBD5DE;
    --gray-400:       #9BAAB6;
    --gray-500:       #6B7D8C;
    --gray-600:       #4A5A67;
    --gray-700:       #334352;
    --gray-800:       #1E2D3D;
    --gray-900:       #0F1923;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Plus Jakarta Sans', -apple-system, sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.25rem;
    --text-2xl:  1.5rem;
    --text-3xl:  1.875rem;
    --text-4xl:  2.25rem;

    /* Spacing */
    --space-1:  0.25rem;  --space-2:  0.5rem;
    --space-3:  0.75rem;  --space-4:  1rem;
    --space-5:  1.25rem;  --space-6:  1.5rem;
    --space-8:  2rem;     --space-10: 2.5rem;
    --space-12: 3rem;     --space-16: 4rem;

    /* Radius */
    --radius-sm:   0.375rem;
    --radius:      0.5rem;
    --radius-md:   0.75rem;
    --radius-lg:   1rem;
    --radius-xl:   1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-md: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
    --shadow-lg: 0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);
    --shadow-xl: 0 25px 50px rgba(0,0,0,.12);
    --shadow-primary: 0 4px 15px rgba(27,107,58,.25);
    --shadow-accent:  0 4px 15px rgba(200,134,10,.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition:      250ms ease;
    --transition-slow: 400ms ease;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-fixed:    300;
    --z-modal:    400;
    --z-toast:    500;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.25;
    color: var(--gray-900);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-light); }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

::selection { background: var(--primary-100); color: var(--primary-dark); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ─── Container ──────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: 900px; }

/* ─── Utilities ──────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-primary  { color: var(--primary); }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--gray-500); }
.text-danger   { color: var(--danger); }
.text-center   { text-align: center; }
.fw-medium     { font-weight: 500; }
.fw-semibold   { font-weight: 600; }
.fw-bold       { font-weight: 700; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.mb-4          { margin-bottom: var(--space-4); }
.mb-6          { margin-bottom: var(--space-6); }
.mt-4          { margin-top: var(--space-4); }

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.5s ease both; }
.animate-fade-in    { animation: fadeIn 0.4s ease both; }

/* ─── Alert ──────────────────────────────────────────────── */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: var(--text-sm);
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    animation: fadeInUp 0.3s ease;
}
.alert--success { background: var(--primary-50); border-color: var(--primary-200); color: var(--primary-dark); }
.alert--danger  { background: var(--danger-50);  border-color: #F1948A; color: var(--danger); }
.alert--warning { background: var(--warning-50); border-color: #F9E79F; color: var(--warning); }
.alert--info    { background: var(--info-50);    border-color: #AED6F1; color: var(--info); }
.alert__icon    { flex-shrink: 0; margin-top: 1px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    .container { padding: 0 var(--space-4); }
}
@media (max-width: 575px) {
    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }
}

/* ============================================================
   Botanical Background — SVG Floating Leaves
   ============================================================ */

.botanical-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Base leaf */
.leaf {
    position: absolute;
    opacity: 0;
    animation: leafFloat linear infinite;
}

/* Posisi & ukuran tiap daun */
.leaf--1 {
    top: -80px;
    left: -40px;
    width: 220px;
    color: rgba(27, 107, 58, 0.07);
    animation-duration: 0s;
    opacity: 1;
    animation: leafSway1 8s ease-in-out infinite;
    transform-origin: bottom center;
}

.leaf--2 {
    top: -60px;
    right: -30px;
    width: 180px;
    color: rgba(27, 107, 58, 0.06);
    opacity: 1;
    animation: leafSway2 10s ease-in-out infinite;
    transform-origin: bottom center;
    transform: scaleX(-1);
}

.leaf--3 {
    bottom: 10%;
    left: -30px;
    width: 160px;
    color: rgba(27, 107, 58, 0.05);
    opacity: 1;
    animation: leafSway1 12s ease-in-out infinite reverse;
    transform-origin: bottom right;
    transform: rotate(30deg);
}

.leaf--4 {
    bottom: 5%;
    right: -50px;
    width: 200px;
    color: rgba(27, 107, 58, 0.06);
    opacity: 1;
    animation: leafSway2 9s ease-in-out infinite;
    transform-origin: bottom left;
    transform: scaleX(-1) rotate(-20deg);
}

.leaf--5 {
    top: 40%;
    left: 2%;
    width: 100px;
    color: rgba(27, 107, 58, 0.04);
    opacity: 1;
    animation: leafSway1 14s ease-in-out infinite;
    transform-origin: bottom center;
    transform: rotate(15deg);
}

.leaf--6 {
    top: 18%;
    left: -20px;
    width: 280px;
    color: rgba(27, 107, 58, 0.06);
    opacity: 1;
    animation: leafSway2 11s ease-in-out infinite;
    transform-origin: left center;
    transform: rotate(-5deg);
}

.leaf--7 {
    top: 55%;
    right: -20px;
    width: 280px;
    color: rgba(27, 107, 58, 0.05);
    opacity: 1;
    animation: leafSway1 13s ease-in-out infinite reverse;
    transform-origin: right center;
    transform: rotate(5deg);
}

/* Animasi gentle sway */
@keyframes leafSway1 {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(3deg); }
    75%  { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

@keyframes leafSway2 {
    0%   { transform: scaleX(-1) rotate(0deg); }
    30%  { transform: scaleX(-1) rotate(-3deg); }
    70%  { transform: scaleX(-1) rotate(2deg); }
    100% { transform: scaleX(-1) rotate(0deg); }
}

/* Pastikan semua content di atas botanical bg */
.header, main, .footer, #pageSpinner, .disclaimer-bar {
    position: relative;
    z-index: 1;
}

/* Mobile — kurangi opacity biar ga ganggu */
@media (max-width: 768px) {
    .leaf--3, .leaf--5, .leaf--6, .leaf--7 { display: none; }
    .leaf--1 { width: 160px; }
    .leaf--2 { width: 140px; }
    .leaf--4 { width: 150px; }
}