:root {
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #1b1f24;
  --muted: #5f6b7a;
  --border: #e2e6eb;
  --accent: #2f6fed;
  --accent-contrast: #ffffff;
  --ok: #1f9d55;
  --ok-bg: #e3f5ea;
  --warn: #b97400;
  --warn-bg: #fdf1d8;
  --over: #d23f3f;
  --over-bg: #fbe4e4;
  --star: #e09b00;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px rgb(0 0 0 / 0.08);
  color-scheme: light;
}

/* Tema gelap: dipilih lewat tombol, atau otomatis kalau perangkat memakai mode gelap. */
:root[data-theme='dark'] {
  --bg: #111418;
  --bg-alt: #161a1f;
  --surface: #1a1e24;
  --surface-2: #232830;
  --text: #e8ebef;
  --muted: #96a1ae;
  --border: #2c323b;
  --accent: #6b9bff;
  --accent-contrast: #0d1117;
  --ok: #4cc77f;
  --ok-bg: #173324;
  --warn: #f0b545;
  --warn-bg: #3a2c10;
  --over: #ff6b6b;
  --over-bg: #3d1a1a;
  --star: #f0b545;
  --shadow: 0 12px 32px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111418;
    --bg-alt: #161a1f;
    --surface: #1a1e24;
    --surface-2: #232830;
    --text: #e8ebef;
    --muted: #96a1ae;
    --border: #2c323b;
    --accent: #6b9bff;
    --accent-contrast: #0d1117;
    --ok: #4cc77f;
    --ok-bg: #173324;
    --warn: #f0b545;
    --warn-bg: #3a2c10;
    --over: #ff6b6b;
    --over-bg: #3d1a1a;
  --star: #f0b545;
    --shadow: 0 12px 32px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}
.narrow {
  max-width: 720px;
}
.muted {
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.15s, background 0.15s;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-ghost {
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-light {
  background: #ffffff;
  color: #1b1f24;
}
.btn-light:hover {
  filter: brightness(0.95);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.brand img {
  border-radius: 7px;
}
.nav-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--text);
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 80px;
  background: radial-gradient(1000px 400px at 80% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.lead {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 540px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Mockup ---------- */

.mockup {
  position: relative;
}
.mock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 16px;
}
.mock-head strong {
  font-size: 1.1rem;
}
.mock-eyebrow {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.mock-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.mock-amount {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.fill.ok {
  background: var(--ok);
}
.fill.warn {
  background: var(--warn);
}
.fill.over {
  background: var(--over);
}
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.over {
  background: var(--over-bg);
  color: var(--over);
}
.mock-toast {
  position: absolute;
  left: -24px;
  bottom: -60px;
  max-width: 300px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}

/* ---------- Sections ---------- */

.section {
  padding: 80px 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 40px;
}
.section-title.left {
  text-align: left;
  margin-bottom: 16px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.feature-icon {
  font-size: 1.6rem;
}
.feature h3 {
  font-size: 1.05rem;
  margin: 12px 0 6px;
}
.feature p {
  margin: 0;
  color: var(--muted);
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
}
.steps h3 {
  margin: 14px 0 6px;
  font-size: 1.1rem;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

.privacy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.privacy p {
  color: var(--muted);
  margin: 0;
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.checklist li {
  padding: 16px 18px 16px 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  position: relative;
}
.checklist li::before {
  content: '✓';
  position: absolute;
  left: 18px;
  top: 15px;
  color: var(--ok);
  font-weight: 700;
}
.checklist li:last-child::before {
  content: '!';
  color: var(--warn);
  left: 22px;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}
details[open] summary::after {
  content: '−';
}
details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.cta-band {
  background: linear-gradient(135deg, #2f6fed, #1e4fc2);
  color: #ffffff;
  border-radius: 20px;
  padding: 56px 24px;
  text-align: center;
}
.cta-band h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 8px;
}
.cta-band p {
  margin: 0 0 24px;
  opacity: 0.85;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Focus ---------- */

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero {
    padding: 48px 0 72px;
  }
  .hero-inner,
  .privacy {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .features,
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .mock-toast {
    left: 12px;
  }
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }
  .nav-inner {
    gap: 12px;
  }
  .theme-toggle {
    margin-left: auto;
  }
  .features,
  .steps {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 56px 0;
  }
  .cta-row .btn {
    flex: 1 1 100%;
  }
  .mock-toast {
    position: static;
    margin-top: 12px;
    max-width: none;
  }
}

/* ---------- Review ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.nav-links a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}
.page-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.review-summary.centered {
  justify-content: center;
  margin-top: -24px;
}
.review-summary[hidden] {
  display: none;
}
.review-average {
  font-size: 2rem;
  font-weight: 700;
}
.review-stars {
  color: var(--star);
  letter-spacing: 2px;
}
.review-summary .review-stars {
  font-size: 1.2rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.review-grid > p {
  grid-column: 1 / -1;
  text-align: center;
}
.review-list {
  display: grid;
  gap: 12px;
}
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.review-message {
  margin: 8px 0 12px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.review-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.review-meta strong {
  color: var(--text);
}
.review-cta {
  text-align: center;
  margin-top: 32px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.review-form-card {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.review-form-card h2 {
  font-size: 1.25rem;
}
.review-form-card .small,
.form-status {
  font-size: 0.9rem;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.95rem;
}
.form-field .muted {
  font-weight: 400;
}
.form-field input,
.form-field textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.form-field textarea {
  resize: vertical;
  min-height: 120px;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
#message-count {
  justify-self: end;
}

.rating-field {
  border: 0;
  padding: 0;
  margin: 16px 0;
}
.rating-field legend {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  padding: 0;
}
/* Bintang dari kanan ke kiri supaya hover/checked bisa mewarnai bintang "sebelumnya" dengan selector ~ */
.star-input {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}
.star-input input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.star-input label {
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--border);
  transition: color 0.1s, transform 0.1s;
}
.star-input label::before {
  content: '★';
}
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
  color: var(--star);
}
.star-input label:hover {
  transform: scale(1.1);
}
.star-input input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
}
.form-status.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.form-status.is-error {
  background: var(--over-bg);
  color: var(--over);
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
button.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 860px) {
  .review-grid {
    grid-template-columns: 1fr;
  }
  .review-layout {
    grid-template-columns: 1fr;
  }
  .review-form-card {
    position: static;
    order: -1;
  }
}
