/* ============================================================ *\
   Lastro — thème « Cosmos & Or »
   Toutes les classes utilisées par le code restent fonctionnelles.
\* ============================================================ */

:root {
  color-scheme: dark;

  --bg: #070b1c;
  --bg-2: #0b1230;
  --night: radial-gradient(1200px 700px at 15% -12%, rgba(139, 124, 240, 0.16), transparent 60%),
    radial-gradient(1000px 600px at 110% 0%, rgba(233, 196, 106, 0.12), transparent 55%),
    linear-gradient(180deg, #070b1c 0%, #0a1128 100%);

  --panel: #0f1734;
  --panel-soft: #121b3c;
  --panel-glass: rgba(255, 255, 255, 0.04);
  --ink: #eef1ff;
  --ink-soft: #cdd2ea;
  --muted: #9aa3c7;
  --faint: #6d7699;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(233, 196, 106, 0.28);

  --gold: #e9c46a;
  --gold-deep: #d4a94b;
  --gold-soft: rgba(233, 196, 106, 0.16);
  --violet: #8b7cf0;
  --violet-deep: #7a5cff;
  --glow-gold: 0 14px 40px -16px rgba(233, 196, 106, 0.5);
  --glow-violet: 0 14px 40px -16px rgba(139, 124, 240, 0.5);

  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.14);
  --warn: #f5c76b;
  --warn-bg: rgba(245, 199, 107, 0.14);
  --error: #ff7b8a;
  --error-bg: rgba(255, 123, 138, 0.14);

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 50px -30px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 30px 90px -40px rgba(0, 0, 0, 0.9);

  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--gold) 0%, #f3d38a 55%, var(--gold-deep) 100%);
  color: #241a06;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  box-shadow: var(--glow-gold);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: 0.45; box-shadow: none; }

button.secondary {
  background: var(--panel);
  color: var(--ink-soft);
  border-color: var(--line-strong);
  box-shadow: none;
}
button.secondary:hover:not(:disabled) {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: none;
  transform: translateY(-1px);
}

button.danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: rgba(255, 123, 138, 0.35);
  box-shadow: none;
}
button.danger:hover:not(:disabled) { background: rgba(255, 123, 138, 0.22); color: var(--error); transform: none; }

button.icon-button {
  display: grid;
  width: 40px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  background: var(--panel);
  color: var(--ink-soft);
  border-color: var(--line);
  box-shadow: none;
  font-size: 1rem;
}

/* ---------- layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: calc(100vh - 28px);
  max-width: 1500px;
  margin: 14px auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(11, 18, 48, 0.55);
  box-shadow: var(--shadow-pop);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---------- sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: #e7e9fb;
  background:
    radial-gradient(460px 320px at 96% -8%, rgba(139, 124, 240, 0.35), transparent 60%),
    radial-gradient(380px 300px at -18% 114%, rgba(233, 196, 106, 0.14), transparent 55%),
    linear-gradient(200deg, #0c1231 0%, #0a0f28 55%, #070b1c 100%);
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5) 1px, transparent 1.6px),
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.4) 1px, transparent 1.6px),
    radial-gradient(circle at 82% 60%, rgba(255, 255, 255, 0.32) 1px, transparent 1.6px),
    radial-gradient(circle at 34% 78%, rgba(255, 255, 255, 0.4) 1px, transparent 1.6px);
  background-size: 180px 180px, 220px 220px, 150px 150px, 260px 260px;
}

.brand-block { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  font-size: 1.2rem;
  color: #241a06;
  background: linear-gradient(135deg, var(--gold) 0%, #f6dfae 55%, var(--gold-deep) 100%);
  box-shadow: var(--glow-gold), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.brand-name { margin: 0; font-family: var(--serif); font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em; color: #fff; }
.brand-caption { margin: 3px 0 0; color: #aeb3e4; font-size: 0.76rem; letter-spacing: 0.04em; }

.nav { display: grid; gap: 4px; position: relative; z-index: 1; }
.nav-section { margin: 16px 8px 6px; color: #8f95cf; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.nav-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  background: transparent;
  color: #ccd0f2;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
  font-weight: 600;
}
.nav-button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: #fff; box-shadow: none; transform: none; }
.nav-button.active {
  background: linear-gradient(90deg, rgba(233, 196, 106, 0.16), rgba(139, 124, 240, 0.14));
  border-color: var(--line-strong);
  color: var(--gold);
  font-weight: 700;
}
.sidebar-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px 18px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(233, 196, 106, 0.14), rgba(255, 255, 255, 0.04));
  color: #dde0f7;
}
.sidebar-card span, .sidebar-card small { color: #a6acdc; font-size: 0.78rem; }
.sidebar-card strong { color: var(--gold); font-family: var(--serif); font-size: 1.05rem; }
.meter { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.meter span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--violet)); }

/* ---------- workspace ---------- */
.workspace { min-width: 0; background: radial-gradient(600px 320px at 100% 0%, rgba(139, 124, 240, 0.1), transparent 55%); }

.topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 15, 40, 0.8);
  backdrop-filter: blur(16px) saturate(1.4);
}
.topbar-title, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar-title h2 { font-size: 1.45rem; }

.search-box { display: flex; align-items: center; gap: 8px; width: min(260px, 26vw); min-height: 42px; margin: 0; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-soft); color: var(--muted); font-weight: 500; }
.search-box input { border: 0; padding: 0; background: transparent; color: var(--ink); }
.session-state { min-height: 42px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--panel); white-space: nowrap; font-size: 0.85rem; font-weight: 600; box-shadow: var(--shadow-card); }

.message { margin: 22px 30px 0; padding: 13px 16px 13px 46px; position: relative; border-radius: 14px; border: 1px solid rgba(245, 199, 107, 0.3); background: var(--warn-bg); color: var(--warn); font-size: 0.92rem; line-height: 1.5; animation: message-in 0.25s ease; }
.message::before { content: "✳"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gold); }
.message.error { border-color: rgba(255, 123, 138, 0.35); background: var(--error-bg); color: var(--error); }
.message.error::before { content: "⚠"; color: var(--error); }
@keyframes message-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- typo ---------- */
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h2 { color: var(--ink); font-size: 1.6rem; }
h3 { color: var(--ink); font-size: 1.04rem; font-weight: 750; }

