/* ════════════════════════════════════════════════════════════
   RahnMas — Base Styles
   Palette: Gold + Emerald + Cream untuk nuansa syariah elegan
   ──────────────────────────────────────────────────────────── */

:root {
    /* ── Palette utama ─────────────────────────────────── */
    --gold-50:  #FBF6EB;
    --gold-100: #F5E9CC;
    --gold-200: #EBD494;
    --gold-300: #DFB95C;
    --gold-400: #D4A23B;
    --gold-500: #C8922A;    /* primary gold */
    --gold-600: #A87420;
    --gold-700: #835A19;
    --gold-800: #5C3F11;
    --gold-900: #3D2A0B;

    --emerald-50:  #ECFDF5;
    --emerald-100: #D1FAE5;
    --emerald-200: #A7F3D0;
    --emerald-300: #6EE7B7;
    --emerald-400: #34D399;
    --emerald-500: #10B981;    /* primary emerald */
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065F46;
    --emerald-900: #064E3B;

    --cream-50:  #FDFBF6;       /* paling terang, background utama */
    --cream-100: #FAF6EC;
    --cream-200: #F2EBD6;
    --cream-300: #E8DDB8;

    /* ── Neutrals ──────────────────────────────────────── */
    --slate-50:  #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;

    /* ── Semantic ──────────────────────────────────────── */
    --success: var(--emerald-500);
    --success-bg: var(--emerald-50);
    --success-text: var(--emerald-800);

    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-text: #92400E;

    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --danger-text: #991B1B;

    --info: #2563EB;
    --info-bg: #EFF6FF;
    --info-text: #1E40AF;

    /* ── Tokens ────────────────────────────────────────── */
    --primary:        var(--gold-500);
    --primary-hover:  var(--gold-600);
    --primary-light:  var(--gold-50);
    --accent:         var(--emerald-600);
    --accent-hover:   var(--emerald-700);
    --accent-light:   var(--emerald-50);

    --bg:             var(--cream-50);
    --surface:        #FFFFFF;
    --surface-2:      var(--cream-100);
    --surface-3:      var(--slate-50);

    --text:           var(--slate-900);
    --text-2:         var(--slate-700);
    --text-dim:       var(--slate-500);
    --text-muted:     var(--slate-400);

    --border:         var(--cream-300);
    --border-2:       var(--slate-200);
    --border-strong:  var(--slate-300);

    /* ── Shadows ───────────────────────────────────────── */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    --shadow-gold: 0 4px 12px rgba(200, 146, 42, 0.18);
    --shadow-emerald: 0 4px 12px rgba(16, 185, 129, 0.18);

    /* ── Spacing & Radius ──────────────────────────────── */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-2xl: 28px;
    --r-full: 9999px;

    /* ── Typography ────────────────────────────────────── */
    --font-display: 'Playfair Display', 'Georgia', serif;
    --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

    /* ── Layout ────────────────────────────────────────── */
    --container-max: 1200px;
    --header-h: 72px;
    --sidebar-w: 260px;
    --bottomnav-h: 64px;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

/* ── TYPOGRAPHY ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.625rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.text-xs   { font-size: 0.75rem;   }
.text-sm   { font-size: 0.875rem;  }
.text-base { font-size: 1rem;      }
.text-lg   { font-size: 1.125rem;  }
.text-xl   { font-size: 1.25rem;   }
.text-2xl  { font-size: 1.5rem;    }
.text-3xl  { font-size: 1.875rem;  }
.text-4xl  { font-size: 2.25rem;   }

.text-dim       { color: var(--text-dim); }
.text-muted     { color: var(--text-muted); }
.text-primary   { color: var(--primary); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success-text); }
.text-warning   { color: var(--warning-text); }
.text-danger    { color: var(--danger-text); }

.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ── LAYOUT UTILS ──────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem;   } }

.flex   { display: flex; }
.iflex  { display: inline-flex; }
.grid   { display: grid; }
.block  { display: block; }
.hidden { display: none !important; }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }  .mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }  .mb-8 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.w-full { width: 100%; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

/* ── SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ── SELECTION ─────────────────────────────────────────── */
::selection {
    background: var(--gold-200);
    color: var(--gold-900);
}

/* ── FOCUS RING ────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ── A11Y ──────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Untuk reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
