/* Zi Mo Mahjong — design tokens & komponen bersama */
:root {
  --jade: #015640;
  --jade-deep: #003a2b;
  --jade-felt: #0b4a37;
  --cream: #faf3dd;
  --paper: #e9e0cc;
  --ivory: #fffaf0;
  --red: #a10805;
  --red-deep: #7a0603;
  --gold: #cc8f22;
  --gold-soft: #e4c27a;
  --ink: #1d2b24;
  --muted: #5f6b62;
  --line: #d8cbaa;
  --ok: #1d7a4f;
  --warn: #b26a00;
  --serif: 'Libre Baskerville', 'Baskerville', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r-tile: 9px;
  --r-ctl: 6px;
  --shadow-tile: 0 3px 0 var(--jade), 0 5px 0 var(--jade-deep), 0 8px 14px rgba(0, 40, 28, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--serif); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--jade); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Judul gaya stiker (merah, isi krem, garis hijau) */
.sticker {
  font-weight: 700; color: var(--red); letter-spacing: -.01em;
  -webkit-text-stroke: 0;
  text-shadow:
    2px 2px 0 var(--cream), -2px -2px 0 var(--cream), 2px -2px 0 var(--cream), -2px 2px 0 var(--cream),
    0 3px 0 var(--cream), 3px 0 0 var(--cream), 0 -3px 0 var(--cream), -3px 0 0 var(--cream),
    4px 5px 0 var(--jade), 5px 4px 0 var(--jade), 3px 6px 0 var(--jade);
}

/* Tombol berbentuk ubin */
.btn {
  appearance: none; border: 0; cursor: pointer; font: 700 1rem/1 var(--serif);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .95em 1.4em; border-radius: var(--r-ctl); text-decoration: none;
  background: var(--red); color: var(--ivory);
  box-shadow: 0 3px 0 var(--red-deep); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.jade { background: var(--jade); box-shadow: 0 3px 0 var(--jade-deep); }
.btn.ghost { background: var(--ivory); color: var(--jade); box-shadow: inset 0 0 0 2px var(--jade), 0 3px 0 var(--jade-deep); }
.btn.small { padding: .6em .9em; font-size: .9rem; }
.btn.block { width: 100%; }

/* Bingkai emas dua garis dengan sudut kotak (dari brand sheet) */
.frame {
  position: relative; background: var(--ivory); padding: 28px;
  border: 2px solid var(--gold); outline: 1px solid var(--gold); outline-offset: -8px;
}
.frame::before, .frame::after, .frame > .c1, .frame > .c2 {
  content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold); background: var(--ivory);
}
.frame::before { top: -7px; left: -7px; }
.frame::after { top: -7px; right: -7px; }
.frame > .c1 { bottom: -7px; left: -7px; }
.frame > .c2 { bottom: -7px; right: -7px; }
.frame.jade-frame { border-color: var(--jade); outline-color: var(--jade); }

/* Form */
label.f { display: block; margin-bottom: 14px; font-size: .92rem; color: var(--muted); }
label.f > span { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 700; }
input, select, textarea {
  width: 100%; font: 1rem var(--serif); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: .7em .8em;
}
input:focus, select:focus, textarea:focus { border-color: var(--jade); outline: none; box-shadow: 0 0 0 3px rgba(1, 86, 64, .15); }
textarea { min-height: 80px; resize: vertical; }

/* Ubin mahjong (dipakai untuk slot jam & pilihan) */
.tile {
  appearance: none; border: 0; cursor: pointer; position: relative;
  background: linear-gradient(#fffdf6, #f3ead2); color: var(--jade);
  border-radius: var(--r-tile); box-shadow: var(--shadow-tile);
  font: 600 .95rem/1 var(--mono); padding: 14px 6px 12px; min-width: 0;
  transition: transform .1s ease;
}
.tile:hover:not([disabled]) { transform: translateY(-2px); }
.tile[aria-pressed='true'], .tile.on {
  background: linear-gradient(#fff3ee, #f8dcd2); color: var(--red);
  box-shadow: 0 3px 0 var(--red), 0 5px 0 var(--red-deep), 0 8px 14px rgba(120, 6, 3, .3);
  transform: translateY(-3px);
}
.tile.back, .tile[disabled].back {
  background: repeating-linear-gradient(45deg, var(--jade) 0 6px, #02654b 6px 12px);
  color: rgba(255, 250, 240, .55); cursor: not-allowed;
  box-shadow: 0 3px 0 var(--jade-deep), 0 5px 0 #002a1f;
}
.tile.past { opacity: .35; cursor: not-allowed; box-shadow: 0 2px 0 var(--line); }

/* Toast & util */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); z-index: 99;
  background: var(--jade); color: var(--ivory); padding: 12px 20px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .25s ease; max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: var(--red); }
.hide { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.pill { display: inline-block; font: 600 .78rem/1 var(--mono); padding: 5px 8px; border-radius: 999px; background: var(--paper); color: var(--ink); }
.pill.pending { background: #fbe7c4; color: var(--warn); }
.pill.confirmed, .pill.paid { background: #d4ecdf; color: var(--ok); }
.pill.cancelled, .pill.void, .pill.expired, .pill.no_show { background: #f3d3d1; color: var(--red); }
.pill.completed { background: #dfe7f3; color: #2c4b7a; }

/* Header situs publik */
.site-head { background: var(--jade-deep); color: var(--ivory); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.site-head img { height: 44px; width: auto; }
.site-head nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-head nav a { color: var(--cream); text-decoration: none; font-size: .95rem; padding: 10px 2px; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 5px; }
.site-foot { background: var(--jade-deep); color: var(--paper); padding: 40px 0; margin-top: 64px; font-size: .92rem; }
.site-foot a { color: var(--gold-soft); }
@media (max-width: 560px) { .site-head nav { gap: 12px; } .site-head nav a { font-size: .88rem; } .site-head img { height: 36px; } }

/* Layar sentuh: target sentuh nyaman */
@media (pointer: coarse) {
  .btn.small { min-height: 40px; }
  input, select { min-height: 44px; }
}
@media (max-width: 420px) {
  .site-head .wrap { gap: 10px; }
  .site-head nav { gap: 10px; }
  .site-head nav a { font-size: .84rem; }
  .site-head img { height: 32px; }
}
