/* Dubai Insiders Club — shared tokens and components.
   Every page loads this first; page CSS only adds layout. */
:root {
  --ink: #0D0F15;
  --ink-2: #23252D;
  --bg: #F8F7F3;
  --bg-warm: #FBFAF6;
  --card: #FFFFFF;
  --muted: #6E6F73;
  --muted-2: #9A9B9F;
  --line: rgba(13, 15, 21, .09);
  --line-2: rgba(13, 15, 21, .16);
  --gold: #FFB648;
  --gold-2: #EDA436;
  --gold-3: #D4A032;
  --gold-soft: #F2B55A;
  --gold-tint: #FFF6E6;
  --gold-tint-2: #FDEFD6;
  --gold-ink: #8A5E12;      /* gold for small text: 5.3:1 on off-white */
  --gold-text: #9A6A14;     /* gold for large display text: 4.4:1 */
  --green: #22C55E;
  --green-ink: #15803D;
  --green-tint: #E8F8EE;
  --red: #E5484D;
  --wa: #25D366;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --logo: "Syne", "Manrope", sans-serif;

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 1px 2px rgba(13, 15, 21, .04), 0 8px 24px rgba(13, 15, 21, .06);
  --shadow-lg: 0 24px 64px rgba(13, 15, 21, .18);
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .9); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.serif, h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
.eyebrow {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.gold { color: var(--gold-ink); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.gold-text { color: var(--gold-ink); }
.dot-gold { color: var(--gold); }

/* Logo: "Insiders./" in Syne */
.logo {
  display: inline-flex; align-items: baseline; gap: 10px;
  font: 700 22px/1 var(--logo); letter-spacing: -.02em; text-decoration: none; color: var(--ink);
}
.logo b { font-weight: 700; }
.logo i { font-style: normal; color: var(--gold); }
.logo small {
  font: 500 9.5px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  border-left: 1px solid var(--line-2); padding-left: 10px;
}
.logo.light { color: #fff; }
.logo.light small { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.25); }

/* Buttons — always pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; background: none;
  font: 700 15px/1 var(--sans); letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-2); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: rgba(13,15,21,.05); }
.btn-wa { background: var(--wa); color: var(--ink); }
.btn-wa:hover { background: #1fb957; }
.btn-dashed { border: 1px dashed var(--line-2); color: var(--ink); background: transparent; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

/* Cards, chips */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font: 600 12px/1 var(--sans); background: rgba(13,15,21,.05); color: var(--ink); white-space: nowrap;
}
.chip.gold { background: var(--gold-tint); color: var(--gold-ink); }
.chip.green { background: var(--green-tint); color: var(--green-ink); }
.chip.dark { background: var(--ink); color: #fff; }
.chip.mono { font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.pill-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; border: 1px solid var(--line); gap: 2px; }
.pill-toggle button {
  border: 0; background: none; height: 38px; padding: 0 18px; border-radius: 999px;
  font: 600 14px/1 var(--sans); color: var(--muted);
}
.pill-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button {
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff;
  font: 600 13.5px/1 var(--sans); color: var(--ink);
}
.pills button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.avatar { border-radius: 50%; object-fit: cover; background: var(--gold-tint); flex: none; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }

/* Forms */
.field { display: grid; gap: 6px; }
.field > span { font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: #fff; font-size: 16px;
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(255,182,72,.22); }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-row label { position: relative; }
.choice-row input { position: absolute; opacity: 0; inset: 0; }
.choice-row label span {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; font: 600 14px/1 var(--sans); cursor: pointer;
}
.choice-row input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.choice-row input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.form-error { color: #B42318; font-size: 14px; margin: 0; }
.field-error { color: #B42318; font-size: 13px; margin: 0; }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: #B42318; }
.form-privacy { font-size: 12.5px; color: var(--muted); margin: 0; }
.form-privacy a { color: inherit; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Modal on desktop, bottom sheet on mobile (built by js/common.js) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(13,15,21,.48);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 48px); overflow: auto;
  background: #fff; border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-lg);
  transform: translateY(12px); transition: transform .22s ease;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet.gold { background: linear-gradient(180deg, #FFF3DC 0%, #FFFFFF 70%); border-top: 3px solid var(--gold); }
.sheet .sheet-close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(13,15,21,.06); display: grid; place-items: center;
}
.sheet .sheet-close svg { width: 16px; height: 16px; }
.sheet h3 { font-size: 26px; margin: 4px 36px 8px 0; }
.sheet .sheet-body { display: grid; gap: 16px; }
.sheet .grabber { display: none; }
@media (max-width: 767px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet {
    max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh;
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
  .sheet .grabber { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
  .sheet .sheet-close { top: 18px; }
}
.confirm { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 8px 0; }
.confirm .avatar { width: 84px; height: 84px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold); }
.confirm h3 { margin: 6px 0 0; }
.confirm .tick { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin-top: -30px; margin-left: 60px; box-shadow: 0 0 0 3px #fff; }
.confirm .tick svg { width: 16px; height: 16px; }

/* Blur + lock for locked deals */
.locked { position: relative; }
.locked .blur { filter: blur(7px); user-select: none; pointer-events: none; }
.lock-badge {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--gold);
}
.lock-badge svg { width: 18px; height: 18px; }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, #EEECE6 0%, #F7F6F2 50%, #EEECE6 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }


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

/* Skip link (all pages) */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Touch devices: 44px minimum tap targets */
@media (pointer: coarse) {
  .btn-sm, .pill-toggle button, .pills button, .choice-row label span { min-height: 44px; }
  .sheet .sheet-close { width: 44px; height: 44px; }
}
.legend-label { padding: 0; margin-bottom: 6px; font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
