/* Providea Loyalty demo · pricing (js/harga.js): the landing section #harga and harga.html.
   Builds on ui.css (tokens, .btn, .npanel, .unit-pill) and loyalty.css (.lp, .lp-wrap, .lp-head, .lp-close). */
@layer screens {
  .hg { --hg-crimson: #6e1418; --hg-peach: #ffceb4; --hg-thumb: var(--bg-surface); }

  /* ── billing toggle: Bulanan | Tahunan (sliding thumb shows which period the prices use) ── */
  .hg-toggle { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 4px; border-radius: var(--radius-pill); background: var(--bg-active); box-shadow: inset 0 0 0 1px var(--border-default); }
  .hg-toggle [role='radio'] { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; transition: color var(--dur) var(--ease); }
  .hg-toggle [role='radio']:hover, .hg-toggle [aria-checked='true'] { color: var(--text-primary); }
  .hg-toggle:not(.is-ready) [aria-checked='true'] { background: var(--hg-thumb); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--border-default); }
  .hg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: var(--w, 0px); transform: translateX(var(--x, 0px)); border-radius: var(--radius-pill); background: var(--hg-thumb); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08), inset 0 0 0 1px var(--border-default); opacity: 0; }
  .hg-toggle.is-ready .hg-thumb { opacity: 1; transition: transform 320ms var(--ease), width 320ms var(--ease); }
  .hg-save { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--bg-brand-subtle); color: var(--text-brand); font-size: 12px; font-weight: 600; }
  .hg .lp-head.is-center .hg-toggle { margin-top: 10px; }
  .lp-head-row > .hg-toggle { display: inline-flex; flex-direction: row; gap: 2px; flex-shrink: 0; }

  /* text that depends on the billing period */
  .hg[data-bill='m'] [data-only='y'], .hg[data-bill='y'] [data-only='m'] { display: none; }

  /* ── plan cards: nested panel (header strip + inner card), rows aligned across cards with subgrid ── */
  .hg-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hg-plans.is-full { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hg-card { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 4px; border-radius: 20px; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border-default); }
  .hg-card-body { grid-row: span 5; display: grid; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 22px 22px 20px; border-radius: 16px; background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-default); }
  .hg-plans.is-full .hg-card { grid-row: span 7; }
  .hg-plans.is-full .hg-card-body { grid-row: span 6; padding: 22px 20px 20px; }
  .hg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; padding: 0 14px 0 18px; }
  .hg-name { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
  .hg-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-pill); background: var(--hg-peach); color: var(--hg-crimson); font-size: 12px; font-weight: 600; white-space: nowrap; }

  .hg-fit { padding-bottom: 18px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }
  .hg-price { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; min-width: 0; }
  .hg-amt-row { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
  .hg-amt { font-size: clamp(30px, 2.7vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
  .hg-plans.is-full .hg-amt { font-size: clamp(28px, 2.3vw, 34px); }
  .hg-amt.is-text { font-size: clamp(26px, 2.1vw, 30px); letter-spacing: -0.025em; }
  .hg-unit { font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
  .hg-bill { font-size: 13px; line-height: 1.45; color: var(--text-muted); }
  .hg-value { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; font-size: 13px; line-height: 1.45; font-weight: 500; color: var(--text-primary); }
  .hg-value .ic { flex-shrink: 0; margin-top: 1px; color: var(--action-primary); }
  .hg-cta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-default); }
  .hg-cta .btn { height: 44px; gap: 8px; }
  .hg-cap { font-size: 12px; line-height: 1.4; color: var(--text-muted); text-align: center; }
  .hg-list { display: flex; flex-direction: column; gap: 10px; }
  .hg-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
  .hg-list .ic { flex-shrink: 0; margin-top: 1px; color: var(--action-primary); }
  .hg-list li.is-all { font-weight: 600; }
  .hg-not { padding-top: 18px; }
  .hg-not:empty { padding: 0; }
  .hg-not-h { margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .hg-not ul { display: flex; flex-direction: column; gap: 8px; }
  .hg-not li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
  .hg-not li .ic { flex-shrink: 0; margin-top: 1px; color: var(--text-muted); }
  .hg-know { font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
  .hg-at { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 2px; border-radius: var(--radius-pill); background: var(--tag-neutral-bg); color: var(--tag-neutral-fg); font-size: 11px; font-weight: 500; white-space: nowrap; vertical-align: 1px; }
  .hg-note { align-self: end; display: flex; align-items: flex-start; gap: 8px; margin-top: 20px; padding: 10px 12px; border-radius: 10px; background: var(--bg-subtle); font-size: 13px; line-height: 1.45; color: var(--text-secondary); }
  .hg-note .ic { flex-shrink: 0; margin-top: 1px; }
  .hg-note:empty { visibility: hidden; }

  /* Pro: the Loyalty crimson reeded texture, white text, glass inner card */
  .hg-card.is-pro { background: #4a0e12; color: #fff; box-shadow: 0 24px 48px -22px rgb(110 20 24 / 0.45), 0 8px 18px -12px rgb(31 30 28 / 0.18); }
  .hg-tex { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
  .hg-tex img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
  .hg-tex::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(20 3 4 / 0.18) 0%, rgb(20 3 4 / 0.5) 60%, rgb(20 3 4 / 0.62) 100%); }
  .hg-card.is-pro .hg-card-body { background: rgb(255 255 255 / 0.07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .hg-card.is-pro :is(.hg-fit, .hg-unit) { color: rgb(255 255 255 / 0.8); }
  .hg-card.is-pro :is(.hg-bill, .hg-cap, .hg-not-h) { color: rgb(255 255 255 / 0.68); }
  .hg-card.is-pro .hg-value { color: #fff; }
  .hg-card.is-pro :is(.hg-value, .hg-list) .ic { color: var(--hg-peach); }
  .hg-card.is-pro .hg-cta { border-color: rgb(255 255 255 / 0.2); }
  .hg-card.is-pro .hg-not li { color: rgb(255 255 255 / 0.76); }
  .hg-card.is-pro .hg-not li .ic { color: rgb(255 255 255 / 0.5); }
  .hg-card.is-pro .hg-at { background: rgb(255 255 255 / 0.14); color: #fff; }
  .hg-card.is-pro .hg-note { background: rgb(255 255 255 / 0.09); color: rgb(255 255 255 / 0.84); }
  .hg-btn-pro { background: var(--hg-peach); color: var(--hg-crimson); font-weight: 600; }
  .hg-btn-pro:hover { background: #ffdcc8; }
  .hg-btn-pro:active, .hg-cta .btn:active { transform: scale(0.98); }
  .hg-cta .btn { transition: background-color var(--dur) var(--ease), transform 150ms var(--ease); }

  /* Enterprise line and the note under the cards */
  .hg-ent { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px 16px 16px 20px; border-radius: 20px; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border-default); }
  .hg-ent-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-default); color: var(--action-primary); }
  .hg-ent p { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 10px; font-size: 15px; line-height: 1.5; }
  .hg-ent b { font-weight: 600; }
  .hg-ent p span { color: var(--text-secondary); }
  .hg-ent .btn { flex-shrink: 0; }
  .hg-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-top: 20px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
  .hg-foot p, .hg-cmp-note { display: flex; align-items: flex-start; gap: 8px; }
  .hg-foot .ic, .hg-cmp-note .ic { flex-shrink: 0; margin-top: 1px; }
  .hg-foot .lp-go { font-size: 15px; }

  /* ── pricing page (harga.html) ── */
  /* ui.css gives body height: 100%, which lets the sticky menu scroll away after one screen; the sticky table header needs the menu to stay */
  body.harga { height: auto; }
  .hg-page.lp { gap: 112px; }
  .hg-hero { padding-top: 20px; }
  .hg-crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: 13px; color: var(--text-muted); }
  .hg-crumb a { color: var(--text-brand); font-weight: 500; }
  .hg-crumb a:hover { text-decoration: underline; }
  .hg-h1 { font-size: clamp(34px, 4vw, 56px); line-height: 1.05; max-width: 20ch; }
  .hg-page .hg-foot { justify-content: space-between; }

  /* add-ons */
  .hg-addons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .hg-addon .npanel-title { color: var(--text-primary); font-weight: 600; }
  .hg-addon .npanel-title .ic { color: var(--action-primary); }
  .hg-addon .npanel-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
  .hg-addon .stat-row { gap: 8px; }
  .hg-add-fig { font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; }
  .hg-add-x { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
  .hg-add-rows { margin-top: auto; display: flex; flex-direction: column; }
  .hg-add-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-default); font-size: 13px; line-height: 1.4; }
  .hg-add-rows dt { color: var(--text-secondary); }
  .hg-add-rows dd { font-weight: 500; text-align: right; }
  .hg-add-foot { font-size: 12px; line-height: 1.45; color: var(--text-muted); }

  /* comparison table: sticky plan header on desktop, one plan at a time on phones */
  .hg-switch { display: none; }
  .hg-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 14px; line-height: 1.45; }
  .hg-col-label { width: 32%; }
  .hg-table thead th { position: sticky; top: var(--bar-h); z-index: 3; padding: 16px 14px 14px; text-align: left; vertical-align: bottom; background: var(--bg-canvas); border-bottom: 1px solid var(--border-strong); }
  .hg-table thead th[data-p='pro'] { background: color-mix(in srgb, var(--action-primary) 6%, var(--bg-canvas)); border-radius: 14px 14px 0 0; }
  .hg-th-hint { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }
  .hg-th-name { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 600; }
  .hg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action-primary); }
  .hg-th-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; min-height: 22px; margin: 2px 0 10px; font-size: 13px; line-height: 22px; font-weight: 400; color: var(--text-secondary); }
  .hg-th-price b { font-size: 15px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
  .hg-table thead .btn { width: 100%; }
  .hg-grp th { padding: 36px 14px 10px; text-align: left; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--border-default); }
  .hg-grp-t { display: flex; align-items: center; gap: 8px; }
  .hg-grp-t .ic { flex-shrink: 0; color: var(--action-primary); }
  .hg-table tbody tr:not(.hg-grp) > * { padding: 12px 14px; border-bottom: 1px solid var(--border-default); vertical-align: middle; }
  .hg-table tbody th[scope='row'] { text-align: left; font-weight: 400; color: var(--text-secondary); }
  .hg-table td { text-align: left; }
  .hg-table td[data-p='pro'] { background: color-mix(in srgb, var(--action-primary) 4%, transparent); }
  .hg-yes { display: inline-flex; color: var(--action-primary); }
  .hg-no { display: inline-flex; color: var(--text-muted); opacity: 0.55; }
  .hg-txt { font-weight: 500; }
  .hg-cmp-note { margin-top: 20px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }

  /* billing FAQ */
  .hg-faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
  .hg-faq-side { position: sticky; top: calc(var(--bar-h) + 32px); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
  .hg-faq-side .btn { margin-top: 8px; }
  .hg-qs { display: flex; flex-direction: column; gap: 10px; }
  .hg-qa { border-radius: 18px; background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border-default); transition: background-color var(--dur); }
  .hg-qa.is-open { background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
  .hg-qa h3 { font: inherit; }
  .hg-q { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 18px 20px; text-align: left; font-size: 16px; line-height: 1.4; font-weight: 600; }
  .hg-q-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-active); transition: transform 200ms var(--ease), background-color var(--dur); }
  .hg-qa.is-open .hg-q-ic { transform: rotate(45deg); background: var(--action-primary); color: var(--action-on-primary); }
  .hg-a { padding: 0 20px 18px; max-width: 66ch; font-size: 15px; line-height: 1.6; color: var(--text-secondary); }
  .hg-a[hidden] { display: none; }

  @media (prefers-reduced-motion: reduce) {
    .hg-toggle.is-ready .hg-thumb, .hg-q-ic { transition: none; }
  }

  /* dark: the toggle thumb sits lighter than its track */
  :root[data-theme='dark'] .hg { --hg-thumb: #383838; }
  :root[data-theme='dark'] .hg-card.is-pro { box-shadow: 0 24px 48px -22px rgb(0 0 0 / 0.6); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .hg { --hg-thumb: #383838; }
    :root:not([data-theme='light']) .hg-card.is-pro { box-shadow: 0 24px 48px -22px rgb(0 0 0 / 0.6); }
  }

  @media (max-width: 1199px) {
    .hg-plans.is-full, .hg-addons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hg-page.lp { gap: 96px; }
    .hg-table thead .btn { height: auto; min-height: 32px; padding: 6px 10px; white-space: normal; line-height: 1.2; text-align: center; }
  }
  @media (max-width: 1023px) {
    .hg-table thead th { padding: 14px 10px 12px; }
    .hg-table tbody tr:not(.hg-grp) > * { padding: 12px 10px; }
    .hg-col-label { width: 30%; }
  }
  @media (max-width: 899px) {
    .hg-plans { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
    .hg-plans.is-full { grid-template-columns: minmax(0, 1fr); }
    .hg-ent { max-width: 560px; margin-left: auto; margin-right: auto; }
    .hg-amt { font-size: 38px; }
    .hg-plans.is-full .hg-amt { font-size: 36px; }
    .hg-faq { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .hg-faq-side { position: static; }
  }
  @media (max-width: 767px) {
    .hg-page.lp { gap: 80px; }
    .hg-hero { padding-top: 8px; }
    .hg-crumb { margin-bottom: 20px; }
    .hg-toggle [role='radio'] { padding: 0 14px; font-size: 14px; }
    .hg-ent { flex-wrap: wrap; padding: 18px; }
    .hg-ent p { flex-basis: calc(100% - 60px); }
    .hg-ent .btn { width: 100%; }
    .hg-foot { flex-direction: column; align-items: flex-start; }
    .hg-addons { grid-template-columns: minmax(0, 1fr); }

    /* phones: a sticky plan switcher, then one plan column at a time */
    .hg-switch { position: sticky; top: calc(var(--bar-h) + 8px); z-index: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-bottom: 4px; padding: 4px; border-radius: 16px; background: var(--bg-active); box-shadow: inset 0 0 0 1px var(--border-default), 0 0 0 8px var(--bg-canvas), 0 14px 18px -10px rgb(0 0 0 / 0.25); }
    .hg-switch button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 7px 2px; border-radius: 12px; color: var(--text-secondary); }
    .hg-switch b { font-size: 13px; font-weight: 600; }
    .hg-switch small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-muted); }
    .hg-switch small b, .hg-switch .hg-amt-xs { font-size: 11px; font-weight: 500; }
    .hg-switch [aria-selected='true'] { background: var(--hg-thumb); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-default), 0 1px 2px rgb(0 0 0 / 0.06); }
    .hg-table { table-layout: auto; }
    .hg-table colgroup, .hg-table thead { display: none; }
    .hg-table[data-show='gratis'] [data-p]:not([data-p='gratis']),
    .hg-table[data-show='pro'] [data-p]:not([data-p='pro']),
    .hg-table[data-show='grup'] [data-p]:not([data-p='grup']),
    .hg-table[data-show='enterprise'] [data-p]:not([data-p='enterprise']) { display: none; }
    .hg-table tbody th[scope='row'] { width: 60%; }
    .hg-table td { text-align: right; }
    .hg-table td[data-p='pro'] { background: none; }
    .hg-table tbody tr:not(.hg-grp) > * { padding: 12px 4px; }
    .hg-table tbody tr:not(.hg-grp) > td { padding-left: 12px; }
    .hg-grp th { padding: 28px 4px 10px; }
    .hg-q { padding: 16px; font-size: 15px; }
    .hg-a { padding: 0 16px 16px; }
  }
}