/* ---------- views ---------- */
.view { display: none; padding: 30px; animation: view-in 0.28s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- héro (auth non connecté) ---------- */
.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: center;
  min-height: 380px;
  margin-bottom: 24px;
  padding: 48px 52px;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-lg);
  color: #eef0ff;
  background:
    radial-gradient(480px 340px at 82% 8%, rgba(139, 124, 240, 0.5), transparent 62%),
    radial-gradient(420px 320px at 4% 108%, rgba(233, 196, 106, 0.28), transparent 58%),
    linear-gradient(215deg, #0c1234 0%, #121a44 55%, #19124a 100%);
  box-shadow: var(--shadow-pop);
}
.intro-panel > div, .intro-panel h1, .intro-panel p { position: relative; z-index: 1; }
.intro-panel h1 { max-width: 640px; font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1.06; margin-bottom: 16px; color: #fff; }
.intro-panel h1 span { background: linear-gradient(90deg, var(--gold), #f6dfae); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 560px; color: #c9cdf0; line-height: 1.7; }
.astro-visual { position: relative; min-height: 270px; }
.astro-visual::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(244, 200, 119, 0.9) 1.4px, transparent 2.4px) 0 0 / 40px 40px, radial-gradient(circle, rgba(255, 255, 255, 0.7) 1.4px, transparent 2.4px) 16px 20px / 62px 62px; opacity: 0.9; }
.orbit { position: absolute; border: 1px solid rgba(205, 194, 255, 0.4); border-radius: 50%; }
.orbit-one { inset: 6%; } .orbit-two { inset: 17%; border-color: rgba(244, 200, 119, 0.4); } .orbit-three { inset: 29%; }
.constellation { position: absolute; inset: 24% 16%; clip-path: polygon(8% 72%, 24% 30%, 48% 48%, 70% 18%, 92% 66%, 48% 48%, 32% 86%); background: rgba(244, 200, 119, 0.8); filter: drop-shadow(0 0 18px rgba(244, 200, 119, 0.55)); }

/* ---------- grilles & panneaux ---------- */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.compact { gap: 12px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  background: linear-gradient(150deg, var(--panel) 0%, var(--panel-soft) 100%);
  box-shadow: var(--shadow-card);
}
.panel.wide { max-width: 1160px; }
.panel h3 { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading h3 { margin-bottom: 0; }

label { display: grid; gap: 7px; margin-bottom: 14px; color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  /* Jamais moins de 16px : en dessous, iOS zoome automatiquement la page
     quand on touche un champ, et la mise en page paraît cassée. */
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  background: #0b1230;
  color: var(--ink);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: rgba(233, 196, 106, 0.4); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); background: #0e1636; }
textarea { resize: vertical; line-height: 1.55; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 0 0 14px; }
legend { font-size: 0.78rem; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 0 8px; }
.hint { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.panel > button { margin-top: 4px; }

/* ---------- listes & items ---------- */
.list { display: grid; gap: 12px; }
.item {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-glass);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-card); background: rgba(255, 255, 255, 0.05); }
.item-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 750; color: var(--ink); }
.item .split-actions button { min-height: 34px; font-size: 0.82rem; padding: 0 12px; border-radius: 10px; }
.meta { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.report-preview { display: grid; gap: 7px; margin-top: 6px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-glass); }
.badge { display: inline-flex; align-items: center; min-height: 25px; border-radius: 999px; padding: 2px 11px; background: var(--gold-soft); color: var(--gold); font-size: 0.76rem; font-weight: 800; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.analysis-detail { display: grid; gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); }
.analysis-detail summary { cursor: pointer; color: var(--ink); font-weight: 800; line-height: 1.4; }
.checklist { display: grid; gap: 9px; margin: 0 0 18px; padding-left: 20px; color: var(--ink-soft); line-height: 1.5; }
.split-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.technical-details { margin: 4px 0 12px; }

