/* ==========================================================================
   Taysir Voyages — charte commune (site, appli pèlerin, gestion, page en direct)
   Sable, sarcelle de nuit, or. Instrument Serif + Manrope + JetBrains Mono,
   IBM Plex Sans Arabic + Amiri pour l'arabe. Motif : étoile à 8 branches (khatam).
   ========================================================================== */

:root {
  --night: #0e2a2b;
  --night-2: #133637;
  --night-3: #1c4747;
  --sand: #f3ede1;
  --sand-2: #e9e0cd;
  --sand-3: #ddd1b8;
  --paper: #fbf8f2;
  --white: #fffdf8;
  --ink: #13201f;
  --ink-2: #44514e;
  --ink-3: #5c6763;
  --line: rgba(19, 32, 31, .12);
  --line-2: rgba(19, 32, 31, .2);
  --gold: #b8913a;
  --gold-2: #d4b46a;
  --gold-ink: #7d6020;
  --gold-soft: #f2e7cc;
  --palm: #2e6b55;
  --palm-soft: #dcebe2;
  --amber: #d98e2b;
  --amber-ink: #8a5310;
  --amber-soft: #f8e7cc;
  --red: #b8432f;
  --red-soft: #f5ddd5;
  --mist: #dfe7e4;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Sans Arabic", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ar-sans: "IBM Plex Sans Arabic", "Manrope", system-ui, sans-serif;
  --ar-serif: "Amiri", "Instrument Serif", serif;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.2, 1.35, .4, 1);
  --shadow: 0 1px 0 rgba(19, 32, 31, .04), 0 18px 40px -26px rgba(14, 42, 43, .45);
  --shadow-lg: 0 30px 70px -36px rgba(14, 42, 43, .55), 0 12px 24px -18px rgba(14, 42, 43, .3);

  /* Lattice khatam (étoile à 8 branches) dessinée en SVG : or, encre, or clair sur fond nuit */
  --khatam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='%23b8913a' stroke-width='.7' d='M22 22h36v36H22zM40 14.5 65.5 40 40 65.5 14.5 40zM40 0v14.5M40 65.5V80M0 40h14.5M65.5 40H80M0 0l22 22M80 0 58 22M0 80l22-22M80 80 58 58'/%3E%3Ccircle cx='40' cy='40' r='6' fill='none' stroke='%23b8913a' stroke-width='.5'/%3E%3C/svg%3E");
  --khatam-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='%2313201f' stroke-width='.6' d='M22 22h36v36H22zM40 14.5 65.5 40 40 65.5 14.5 40zM40 0v14.5M40 65.5V80M0 40h14.5M65.5 40H80M0 0l22 22M80 0 58 22M0 80l22-22M80 80 58 58'/%3E%3C/svg%3E");
  --khatam-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='none' stroke='%23d4b46a' stroke-width='.7' d='M22 22h36v36H22zM40 14.5 65.5 40 40 65.5 14.5 40zM40 0v14.5M40 65.5V80M0 40h14.5M65.5 40H80M0 0l22 22M80 0 58 22M0 80l22-22M80 80 58 58'/%3E%3Ccircle cx='40' cy='40' r='6' fill='none' stroke='%23d4b46a' stroke-width='.5'/%3E%3C/svg%3E");

  /* Couche Démesure (bandeau démo, bascule site / gestion, section « Côté agence ») */
  --p-ink: #0b0b0a;
  --p-ink-2: #151513;
  --p-bone: #ebe8df;
  --p-dim: rgba(235, 232, 223, .66);
  --p-faint: rgba(235, 232, 223, .3);
  --p-rule: rgba(235, 232, 223, .14);
  --p-acc: #ff4a1c;
  --p-display: "Archivo", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--sand); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; }
svg use { pointer-events: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--white); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ar { font-family: var(--ar-sans); }
.ar-serif { font-family: var(--ar-serif); }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Logo -------------------------------------------------------------- */
.ty-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.ty-logo__mark { width: 34px; height: 34px; flex: none; }
.ty-logo__word { display: flex; flex-direction: column; line-height: 1; }
.ty-logo__word b { font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -.01em; }
.ty-logo__word small { margin-top: 3px; white-space: nowrap; font: 500 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ty-logo__ar { font-family: var(--ar-serif); font-size: 22px; line-height: 1; color: var(--gold); padding-left: 12px; border-left: 1px solid var(--line-2); }

/* ---------- Boutons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 15px; letter-spacing: -.005em; text-decoration: none; white-space: nowrap; transition: transform .35s var(--ease), background-color .2s, color .2s, box-shadow .2s; }
.btn .i { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn--night { background: var(--night); color: var(--paper); box-shadow: 0 12px 26px -14px rgba(14, 42, 43, .8); }
.btn--night:hover { background: var(--night-3); }
.btn--gold { background: var(--gold); color: var(--ink); box-shadow: 0 12px 26px -14px rgba(184, 145, 58, .9); }
.btn--gold:hover { background: #a6812f; }
.btn--ghost { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--light { background: var(--paper); color: var(--night); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------- Pastilles d'état ----------------------------------------------------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--mist); color: var(--ink-2); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag--ok { background: var(--palm-soft); color: var(--palm); }
.tag--warn { background: var(--amber-soft); color: var(--amber-ink); }
.tag--bad { background: var(--red-soft); color: #9c3726; }
.tag--gold { background: var(--gold-soft); color: #6a5019; }
.tag--plain::before { display: none; }

/* ---------- Tampon encré (« Visa reçu », « 412 ») --------------------------------- */
.stamp { position: relative; display: inline-grid; place-items: center; min-width: 64px; padding: 5px 12px 4px; border: 2px solid var(--gold-2); border-radius: 9px; color: var(--gold-2); font: 700 13px/1.1 var(--mono); letter-spacing: .1em; text-transform: uppercase; transform: rotate(-7deg); box-shadow: inset 0 0 0 2px rgba(212, 180, 106, .18), 0 0 0 3px rgba(212, 180, 106, .08); }
.stamp--big { font-size: 26px; letter-spacing: .04em; padding: 4px 14px 2px; border-width: 2.5px; }
.stamp--ink { color: var(--gold-ink); border-color: var(--gold); box-shadow: inset 0 0 0 2px rgba(184, 145, 58, .15); }
.stamp--palm { color: #8fd1b4; border-color: #8fd1b4; box-shadow: inset 0 0 0 2px rgba(143, 209, 180, .16); }
.stamp.is-in { animation: stamp .6s var(--spring) both; }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-7deg) scale(1.45); filter: blur(2.5px); }
  55% { opacity: 1; filter: blur(0); }
  72% { transform: rotate(-7deg) scale(.96); }
  100% { opacity: 1; transform: rotate(-7deg) scale(1); filter: blur(0); }
}

