/* =====================================================================
   BROWCIN — Base styles (dipakai storefront & admin)
   Mobile-first. Breakpoint: 768px (tablet), 1024px (desktop), 1280px (wide)
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --c-maroon:        #55002B;
  --c-maroon-hover:  #6E0A3B;
  --c-maroon-deep:   #3D001F;
  --c-coral:         #FF3366;
  --c-coral-hover:   #E62A59;

  /* Neutral */
  --c-white:   #FFFFFF;
  --c-bg-soft: #F8F8F8;
  --c-bg-mute: #F3F3F3;
  --c-line:    #E6E6E6;
  --c-text:    #333333;
  --c-muted:   #666666;

  /* Status (hanya untuk feedback UI) */
  --c-success:    #1E7B4A;
  --c-success-bg: #EAF6EF;
  --c-danger:     #B42318;
  --c-danger-bg:  #FDECEA;
  --c-warning:    #8A5A00;
  --c-warning-bg: #FFF4DB;

  /* Typography */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl:   clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-2xl:  clamp(2rem, 1.5rem + 2vw, 3rem);

  /* Spacing (skala 4px) */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem;   --sp-10: 2.5rem;
  --sp-12: 3rem;   --sp-16: 4rem;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(85, 0, 43, 0.06);
  --shadow:    0 4px 16px rgba(85, 0, 43, 0.08);
  --shadow-lg: 0 12px 32px rgba(85, 0, 43, 0.12);

  --touch: 44px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur:  180ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--c-maroon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-coral-hover); }
h1, h2, h3, h4 {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-maroon);
}
p { margin: 0 0 var(--sp-4); }

:focus-visible {
  outline: 2px solid var(--c-coral);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--c-maroon); color: var(--c-white); }
.btn-primary:hover { background: var(--c-maroon-hover); color: var(--c-white); }

.btn-accent { background: var(--c-coral); color: var(--c-white); }
.btn-accent:hover { background: var(--c-coral-hover); color: var(--c-white); }

.btn-outline { background: transparent; border-color: var(--c-maroon); color: var(--c-maroon); }
.btn-outline:hover { background: var(--c-maroon); color: var(--c-white); }

.btn-ghost { background: transparent; color: var(--c-text); }
.btn-ghost:hover { background: var(--c-bg-mute); color: var(--c-maroon); }

.btn-block { width: 100%; }

.btn.is-loading::after {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--sp-5); }
.field label, .label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
}
.input, .select, .textarea {
  display: block;
  width: 100%;
  min-height: var(--touch);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base); /* ≥16px: cegah auto-zoom iOS */
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-maroon);
  box-shadow: 0 0 0 3px rgba(85, 0, 43, 0.12);
}
.input.is-invalid { border-color: var(--c-danger); }
.field-error { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--c-danger); }
.field-hint  { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--c-muted); }

.input-group { position: relative; }
.input-group .input { padding-right: 52px; }
.input-group .input-action {
  position: absolute; top: 0; right: 0;
  display: grid; place-items: center;
  width: var(--touch); height: var(--touch);
  background: none; border: 0; cursor: pointer;
  color: var(--c-muted);
}
.input-group .input-action:hover { color: var(--c-maroon); }

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--c-success-bg); color: var(--c-success); }
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); }

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