/* ---------- lieu de naissance : suggestions & carte de contrôle ---------- */
.place-field { position: relative; display: block; }
.place-suggestions {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #0d1430;
  box-shadow: var(--shadow-pop);
}
.place-suggestions-note { margin: 4px 6px 8px; color: var(--muted); font-size: 0.78rem; font-weight: 700; line-height: 1.4; }
.place-suggestion {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.place-suggestion:hover,
.place-suggestion.active { background: var(--gold-soft); color: var(--gold); }
.place-suggestion-name { flex: 1 1 auto; }
.place-suggestion-meta { flex: 0 0 auto; color: var(--faint); font-size: 0.72rem; font-weight: 600; }
.place-map-wrap { display: grid; gap: 7px; margin-top: 4px; }
.place-mini-map { height: 190px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #0b1230; }
.place-mini-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.86) contrast(0.92) saturate(0.8); }
.place-mini-map.leaflet-container { background: #0b1230; font-family: var(--sans); }
.place-mini-map.leaflet-container .leaflet-control-attribution { background: rgba(7, 11, 28, 0.82); color: var(--muted); font-size: 0.62rem; }
.place-mini-map.leaflet-container .leaflet-control-attribution a { color: var(--gold); }
.place-mini-map .leaflet-tooltip { background: #0d1430; border: 1px solid var(--line-strong); color: var(--ink); font-weight: 700; }
.place-mini-map .leaflet-tooltip-top::before { border-top-color: var(--line-strong); }
.place-mini-map .leaflet-bar { border: 0; box-shadow: none; }
.place-mini-map .leaflet-control-zoom a {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 20, 48, 0.92);
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  line-height: 24px;
}
.place-mini-map .leaflet-control-zoom a:hover { background: rgba(233, 196, 106, 0.22); color: var(--gold); }
.place-mini-map .leaflet-control-zoom a:first-child { border-radius: 8px 8px 0 0; }
.place-mini-map .leaflet-control-zoom a:last-child { border-radius: 0 0 8px 8px; border-top: 0; }
.place-map-note { margin: 0; color: var(--muted); font-size: 0.8rem; }
.place-pin { background: transparent; border: 0; }.place-pin-dot {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(7, 11, 28, 0.85);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #f8e3ae, var(--gold) 62%, var(--gold-deep));
  box-shadow: 0 0 0 3px rgba(233, 196, 106, 0.26), 0 8px 16px -6px rgba(0, 0, 0, 0.85);
  cursor: grab;
}
.place-pin-dot:active { cursor: grabbing; }
.place-pin-status { margin: 0; color: var(--gold); font-size: 0.8rem; font-weight: 650; line-height: 1.45; }
.place-calc-point {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(233, 196, 106, 0.07);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.place-pin-status.place-pin-warning { color: var(--warn); }
button.place-pin-reset { justify-self: start; min-height: 32px; padding: 0 12px; font-size: 0.78rem; border-radius: 10px; }

/* ---------- temps / calcul ---------- */
.time-box { display: grid; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(139, 124, 240, 0.08); }
.time-box label { margin-bottom: 0; }
.time-simple { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------- commercial / admin ---------- */
.credit-balance { display: grid; gap: 4px; margin-bottom: 16px; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(233, 196, 106, 0.14), rgba(139, 124, 240, 0.1)); }
.credit-balance span { color: var(--muted); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.credit-balance strong { color: var(--gold); font-family: var(--serif); font-size: 2.9rem; line-height: 1; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-card { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-glass); }
.stat-card span { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card strong { color: var(--ink); font-family: var(--serif); font-size: 1.9rem; }

/* ---------- json / code ---------- */
.json-output {
  max-height: 540px;
  overflow: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background:
    radial-gradient(300px 200px at 90% 0%, rgba(233, 196, 106, 0.16), transparent 60%),
    #0c1130;
  color: #e7e9ff;
  font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ---------- timeline ---------- */
.timeline { display: grid; gap: 4px; }
.timeline-entry { position: relative; padding: 12px 16px 12px 24px; border: 1px solid transparent; border-radius: var(--radius-sm); }
.timeline-entry::before { content: ""; position: absolute; left: 4px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--violet)); box-shadow: 0 0 0 3px var(--gold-soft); }
.timeline-entry:hover { background: var(--panel-glass); border-color: var(--line); }
.timeline-entry strong { color: var(--ink); font-size: 0.92rem; }

/* ---------- livraison ---------- */
.deliverable-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-md); background: #ffffff; }
.parent-fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 4px 0 12px; }
.parent-fieldset legend { color: var(--muted); }
details.parent-fieldset summary { cursor: pointer; padding: 6px 0; font-weight: 700; color: var(--gold); list-style-position: inside; }
details.parent-fieldset summary::marker { color: var(--gold); }

/* ---------- carte du ciel ---------- */
.chart-card { background: radial-gradient(320px 220px at 70% 20%, rgba(139, 124, 240, 0.12), transparent 60%), var(--panel-glass); }
.chart-svg { display: block; width: 100%; max-width: 460px; margin: 8px auto 4px; }
.chart-svg text { font-family: var(--sans); user-select: none; }
.chart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.chart-row:last-child { border-bottom: 0; }
.chart-label { color: var(--ink-soft); font-weight: 650; }
.chart-row strong { color: var(--ink); font-family: var(--serif); font-size: 1.02rem; white-space: nowrap; }
.chart-side { color: var(--muted); font-size: 0.85rem; text-align: right; white-space: nowrap; }
.badge-row { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.item-title .badge-row { justify-content: flex-end; }

/* ---------- notes ---------- */
.note { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius-md); font-size: 0.92rem; line-height: 1.55; }
.note-accent { background: linear-gradient(135deg, rgba(139, 124, 240, 0.18), rgba(233, 196, 106, 0.12)); border: 1px solid rgba(233, 196, 106, 0.28); color: #d7dcff; }
.note-accent strong { color: var(--gold); }
.hero-result { border: 1px solid var(--line-strong); background: linear-gradient(150deg, rgba(139, 124, 240, 0.12), var(--panel-glass)); }
.hero-result .item-title { font-family: var(--serif); font-size: 1.12rem; }

/* ---------- progression ---------- */
.progress-panel { margin: 14px 0 4px; padding: 12px 14px; border: 1px solid rgba(233, 196, 106, 0.28); border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(139, 124, 240, 0.14), rgba(233, 196, 106, 0.1)); }
.progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.progress-top strong { color: var(--ink); font-size: 0.95rem; }
.progress-top span { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--violet)); background-size: 200% 100%; animation: progress-shine 1.6s linear infinite; transition: width 0.6s ease; }
@keyframes progress-shine { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* ---------- carte des prix ---------- */
.price-card { display: grid; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: radial-gradient(360px 240px at 85% 0%, rgba(233, 196, 106, 0.14), transparent 60%), linear-gradient(150deg, var(--panel) 0%, var(--panel-soft) 100%); }
.price-hero { display: grid; gap: 6px; text-align: center; }
.price-hero span { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; line-height: 1; background: linear-gradient(90deg, var(--gold), #f6dfae, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.price-hero strong { color: var(--muted); font-size: 0.95rem; font-weight: 700; }
.price-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.price-chips .chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: 0.88rem; font-weight: 700; box-shadow: none; }
.price-chips .chip:hover { border-color: var(--gold); color: var(--gold); transform: none; box-shadow: none; }
.price-chips .chip.active { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); border-color: transparent; color: #241a06; box-shadow: var(--glow-gold); }
#price-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; background: linear-gradient(90deg, rgba(139,124,240,.5), var(--gold)); outline: none; cursor: pointer; }
#price-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #241a06; border: 5px solid var(--gold); box-shadow: 0 6px 18px -4px rgba(0,0,0,0.7); cursor: grab; }
#price-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #241a06; border: 5px solid var(--gold); box-shadow: 0 6px 18px -4px rgba(0,0,0,0.7); cursor: grab; }
.slider-scale { display: flex; justify-content: space-between; color: var(--faint); font-size: 0.74rem; margin-top: -6px; }
.share-box { display: grid; gap: 10px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.03); }
.share-box .hint { text-align: center; }
.fiscal-note { display: block; color: var(--faint); font-size: 0.72rem; line-height: 1.5; text-align: center; }
#price-result { text-align: center; font-weight: 650; }
#price-confirm { text-align: center; }
#price-confirm .split-actions { justify-content: center; }

/* ---------- tech fold ---------- */
.tech-fold { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-glass); }
.tech-fold summary { cursor: pointer; padding: 12px 14px; color: var(--ink-soft); font-size: 0.88rem; font-weight: 700; list-style-position: inside; }
.tech-fold summary:hover { color: var(--gold); }
.tech-fold .json-output { border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-top: 1px solid var(--line); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #333a66; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #4a5488; border: 2px solid transparent; background-clip: content-box; }

/* ============================================================ *\
   MODE VISITEUR « simple »
\* ============================================================ */

#guest-hero { max-width: 960px; margin: 20px auto 10px; padding: 0 10px 18px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.guest-topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 960px; }
.guest-brand { display: inline-flex; align-items: center; gap: 10px; }
.guest-brand-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: #fff; }
.guest-topbar button { min-height: 38px; padding: 0 16px; font-size: 0.85rem; }
#guest-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); color: #fff; }
#guest-hero h1 span { background: linear-gradient(90deg, var(--gold), #f6dfae); -webkit-background-clip: text; background-clip: text; color: transparent; }
.guest-lead { color: #c9cdf0; font-size: 1.15rem; line-height: 1.6; max-width: 560px; }
.guest-cta-note { color: var(--muted); font-size: 0.9rem; }
.gold-btn { padding: 0 30px; min-height: 50px; font-size: 1rem; border-radius: 999px; }

.guest-zodiac { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 780px; margin-top: 6px; }
.zodiac-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 8px;
  border: 1px solid rgba(233, 196, 106, 0.28);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(139, 124, 240, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.zodiac-glyph { font-size: 1.7rem; color: var(--gold); }
.zodiac-name { font-family: var(--serif); font-size: 0.92rem; color: var(--ink-soft); }
.zodiac-symbol { font-size: 0.75rem; color: var(--violet); }

.express-wrap { max-width: 640px; margin: 0 auto; }
#express-viewer { margin: 22px auto 0; max-width: 860px; }
#express-viewer:not([hidden]) { display: block; }
#express-ready-hint { margin: 2px 0 0; }
.express-optional summary { cursor: pointer; padding: 4px 0; font-weight: 700; color: var(--gold); list-style-position: inside; }

/* En visite : on masque l'outillage pro */
body.guest .sidebar, body.guest .topbar { display: none !important; }
body.guest .message { margin: 10px auto 0; max-width: 620px; }
body.guest .app-shell { display: block; max-width: 1000px; min-height: 100vh; margin: 0 auto; padding: 10px 18px 48px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
body.guest .workspace { background: transparent; }
body.guest .view { padding: 0; }
body.guest #express-view { padding: 6px 0 36px; }
body.guest #express-view .grid.two { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
body.guest #express-view .grid.two .panel + .panel { display: none; }
body.guest #express-viewer { max-width: 860px; margin: 18px auto 0; }
body.guest .note-accent { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); margin: 0; border-radius: 0; min-height: 100vh; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding: 20px 18px 12px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav-section, .sidebar-card { grid-column: 1 / -1; }
  .sidebar-card { margin-top: 8px; }
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px 18px; }
  .topbar-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .view { padding: 18px; }
  .intro-panel, .grid.two, .grid.three, .time-box { grid-template-columns: 1fr; }
  .intro-panel { padding: 30px 24px; }
  .astro-visual { display: none; }
  .message { margin: 16px 18px 0; }
}
@media (max-width: 560px) {
  .view { padding: 14px; }
  .panel { padding: 18px; }
  .item-title { align-items: flex-start; flex-direction: column; gap: 6px; }
  .item .split-actions { width: 100%; }
  .time-simple { grid-template-columns: 1fr; }
  .guest-zodiac { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-row { grid-template-columns: 1fr; gap: 3px; }
  .chart-side { text-align: left; }
}

/* ---------- téléphones : en-tête compact, formulaire visible plus tôt ---------- */
@media (max-width: 640px) {
  /* Champs et sélecteurs à 16px minimum (sinon iOS zoome au toucher). */
  input, select, textarea { font-size: 1rem; }

  .guest-header { padding: 10px 0 2px; }
  .guest-header-inner { align-items: center; gap: 10px; }
  .guest-brand-name { font-size: 1.25rem; }
  .guest-header-left { gap: 6px; }
  .guest-lang #guest-language { min-width: 0; width: 100%; max-width: 200px; font-size: 1rem; padding: 8px 10px; }
  .guest-header-actions { gap: 6px; }
  .guest-header-actions button { min-height: 34px; padding: 0 12px; font-size: 0.8rem; }

  #guest-hero { margin: 6px auto 2px; padding: 0 8px 10px; gap: 8px; }
  #guest-hero h1 { font-size: 1.85rem; }
  .guest-lead { font-size: 0.98rem; line-height: 1.45; }
  .hero-tag { font-size: 0.6rem; letter-spacing: 0.08em; padding: 5px 12px; }

  #express-view .express-wrap .panel { padding: 18px; }
  #express-payment { padding: 14px; }
  .price-chips { gap: 6px; }
  .price-chips .chip { min-height: 36px; padding: 0 11px; font-size: 0.82rem; }
  .ai-notice { padding: 12px; }
  #pay-start { font-size: 0.86rem; }
}

/* ---------- print ---------- */
@media print { body { background: #fff; } }

/* ============================================================ *\
   2e passe « Premium » — profondeur, lueurs, ornements, forme
\* ============================================================ */

/* --- atmosphère derrière le héros --- */
#guest-hero { position: relative; padding-top: 22px; }
#guest-hero::before {
  content: "";
  position: absolute;
  inset: -18% -8%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 440px at 50% 4%, rgba(139, 124, 240, 0.3), transparent 62%),
    radial-gradient(520px 400px at 72% 16%, rgba(233, 196, 106, 0.18), transparent 60%),
    radial-gradient(520px 400px at 28% 18%, rgba(139, 124, 240, 0.16), transparent 60%);
  filter: blur(6px);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#guest-hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.4rem);
  letter-spacing: -0.015em;
  text-shadow: 0 0 46px rgba(233, 196, 106, 0.18);
}
#guest-hero h1 span {
  background: linear-gradient(90deg, #f4d98a, #e9c46a 55%, #f6e6b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(233, 196, 106, 0.35);
}
.guest-lead { color: #c6ccf2; letter-spacing: 0.02em; }

/* bouton Connexion en contour doré (plus élégant que le bloc plein) */
.guest-topbar button {
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  box-shadow: none;
}
.guest-topbar button:hover { border-color: var(--gold); background: var(--gold-soft); box-shadow: none; transform: none; }

.guest-cta-note { color: #9aa3c7; letter-spacing: 0.02em; }
.gold-btn {
  font-weight: 800;
  box-shadow: 0 18px 50px -12px rgba(233, 196, 106, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.gold-btn::after { content: " →"; margin-left: 8px; }

/* --- grille des 12 signes : cartes ornées --- */
.guest-zodiac { gap: 16px; max-width: 840px; position: relative; }
#guest-zodiac::after {
  content: "";
  position: absolute;
  inset: -46px -20px;
  z-index: -1;
  background: radial-gradient(60% 52% at 50% 42%, rgba(139, 124, 240, 0.14), transparent 62%);
  filter: blur(10px);
}
.zodiac-card {
  position: relative;
  border-radius: 18px;
  padding: 18px 8px 14px;
  border: 1px solid rgba(233, 196, 106, 0.35);
  background: linear-gradient(165deg, rgba(20, 28, 66, 0.9), rgba(12, 18, 48, 0.6));
  box-shadow: 0 22px 54px -26px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.zodiac-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(233, 196, 106, 0.18);
  border-radius: 13px;
  pointer-events: none;
}
.zodiac-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: 0 28px 64px -26px rgba(233, 196, 106, 0.5), inset 0 0 26px rgba(233, 196, 106, 0.08);
}
.zodiac-glyph { font-size: 2.1rem; color: var(--gold); text-shadow: 0 0 20px rgba(233, 196, 106, 0.5); }
.zodiac-name { font-family: var(--serif); font-size: 0.95rem; color: #eef1ff; letter-spacing: 0.03em; }
.zodiac-symbol { font-size: 0.72rem; color: var(--violet); opacity: 0.85; }

/* --- formulaire de lecture raffiné --- */
#express-view .express-wrap .panel,
body.guest #express-view .express-wrap .panel {
  border-radius: 22px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, rgba(17, 24, 52, 0.92), rgba(11, 17, 40, 0.9));
  box-shadow: 0 34px 90px -42px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
#express-view .express-wrap .panel h3 { font-size: 1.4rem; color: #fff; }
#express-form label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
#express-form input, #express-form select, #express-form textarea {
  border-radius: 12px;
  background: rgba(10, 15, 38, 0.85);
  border: 1px solid var(--line);
  color: var(--ink);
}
#express-form input:focus, #express-form select:focus, #express-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
  background: #0d1436;
}
#express-form button[type="submit"] {
  border-radius: 999px;
  min-height: 52px;
  font-size: 1.02rem;
  margin-top: 6px;
}
#express-form .secondary {
  border-radius: 12px;
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
#express-form .secondary:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
#express-viewer { border-radius: 22px; }

/* ---------- modale horoscope du jour ---------- */

.horoscope-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 22, 0.72);
  backdrop-filter: blur(8px);
}
.horoscope-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 26px 24px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(165deg, #141c44, #0c1232);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.horoscope-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: none;
}
.horoscope-close:hover { border-color: var(--gold); color: var(--gold); background: transparent; }
.horoscope-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.horoscope-glyph {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  font-size: 1.8rem;
  color: var(--gold);
  background: var(--gold-soft);
  text-shadow: 0 0 18px rgba(233, 196, 106, 0.5);
}
.horoscope-head h3 { font-family: var(--serif); font-size: 1.4rem; color: #fff; margin: 0; }
.horoscope-content { display: grid; gap: 14px; }
.horoscope-block {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.h-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}
.horoscope-block p { color: var(--ink-soft); line-height: 1.55; font-size: 0.94rem; }
#horoscope-note { margin-top: 12px; }

/* ---------- bloc de paiement pendant la génération ---------- */

.pay-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(233, 196, 106, 0.14), rgba(139, 124, 240, 0.12));
}
.pay-head { display: grid; gap: 4px; }
.pay-head strong { color: #fff; font-size: 0.98rem; }
.pay-head span { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.5; }
.pay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #f3d38a 55%, var(--gold-deep));
  color: #241a06;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--glow-gold);
}
.pay-button:hover { filter: brightness(1.06); }
.pay-panel small { color: var(--faint); font-size: 0.74rem; line-height: 1.5; }

