/*
 * Design token diambil dari prudential.co.id (Oktober 2026):
 * Open Sans, primary #ED1B2E (warna "PRU" di judul produk), teks #1c1d1b, input radius 8px, tombol & pill membulat penuh,
 * pilihan terpilih lavender #f7f4fc / #c0ade9, error #6d150e di atas #fbeae8.
 */
:root {
  --red: #ed1b2e;
  --red-hover: #c91727;
  --red-dark: #6d150e;
  --red-tint: #fbeae8;
  --red-soft: #f6c9c6;

  --ink: #1c1d1b;
  --ink-2: #373a36;
  --muted: #696b68;
  --slate: #5b6770;

  --line: #cdcecd;
  --line-input: #696b68;
  --gray: #ebebeb;
  --surface: #f8f9fb;
  --white: #ffffff;

  --ok: #3f6b3d;     /* hijau dari palet brand (#4e714c), digelapkan untuk kontras teks */
  --warn: #8a5300;
  --wa: #1a7f4b;
  --wa-hover: #146a3e;

  --select-bg: #f7f4fc;
  --select-line: #c0ade9;

  --font: 'Open Sans', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --gutter: 16px;
  --radius-input: 8px;
  --radius-pill: 6rem;
}

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

/* Atribut hidden harus menang atas display apa pun (mis. .button, .step) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  letter-spacing: -0.01em;
}

a { color: var(--red); }
a:hover { color: var(--red-hover); }
code { font-family: var(--mono); font-size: 0.9em; }
.accent { color: var(--red); }

:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }

.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;
}

/* ---------- Kerangka ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px var(--gutter);
  background: var(--white);
  border-bottom: 1px solid var(--gray);
}
.topbar-home { display: inline-flex; text-decoration: none; }
.topbar-name { flex: none; white-space: nowrap; font-weight: 700; color: var(--ink); }
.topbar-with { color: var(--muted); font-size: 14px; text-align: right; }

.page { max-width: 640px; margin: 0 auto; padding: 28px var(--gutter) 56px; }
.page-wide { max-width: 1280px; }
.page-product { max-width: 1040px; padding-top: 0; }
/* Garis pemisah selebar kolom form, walau section produk lebih lebar */
.page-product > .divider { max-width: 608px; margin: 0 auto 40px; }

.hint { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.block { margin-top: 40px; }
.block h2, .prose h2 { margin: 0 0 12px; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }

.page-product { padding-bottom: 64px; }

/* ---------- Tombol (gaya .cmp-button brand) ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 600 16px/1.5 var(--font);
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.button-primary { background: var(--red); color: var(--white); }
.button-primary:hover, .button-primary:active { background: var(--red-hover); color: var(--white); }
.button-primary:disabled { background: var(--red-soft); cursor: progress; }
.button-secondary { background: transparent; color: var(--ink-2); border-color: var(--ink-2); }
.button-secondary:hover { background: var(--gray); color: var(--ink-2); }
.button-block { width: 100%; }
.button-sm { min-height: 40px; padding: 8px 18px; font-size: 14px; }

/* ---------- Navigasi atas ---------- */

.topnav { position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--gray); }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 12px var(--gutter); }
.topnav-home { display: block; flex: none; }
.topnav-logo { display: block; width: 136px; height: auto; }
@media (min-width: 640px) { .topnav-logo { width: 160px; } }

/* ---------- Form ---------- */

.form-banner { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; margin: 0 0 24px; border-radius: var(--radius-input); background: var(--gray); }
.form-head { margin-bottom: 8px; }
.confirmation { margin: 0; color: var(--ink-2); }
.form-title { margin: 0 0 12px; font-weight: 700; font-size: clamp(28px, 7.5vw, 36px); line-height: 1.2; letter-spacing: -0.02em; outline: none; }
.form-desc p { margin: 0 0 12px; color: var(--ink-2); }
.req-note { margin: 16px 0 0; padding-bottom: 20px; border-bottom: 1px solid var(--gray); color: var(--red); font-size: 14px; }

