/* ==========================================================
   BayadLuxury — base : couleurs, typographie, éléments communs
   ========================================================== */
:root {
  /* Rabélys — blanc & or */
  --bg: #FFFFFF; --bg-soft: #FAF7F2; --bg-deep: #F4EFE6;
  --surface: #FFFFFF; --surface-2: #F7F3EC; --surface-3: #EFE7D9;
  --text: #1C1915; --muted: #6B645A; --faint: #9A9285;
  --line: rgba(28, 25, 21, .09); --line-2: rgba(168, 132, 73, .35);
  --gold: #A88449; --gold-hi: #D6B676; --gold-lo: #8E6C33; --gold-text: #87662E; --gold-soft: rgba(168, 132, 73, .1);
  --ink: #FFFFFF;
  --ok: #2E8B57; --warn: #B7791F; --danger: #C0392B;
  --glass: 255, 255, 255; --glass-deep: 250, 247, 242; --soft: #3A352E;
  --tex: none; --hero-shadow: none;
  --r: 20px; --shadow: 0 30px 70px -34px rgba(70, 52, 20, .28); --shadow-sm: 0 8px 24px -14px rgba(70, 52, 20, .25);
  --f-display: "Cormorant Garamond", "Amiri", Georgia, serif;
  --f-body: "Manrope", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-brand: "Cinzel", "Cormorant Garamond", serif;
  --f-script: "Cormorant Garamond", Georgia, serif;
  --f-quote: "Cormorant Garamond", Georgia, serif;
  color-scheme: light;
}
html[lang="ar"] { --f-display: "Amiri", "Cormorant Garamond", serif; --f-body: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
html.locked { overflow: hidden; }
body {
  min-height: 100vh; color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.ic { width: 20px; height: 20px; flex: none; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.rev { transform: rotate(180deg); }
[dir="rtl"] .rev { transform: none; }

/* Logo */
.logo { display: flex; align-items: center; gap: 12px; color: var(--text); flex: none; }
.crest { height: 44px; width: auto; }
.wm { display: grid; font-family: var(--f-brand); font-size: 1.25rem; font-weight: 500; line-height: 1; letter-spacing: .2em; color: var(--text); }
.wm small { font-family: "Manrope", sans-serif; font-size: .56rem; letter-spacing: .48em; text-transform: uppercase; color: var(--gold-text); margin-top: 6px; font-weight: 700; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; font-weight: 500; font-size: .95rem; letter-spacing: .02em; white-space: nowrap;
  transition: filter .2s, background .2s, border-color .2s, transform .15s; position: relative;
}
.btn:active { transform: scale(.98); }
.btn-gold { color: #fff; background: linear-gradient(135deg, #C9A462 0%, #A88449 55%, #8E6C33 100%); box-shadow: 0 12px 28px -14px rgba(142, 108, 51, .7); font-weight: 600; }
.btn-gold:hover { filter: brightness(1.07); }
.btn-navy { color: #fff; background: #1C1915; }
.btn-navy:hover { background: #2C2822; }
.btn-ghost { color: var(--text); border: 1px solid var(--line); background: #fff; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-text); }
.btn-danger { color: var(--danger); border: 1px solid rgba(240, 138, 124, .45); }
.btn-danger:hover { background: rgba(240, 138, 124, .08); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--text); flex: none; transition: border-color .2s, color .2s; }
.iconbtn:hover { border-color: var(--gold); }

/* Champs */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.fld { display: grid; gap: 4px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .2s; min-width: 0; }
.fld:focus-within { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px var(--gold-soft); }
.fld > span { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fld > span .ic { width: 15px; height: 15px; color: var(--gold); }
.fld > span em { font-style: normal; color: var(--faint); }
.fld input, .fld select, .fld textarea { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; font-size: 1rem; font-weight: 500; resize: vertical; }
.fld select { cursor: pointer; }
.fld select option { background: var(--surface); color: var(--text); }
input[type="date"] { color-scheme: light; }
input[type="number"] { -moz-appearance: textfield; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lbl { font-size: .9rem; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; color: var(--text); }
.chip .ic { width: 15px; height: 15px; color: var(--gold); }
button.chip { transition: background .2s, border-color .2s; }
button.chip:hover { border-color: var(--gold); }
button.chip[aria-pressed="true"] { background: var(--gold); color: #fff; border-color: transparent; }
.err { color: var(--danger); font-size: .92rem; }
.note { font-size: .88rem; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 500; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { color: var(--gold-text); } .st-contacted { color: #9DBDF2; } .st-confirmed { color: var(--ok); } .st-closed { color: var(--faint); } .st-cancelled { color: var(--danger); }
.st-available { color: var(--ok); } .st-reserved { color: var(--warn); } .st-sold { color: var(--danger); }
.pill.warn { color: var(--warn); }

/* Fenêtres */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(28, 25, 21, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s; }
.modal.open { opacity: 1; }
.sheet {
  position: relative; display: flex; flex-direction: column; width: min(640px, 100%); max-height: min(92vh, 980px); max-height: min(92dvh, 980px); overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  transform: translateY(24px); transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.sheet.wide { width: min(1140px, 100%); }
.modal.open .sheet { transform: none; }
.sheet-body { padding: 30px; overflow-y: auto; overscroll-behavior: contain; }
.sheet .x { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); }
@media (max-width: 640px) {
  .modal { padding: 0; align-items: flex-end; }
  .sheet, .sheet.wide { border-radius: 24px 24px 0 0; max-height: 95dvh; transform: translateY(100%); }
  .sheet-body { padding: 22px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
}

/* Notifications */
.toasts { position: fixed; z-index: 200; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 14px; background: #1C1915; color: #fff; border: 1px solid #1C1915; box-shadow: var(--shadow); font-size: .95rem; animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.toast.error { border-color: rgba(240, 138, 124, .7); }
.toast.ok { border-color: rgba(134, 211, 168, .7); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.skel { background: linear-gradient(90deg, #F4EFE6, #FBF8F3, #F4EFE6); background-size: 200% 100%; animation: sh 1.4s infinite; border-radius: var(--r); }
@keyframes sh { to { background-position: -200% 0; } }

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