/* ---------- sélecteur de langue (accueil visiteur) ---------- */

.guest-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#guest-language {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

#guest-language:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

#guest-language option {
  background: #101638;
  color: var(--ink);
}

/* ---------- en-tête visiteur (marque + langue) ---------- */

.guest-header {
  display: block;
  padding: 18px 0 6px;
}

.guest-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.guest-header-left {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.guest-lang {
  display: block;
  margin: 0;
}

.guest-lang #guest-language {
  width: auto;
  min-width: 180px;
}

.guest-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guest-header-actions button {
  min-height: 38px;
  border-radius: 999px;
  font-size: 0.85rem;
}

#guest-back {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  box-shadow: none;
}

#guest-back:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
  box-shadow: none;
}

/* connexion en mode visiteur : on garde l'écran épuré */
body.guest .intro-panel {
  display: none;
}

body.guest #auth-view .panel:has(#logout-button) {
  display: none;
}

#auth-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.85rem;
  box-shadow: none;
}

#auth-back:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
  box-shadow: none;
}

/* ---------- paiement intégré (sans quitter la page) ---------- */

.pay-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 22, 0.78);
  backdrop-filter: blur(8px);
}

.pay-modal {
  width: 100%;
  max-width: 560px;
  height: min(78vh, 720px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(165deg, #141c44, #0c1232);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.pay-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pay-modal-head strong {
  color: #fff;
  font-size: 1.02rem;
}

.secondary-link {
  color: var(--gold);
  font-size: 0.84rem;
  text-decoration: underline;
}

#payment-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: #ffffff;
}

.pay-modal .hint {
  font-size: 0.78rem;
  text-align: center;
}

a.pay-button,
button.pay-button {
  text-decoration: none;
  cursor: pointer;
}

/* ---------- étape de paiement Stripe (dans la page) ---------- */

.pay-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.pay-amount-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.pay-hint { margin: 0 0 12px; color: var(--muted); font-size: 0.76rem; line-height: 1.45; }

/* ---------- accès gratuit de test (exploitant) ---------- */
.test-code-box { margin: 4px 0 12px; }
.test-code-toggle-line { margin: 0; }
button.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
button.link-button:hover { color: var(--gold); background: transparent; }
#test-code-fields { display: grid; gap: 8px; margin-top: 8px; }
#test-code-fields label { font-size: 0.7rem; }
#test-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

.pay-amount-field input {
  width: 96px;
  min-height: 42px;
  text-align: center;
  border-radius: 12px;
  background: rgba(10, 15, 38, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.checkout-container {
  margin-top: 14px;
  padding: 6px;
  border-radius: 14px;
  background: #ffffff;
}

#pay-status {
  text-align: center;
  font-weight: 650;
}

/* ---------- avertissement IA avant paiement ---------- */

.ai-notice {
  display: grid;
  gap: 8px;
  margin: 12px 0 10px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 199, 107, 0.4);
  border-radius: var(--radius-md);
  background: rgba(245, 199, 107, 0.1);
}

.ai-notice strong {
  color: var(--warn);
  font-size: 0.95rem;
}

.ai-notice span {
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.55;
}

.ai-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.ai-consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--gold);
}