.step-title { margin: 24px 0 20px; font-weight: 600; font-size: 18px; line-height: 1.4; letter-spacing: -0.02em; outline: none; }
.step-desc { margin: -8px 0 20px; color: var(--ink-2); }
.step > .question:first-child { margin-top: 24px; }

.question { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.q-label {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-line; /* judul pertanyaan asli bisa dua baris */
}
.req { color: var(--red); }

input[type='text'], input[type='email'], input[type='tel'], input[type='date'], input[type='search'], select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-input);
  border-radius: var(--radius-input);
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.5 var(--font); /* 16px mencegah zoom otomatis di iOS */
  letter-spacing: -0.01em;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(237, 27, 46, 0.15); }

/* Radio daftar: lingkaran merah saat dipilih (gaya form kontak brand) */
.choices { display: flex; flex-direction: column; gap: 4px; }
.radio { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; color: var(--ink); }
.radio input, .consent input { flex: none; margin: 2px 0 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: var(--white); border: 1px solid var(--line-input); }
.radio input { width: 20px; height: 20px; border-radius: 50%; transition: border-color 0.2s ease, background 0.2s ease; }
.radio input:checked { border-color: var(--red); background: radial-gradient(circle, var(--white) 0 3px, var(--red) 3.5px); }
.radio input:focus-visible, .consent input:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 2px; }

/* Pill: opsi pendek seperti jam & hari (gaya .time-selector .pill brand) */
.choices.is-pills { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--slate);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.pill input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.pill:hover { border-color: var(--muted); }
.pill.is-selected { background: var(--select-bg); border-color: var(--select-line); color: var(--ink); }
.pill:focus-within { outline: 2px solid var(--ink-2); outline-offset: 2px; }
.other-input { margin-top: 10px; }

