/* =========================================================
   base.css: fondasi bersama Pumiland & Pumimart.
   File ini IDENTIK di kedua website (pumiland/assets/css dan
   pumimart/assets/css). Kalau mengubah satu, salin ke yang lain.
   Warna tiap website diatur di land.css / mart.css.
   ========================================================= */

:root {
  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ink: #4A2F2A;          /* cokelat garis Pumi */
  --muted: #8A6B63;
  --line: #F0DDD4;
  --surface: #FFFFFF;
  --bg: #FFF8F3;
  --bg-soft: #FFF1EA;

  --pink: #F49BA5;
  --pink-deep: #D8536C;
  --blush: #FDE3E4;
  --lavender: #D9CCF2;
  --sky: #BFDDF7;
  --mint: #CDEFD9;
  --cream: #FFEDE6;

  --primary: var(--pink-deep);
  --primary-hover: #C2405A;
  --primary-ink: #FFFFFF;
  --primary-soft: var(--blush);

  --mart: #2B76B9;
  --mart-hover: #1F6099;

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px -2px rgba(74, 47, 42, .12);
  --shadow: 0 14px 34px -16px rgba(74, 47, 42, .30);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; } /* width/height di HTML hanya untuk rasio, bukan memaksa ukuran */
a { color: inherit; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.5vw + .5rem, 3.6rem); }
h2 { font-size: clamp(1.6rem, 2.6vw + .6rem, 2.5rem); }
h3 { font-size: 1.3rem; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .75rem;
}
.fine-print { font-size: .875rem; color: var(--muted); margin-top: .75rem; }
.fine-print a { color: var(--primary); font-weight: 700; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.4rem;
  border: 2px solid transparent; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: .45rem 1.1rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #CFC3BF; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-mart { background: var(--mart); color: #fff; box-shadow: 0 6px 16px -8px var(--mart); }
.btn-mart:hover { background: var(--mart-hover); }
.btn-google { background: #fff; color: #3C4043; border-color: #DADCE0; font-family: var(--font-body); font-weight: 700; }
.btn-google:hover { border-color: #A8ABB0; }
.btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--primary); font-weight: 700; text-decoration: underline;
}

/* ---------- Form ---------- */
.form-stack { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; font-weight: 700; font-size: .95rem; }
.field small { font-weight: 400; color: var(--muted); }
.field-row { display: flex; justify-content: space-between; gap: 1rem; }
.field-row a { font-weight: 600; color: var(--primary); font-size: .875rem; }
.field input {
  width: 100%; min-height: 48px; padding: .7rem 1rem;
  border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  font-weight: 400; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.static-field { margin: 0; font-weight: 400; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form-error, .form-success {
  padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .95rem;
}
.form-error { background: #FFE8E6; color: #9B2C2C; border: 1px solid #F6C5C0; }
.form-error p { margin: 0; }
.form-error p + p { margin-top: .35rem; }
.form-success { background: #E7F7EC; color: #22603A; border: 1px solid #BFE5CB; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 800; line-height: 1.5;
}
.badge-ok { background: #E7F7EC; color: #22603A; }
.badge-warn { background: #FFF3DA; color: #8A5A00; }

/* ---------- Kolom kata sandi dengan ikon mata ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 3rem !important; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; transition: color .15s ease, background-color .15s ease;
}
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }
/* Tombol × (kosongkan) hanya muncul kalau kolom berisi, termasuk isi autofill. Aturan dipisah karena
   selector yang tidak dikenal browser membatalkan seluruh daftar selector. */
.field-clear { visibility: hidden; }
.pw-wrap input:not(:placeholder-shown) ~ .field-clear { visibility: visible; }
.pw-wrap input:autofill ~ .field-clear { visibility: visible; }
.pw-wrap input:-webkit-autofill ~ .field-clear { visibility: visible; }
/* Pratinjau autofill Chrome memakai font bawaan browser (titik sandi jadi kecil); samakan dengan font situs. */
.field input:-webkit-autofill::first-line { font-family: var(--font-body); font-size: 1rem; }

/* ---------- Pesan flash ---------- */
.flash-stack { width: min(1180px, 100% - 32px); margin: 16px auto 0; display: grid; gap: .5rem; }
.flash { margin: 0; padding: .8rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem; word-break: break-word; }
.flash-success { background: #E7F7EC; color: #22603A; }
.flash-error { background: #FFE8E6; color: #9B2C2C; }
.flash-info { background: #EAF3FF; color: #1F4E7A; }
.flash-dev { background: #FFF6D8; color: #6B4E00; font-family: ui-monospace, Consolas, monospace; font-weight: 400; font-size: .85rem; }
/* Dengan JS: melayang di bawah header (tidak mendorong isi halaman), hilang sendiri lewat land.js/mart.js. */
.js .flash-stack {
  position: fixed; top: calc(var(--header-h) + 12px); left: 50%; z-index: 60; transform: translateX(-50%);
  width: min(560px, 100% - 32px); margin: 0; pointer-events: none;
}
.js .flash {
  display: flex; align-items: flex-start; gap: .75rem; pointer-events: auto; box-shadow: var(--shadow);
  animation: flash-in .3s ease both; transition: opacity .3s ease, transform .3s ease;
}
.js .flash.is-leaving { opacity: 0; transform: translateY(-10px); }
.flash-text { flex: 1; }
.flash-action { font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.flash-close {
  flex: none; width: 26px; height: 26px; margin: -.15rem -.4rem -.15rem 0; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 1.15rem; line-height: 1;
  cursor: pointer; opacity: .6; transition: opacity .15s ease, background-color .15s ease;
}
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg, rgba(255, 248, 243, .86));
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--header-line, transparent);
}
.header-inner { min-height: var(--header-h); display: flex; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; flex-shrink: 0; }
.brand .pumi-mark { width: 58px; height: auto; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em; }
.brand-name span { color: var(--primary); }

.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px;
  padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 700; max-width: 220px;
}
.user-chip img, .avatar-fallback { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-fallback {
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-head); font-weight: 700;
}
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .4rem;
}
.user-dropdown a, .user-dropdown button {
  display: block; width: 100%; text-align: left; padding: .65rem .9rem; border-radius: var(--radius-sm);
  text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 600;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg-soft); }
.user-dropdown .menu-admin { color: var(--primary); font-weight: 800; }
.user-dropdown .menu-admin::before { content: "★ "; }
.user-dropdown form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }

/* ---------- Pilihan bahasa (ID | EN) ---------- */
.lang-switch {
  display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 999px;
}
.lang-switch a {
  min-width: 38px; padding: .25rem .55rem; border-radius: 999px; text-align: center; text-decoration: none;
  font-family: var(--font-head); font-weight: 600; font-size: .82rem; letter-spacing: .04em; line-height: 1.4;
  color: var(--muted); transition: background-color .15s ease, color .15s ease;
}
.lang-switch a:hover { color: var(--ink); background: var(--bg-soft); }
.lang-switch a.is-active { background: var(--primary); color: var(--primary-ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg, #4A2F2A); color: var(--footer-ink, #FBEDE7); margin-top: 0; }
.site-footer a { color: inherit; }
.footer-inner { display: grid; gap: 2rem; padding: 3.5rem 0 2rem; grid-template-columns: 1.2fr 2fr; }
.footer-brand p { opacity: .8; margin-top: 1rem; }
.site-footer .brand-name span { color: var(--footer-accent, var(--pink)); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer-links h2 { font-size: 1rem; margin-bottom: .75rem; color: var(--footer-accent, var(--pink)); }
.footer-links a { display: block; padding: .2rem 0; text-decoration: none; opacity: .85; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, .14); padding: 1.25rem 0 1.75rem; font-size: .875rem; opacity: .7; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer-legal a { text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }

/* ---------- Halaman error ---------- */
.error-page { text-align: center; padding: 5rem 0; display: grid; justify-items: center; gap: .5rem; }

/* ---------- Marquee (strip yang berjalan terus tanpa bolong) ----------
   JS menggandakan isi .marquee-track sampai lebih lebar dari layar, lalu mengisi
   --marquee-distance (panjang satu putaran) dan --marquee-duration. */
.marquee-track.is-animated { animation: marquee var(--marquee-duration, 40s) linear infinite; }
@keyframes marquee { to { transform: translateX(var(--marquee-distance, -50%)); } }

/* ---------- Tombol kembali ke atas (dibuat land.js/mart.js) ----------
   Muncul setelah turun ±1 layar. Isi warna utama situs + panah putih; cincin putih di dalam tepi
   = seberapa jauh halaman sudah di-scroll (--p 0..1 diisi JS). */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 8px 20px -6px rgba(74, 47, 42, .45);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.85);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top.is-shown:hover { transform: translateY(-2px); background: var(--primary-hover); }
.to-top.is-shown:active { transform: scale(.94); }
.to-top:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 2.5; }
.to-top-ring .track { stroke: rgba(255, 255, 255, .28); }
.to-top-ring .bar { stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); }
.to-top-arrow { position: relative; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media print { .to-top { display: none; } }

/* ---------- Animasi muncul saat di-scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
