/* ==================================================
   BASE - TOKEN, RESET, KOMPONEN DASAR
================================================== */

:root {
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-soft: #fff7ed;
  --amber-line: #fed7aa;

  --navy: #14213d;
  --navy-dark: #0f1a31;

  --wa: #25d366;
  --wa-dark: #1ebe5d;

  --ink: #181a1f;
  --body: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --surface-mute: #f1f3f5;

  --line: #e5e7eb;
  --line-strong: #d9dde3;

  --ok: #15803d;
  --ok-soft: #dcfce7;
  --danger: #b91c1c;

  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-pill: 999px;

  --shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 35px rgba(15, 23, 42, 0.09);

  --t: 0.2s ease;

  --header-h: 68px;
}

/* ==================================================
   RESET
================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  min-height: 100vh;

  background: var(--surface-alt);
  color: var(--ink);

  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;

  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--muted);
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

::selection {
  background: var(--amber);
  color: #fff;
}

/* ==================================================
   LAYOUT
================================================== */

.container {
  width: 100%;
  max-width: 1180px;

  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Halaman yang isinya form atau bacaan panjang —
   baris terlalu lebar jadi susah dibaca. */

.container--narrow {
  max-width: 720px;
}

.section {
  margin-bottom: 2.5rem;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;

  gap: 1rem;

  margin-bottom: 1.15rem;
}

.section__title {
  font-size: 1.15rem;
  font-weight: 700;
}

.section__link {
  color: var(--amber-dark);

  font-size: 0.8rem;
  font-weight: 600;
}

/* ==================================================
   SKIP LINK
================================================== */

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;

  z-index: 2000;

  padding: 0.7rem 1.15rem;

  background: var(--navy);

  border-radius: 0 0 var(--r-sm) var(--r-sm);

  color: #fff;

  font-size: 0.85rem;
  font-weight: 600;

  transform: translate(-50%, -120%);

  transition: transform var(--t);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ==================================================
   BUTTON
================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 0.5rem;

  min-height: 2.75rem;

  padding: 0.7rem 1.25rem;

  border: 1px solid transparent;
  border-radius: var(--r-sm);

  font-size: 0.875rem;
  font-weight: 600;

  line-height: 1;

  transition:
    background-color var(--t),
    border-color var(--t),
    color var(--t);
}

.btn--primary {
  background: var(--navy);
  color: #fff;
}

.btn--primary:hover {
  background: var(--navy-dark);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--amber);
  color: var(--amber-dark);
}

.btn--wa {
  background: var(--wa);
  color: #fff;
}

.btn--wa:hover {
  background: var(--wa-dark);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================================================
   CHIP
================================================== */

.chip-row {
  display: flex;

  gap: 0.5rem;

  overflow-x: auto;

  padding-bottom: 0.35rem;

  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;

  gap: 0.4rem;

  flex-shrink: 0;

  padding: 0.55rem 1rem;

  background: var(--surface);

  border: 1px solid var(--line);
  border-radius: var(--r-pill);

  color: var(--muted);

  font-size: 0.8rem;
  font-weight: 500;

  transition:
    background-color var(--t),
    border-color var(--t),
    color var(--t);
}

.chip:hover {
  border-color: var(--amber);
  color: var(--amber-dark);
}

.chip.is-active,
.chip.is-active:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.chip i {
  font-size: 0.75rem;
}

/* ==================================================
   EMPTY STATE
================================================== */

.empty {
  grid-column: 1 / -1;

  padding: 2.5rem 1rem;

  color: var(--muted);

  font-size: 0.88rem;

  text-align: center;
}

.empty--search i {
  display: block;

  margin-bottom: 0.75rem;

  color: var(--line-strong);

  font-size: 1.75rem;
}

.empty__hint {
  max-width: 380px;

  margin: 0.5rem auto 0;

  color: var(--faint);

  font-size: 0.8rem;
}

/* ==================================================
   TOAST
================================================== */

.toast {
  position: fixed;

  left: 50%;
  bottom: 1.5rem;

  z-index: 1500;

  max-width: calc(100% - 2rem);

  padding: 0.75rem 1.15rem;

  background: var(--navy);

  border-radius: var(--r-pill);

  color: #fff;

  font-size: 0.82rem;
  font-weight: 500;

  text-align: center;

  opacity: 0;

  transform: translate(-50%, 1rem);

  transition:
    opacity var(--t),
    transform var(--t);

  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;

  transform: translate(-50%, 0);
}

/* ==================================================
   DIALOG DASAR
================================================== */

dialog {
  padding: 0;

  background: var(--surface);

  border: 0;
  border-radius: var(--r-lg);

  color: var(--ink);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

/* ==================================================
   VISUALLY HIDDEN
================================================== */

.visually-hidden {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: -1px;
  padding: 0;

  overflow: hidden;

  clip: rect(0, 0, 0, 0);

  white-space: nowrap;

  border: 0;
}

/* ==================================================
   REDUCED MOTION
================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================================================
   FLASH MESSAGE
   Pesan sekali tampil dari server (login, simpan, dll)
================================================== */

.flash {
  display: grid;
  gap: 0.5rem;

  margin-block: 1rem 0;

  list-style: none;
}

.flash__item {
  display: flex;
  align-items: center;

  gap: 0.6rem;

  padding: 0.75rem 1rem;

  border: 1px solid var(--ok-soft);
  border-radius: var(--r-sm);

  background: var(--ok-soft);
  color: var(--ok);

  font-size: 0.875rem;
  font-weight: 500;
}

.flash__item--error,
.flash__item--info {
  border-color: var(--amber-line);

  background: var(--amber-soft);
  color: var(--amber-dark);
}


/* ==================================================
   MOBILE
   768px
================================================== */

@media (max-width: 768px) {
  .container {
    padding-inline: 1rem;
  }

  .section__title {
    font-size: 1.05rem;
  }
}
