/* ==========================================================================
   Royal Spa Kiosk — Temel tasarım sistemi (token'lar + ortak bileşenler)
   ========================================================================== */
:root {
  /* Zemin katmanları */
  --bg: #0b0d0f;
  --bg-elev: #111417;
  --surface: #161a1e;
  --surface-2: #1d2227;
  --surface-3: #262c32;
  /* Vurgu */
  --gold: #d4af6a;
  --gold-strong: #e6c483;
  --gold-soft: rgba(212, 175, 106, 0.14);
  --gold-glow: rgba(212, 175, 106, 0.35);
  --gold-grad: linear-gradient(135deg, #f1d9a5 0%, #d4af6a 45%, #a9823f 100%);
  /* Metin */
  --text: #f4f1ea;
  --text-dim: #a9adb2;
  --text-faint: #6c7278;
  --on-gold: #1a1408;
  /* Durum */
  --ok: #6fcf97;
  --warn: #f2a65a;
  --danger: #eb6b6b;
  /* Çizgi / gölge */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-gold: rgba(212, 175, 106, 0.28);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  /* Köşe */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;
  /* Boşluk (4px tabanlı) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  /* Tipografi */
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-hero: clamp(2.1rem, 4.6vw, 3.9rem);
  --fs-h1: clamp(1.8rem, 3.2vw, 2.7rem);
  --fs-h2: clamp(1.35rem, 2.2vw, 1.9rem);
  --fs-h3: clamp(1.08rem, 1.5vw, 1.32rem);
  --fs-body: clamp(0.94rem, 1.1vw, 1.05rem);
  --fs-small: 0.84rem;
  /* Hareket */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 0.35s;
  /* Ölçüler */
  --touch: 48px;
  --header-h: 76px;
  --page-x: clamp(16px, 3.4vw, 48px);
  --card-min: 280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.ico { flex-shrink: 0; }

/* ---------- Butonlar ---------- */
.btn {
  --h: var(--touch);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--h); padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background var(--dur) var(--ease), border-color var(--dur), color var(--dur), box-shadow var(--dur);
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn--gold { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; box-shadow: 0 8px 24px var(--gold-glow); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); border-color: rgba(235, 107, 107, 0.35); }
.btn--lg { --h: 60px; padding: 0 var(--sp-6); font-size: 1.05rem; }
.btn--sm { --h: 38px; padding: 0 var(--sp-4); font-size: 0.85rem; }
.btn--icon { width: var(--h); padding: 0; }
.btn--block { width: 100%; }
@media (hover: hover) {
  .btn:hover { border-color: var(--line-gold); background: rgba(255, 255, 255, 0.07); }
  .btn--gold:hover { background: var(--gold-grad); filter: brightness(1.06); }
}

/* ---------- Chip / Badge ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  font-size: 0.88rem; font-weight: 600; color: var(--text-dim);
  transition: all var(--dur) var(--ease);
}
.chip.is-active { background: var(--gold-soft); border-color: var(--line-gold); color: var(--gold-strong); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  background: rgba(11, 13, 15, 0.72); border: 1px solid var(--line-gold); color: var(--gold-strong);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.glass {
  background: rgba(17, 20, 23, 0.72);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
}

/* ---------- Form alanları ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 0.8rem; font-weight: 700; color: var(--text-dim); letter-spacing: 0.04em; text-transform: uppercase; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--bg-elev); color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.hint { font-size: 0.8rem; color: var(--text-faint); }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; min-height: 40px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background var(--dur); flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center; padding: var(--sp-4);
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.25s var(--ease);
}
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: popIn 0.3s var(--ease);
  overflow: hidden;
}
.modal--wide { width: min(960px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 1.1rem; }
.modal__body { padding: var(--sp-5); overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- PIN pad ---------- */
.pin { text-align: center; }
.pin__dots { display: flex; justify-content: center; gap: 14px; margin: var(--sp-4) 0 var(--sp-2); }
.pin__dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-gold); transition: all 0.2s; }
.pin__dots span.on { background: var(--gold); border-color: var(--gold); }
.pin__msg { min-height: 22px; font-size: 0.9rem; color: var(--danger); margin-bottom: var(--sp-3); }
.pin__pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; justify-content: center; }
.pin__pad button { height: 76px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font-size: 1.6rem; font-weight: 500; transition: transform 0.12s, background 0.2s; }
.pin__pad button:active { transform: scale(0.92); background: var(--gold-soft); }
.pin.shake .pin__dots { animation: shake 0.4s; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); font-weight: 600; font-size: 0.92rem; animation: popIn 0.3s var(--ease); }
.toast--ok { border-color: rgba(111, 207, 151, 0.4); }
.toast--ok .ico { color: var(--ok); }
.toast--err { border-color: rgba(235, 107, 107, 0.4); }
.toast--err .ico { color: var(--danger); }

/* ---------- Yardımcılar ---------- */
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.spacer { flex: 1; }
.serif { font-family: var(--font-display); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }

/* ---------- Animasyonlar ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.reveal { animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