/* Verifikasi WhatsApp (Tap-to-Verify) */
.otp-row { display: flex; gap: 8px; align-items: stretch; }
.otp-row > input { flex: 1; min-width: 0; }
.otp-row > .button { flex: none; min-height: 44px; padding: 8px 18px; font-size: 14px; }
.otp-panel { margin-top: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--gray); border-radius: var(--radius-input); }
.otp-title { margin: 0 0 8px; font-weight: 600; }
.otp-steps { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.otp-steps li { margin-bottom: 4px; }
/* Hijau WhatsApp yang digelapkan agar teks putih tetap terbaca (kontras ≥ 4.5:1) */
.button-wa { width: 100%; background: var(--wa); color: var(--white); }
.button-wa:hover, .button-wa:active { background: var(--wa-hover); color: var(--white); }
.otp-manual { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.otp-manual summary { cursor: pointer; font-weight: 600; color: var(--red); }
.otp-manual p { margin: 8px 0; }
.otp-message { padding: 10px 12px; background: var(--white); border: 1px dashed var(--line); border-radius: 6px; font-family: var(--mono); font-size: 13px; word-break: break-word; }
.otp-meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.otp-status { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.otp-status:empty { display: none; }
.otp-status.is-ok { color: var(--ok); font-weight: 600; }
.otp-status.is-warn { color: var(--warn); font-weight: 600; }
.otp-status.is-error { color: var(--red-dark); font-weight: 600; }
.otp-status.is-wait::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid var(--line); border-top-color: var(--wa); border-radius: 50%; vertical-align: -1px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input[readonly] { background: var(--surface); color: var(--ink-2); }
.link-button { padding: 0; border: 0; background: none; color: var(--red); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.link-button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.otp-change { margin-top: 6px; font-size: 13px; }

/* Checkbox persetujuan */
.consent { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); font-size: 14px; line-height: 1.55; cursor: pointer; }
.consent input { width: 20px; height: 20px; border-radius: 4px; }
.consent input:checked {
  border-color: var(--red);
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.operator-consent { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--gray); }

/* Error (gaya .input-error / .error-message brand) */
.question.has-error input[type='text'], .question.has-error input[type='email'], .question.has-error input[type='tel'],
.question.has-error input[type='date'], .question.has-error select {
  background: var(--red-tint);
  border-color: var(--red-dark);
}
.question.has-error .radio input, .question.has-error .consent input:not(:checked), .question.has-error .pill { border-color: var(--red-dark); }
.error { margin: 8px 0 0; color: var(--red-dark); font-size: 13px; font-weight: 600; line-height: 1.3; }
.error:empty { display: none; }
.form-error { margin: 0 0 12px; color: var(--red-dark); font-weight: 600; }
.form-error:empty { display: none; }

.nav { display: flex; gap: 12px; margin-top: 8px; }
.nav .button-primary { flex: 1; }

.progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.progress { flex: 1; height: 6px; background: var(--gray); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--red); transition: width 250ms ease; }
.progress-label { flex: none; color: var(--muted); font-size: 13px; }

.notice { padding: 14px; background: var(--red-tint); border-radius: var(--radius-input); color: var(--red-dark); }

/* ---------- Informasi produk (Highlights + Detail produk) ---------- */

.divider { height: 0; margin: 40px 0; border: 0; border-top: 1px solid var(--gray); }

.product-heading { margin: 0 0 24px; text-align: center; font-weight: 600; font-size: 24px; letter-spacing: -0.02em; }
.highlights { display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; }
.highlight { display: flex; align-items: flex-start; gap: 14px; }
.highlight-icon { flex: none; width: 32px; height: 32px; }
.highlight-title { margin: 0 0 4px; font-weight: 600; font-size: 18px; line-height: 1.35; letter-spacing: -0.02em; }
.highlight-text { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

.detail-heading { margin: 48px 0 16px; font-weight: 300; font-size: 26px; letter-spacing: -0.02em; }
.detail-heading strong { font-weight: 700; }

/* minmax(0, 1fr) + min-width: 0: tabel lebar hanya bisa di-scroll di dalam panel, tidak melebarkan halaman */
.accordion { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.acc { min-width: 0; background: var(--surface); border-radius: 12px; }
.acc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.acc-summary::-webkit-details-marker { display: none; }
.acc-icon { position: relative; flex: none; width: 14px; height: 14px; }
.acc-icon::before, .acc-icon::after { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: var(--ink); transition: transform 0.2s ease; }
.acc-icon::after { transform: rotate(90deg); }
.acc[open] .acc-icon::after { transform: rotate(0deg); }
.acc-body { padding: 0 20px 20px; overflow-x: auto; color: var(--ink-2); font-size: 14px; }
.acc-body p { margin: 0 0 8px; }
.acc-body ul, .acc-body ol { margin: 0 0 12px; padding-left: 20px; }
.acc-body li { margin-bottom: 6px; }
.acc-body table { width: 100%; min-width: 480px; margin: 8px 0 16px; border-collapse: collapse; background: var(--white); font-size: 13px; }
.acc-body td, .acc-body th { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.acc-body td p { margin: 0; }

@media (min-width: 720px) {
  .highlights { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

/* ---------- Privasi ---------- */

.prose h1 { font-weight: 300; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
.prose h2 { margin-top: 28px; }
.prose ul { padding-left: 20px; color: var(--ink-2); }

/* ---------- Admin ---------- */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { padding: 16px; background: var(--surface); border: 1px solid var(--gray); border-radius: var(--radius-input); }
.stat-n { display: block; font-weight: 700; font-size: 32px; line-height: 1.1; letter-spacing: -0.03em; }
.stat-l { color: var(--muted); font-size: 13px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters input[type='search'] { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 1 240px; width: auto; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.export-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--gray); border-radius: var(--radius-input); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--gray); text-align: left; vertical-align: top; white-space: nowrap; }
.table th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
.table tr.is-flagged td { background: var(--red-tint); }
.mono { font-family: var(--mono); }
.empty { padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius-input); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