/* ---------- Carte de voyage (billet à bord perforé) -------------------------------- */
.pass { --notch: var(--sand); position: relative; isolation: isolate; overflow: hidden; border-radius: 22px; background: var(--night); color: var(--paper); box-shadow: var(--shadow-lg); }
.pass::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--khatam-light) 0 0 / 64px 64px; opacity: .13; mask-image: linear-gradient(120deg, #000 10%, transparent 75%); -webkit-mask-image: linear-gradient(120deg, #000 10%, transparent 75%); }
.pass__top, .pass__bottom { padding: 18px 20px; }
.pass__tear { position: relative; height: 0; margin: 0 18px; border-top: 2px dashed rgba(251, 248, 242, .22); }
.pass__tear::before, .pass__tear::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--notch); }
.pass__tear::before { left: -32px; }
.pass__tear::after { right: -32px; }
.pass__k { font: 500 10px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(251, 248, 242, .55); }
.pass__v { margin-top: 3px; font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.pass__route { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pass__iata { font: 400 38px/1 var(--mono); letter-spacing: -.02em; }
.pass__line { flex: 1; position: relative; height: 1px; background: repeating-linear-gradient(90deg, rgba(212, 180, 106, .8) 0 3px, transparent 3px 8px); }
.pass__line svg { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: var(--gold-2); background: var(--night); padding: 0 2px; }

/* ---------- Bandeau démo « Projet concept » (couche Démesure) ------------------------ */
.demo-bar { position: relative; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 6px 18px; min-height: 38px; padding: 8px 20px; background: var(--p-ink); color: var(--p-dim); font: 400 12.5px/1.4 var(--p-display); }
.demo-bar b { color: var(--p-bone); font-weight: 700; }
.demo-bar a { color: var(--p-bone); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(235, 232, 223, .35); }
.demo-bar a:hover { color: var(--p-acc); }
.demo-bar > span:first-child { flex: 1; min-width: 0; }
.demo-bar__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; }
.demo-bar__links a { color: var(--p-acc); text-decoration: none; white-space: nowrap; }
.demo-bar__short { display: none; }
@media (max-width: 760px) {
  .demo-bar { flex-wrap: nowrap; padding: 7px 14px; font-size: 12px; }
  .demo-bar > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .demo-bar__long { display: none; }
  .demo-bar__short { display: inline; }
  .demo-bar__links { flex-wrap: nowrap; gap: 12px; }
}

/* ---------- Bascule « Site client | Gestion agence » -------------------------------- */
.pmode { position: fixed; z-index: 75; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 3px; padding: 4px; border-radius: 999px; background: rgba(11, 11, 10, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(235, 232, 223, .12); font-family: var(--p-display); transition: bottom .45s var(--ease), opacity .4s; }
.pmode a { display: grid; place-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--p-dim); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background-color .25s, color .25s; }
.pmode a[aria-current="page"] { background: var(--p-bone); color: var(--p-ink); }
.pmode a:not([aria-current]) { color: var(--p-acc); }
.pmode a:not([aria-current]):hover { color: var(--p-bone); }
.has-track .pmode { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); }
html:has(.sheet.is-open) .pmode { opacity: 0; pointer-events: none; }
@media (max-width: 560px) { .pmode a { padding: 0 13px; font-size: 12.5px; } }

/* ---------- Mode intégré (cadres de la page « en direct ») ------------------------------ */
.is-embed .demo-bar, .is-embed .pmode { display: none !important; }

/* ---------- Toasts ------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 90; left: 0; right: 0; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; overflow: hidden; }
.toast { max-width: min(460px, 100%); display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--night); color: var(--paper); font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: var(--shadow-lg); animation: toast-in .5s var(--ease) both; pointer-events: auto; }
.toast .i { color: var(--gold-2); }
.toast.is-out { animation: toast-out .35s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

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