/* ===================================================================
   RANGE-PICKER — sélecteur de plage de dates (un seul champ, début et
   fin choisis dans le même calendrier sans le refermer).
   Partagé par le formulaire public et l'espace d'administration.
   =================================================================== */

/* ── Sélecteur de période (calendrier de plage) ── */
.period-field { position: relative; }
.period-model { position: absolute !important; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; clip: rect(0 0 0 0); }
/* L'icone calendrier est a GAUCHE : le bord droit est occupe par le bouton des
   gestionnaires de mots de passe (Dashlane & co) qui recouvrirait tout ce qu'on
   y placerait. Le declencheur est de toute facon cliquable sur toute sa
   largeur. */
.period-trigger {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid var(--e-hair);
  border-radius: 0; padding: 9px 2px 11px; font: inherit; color: var(--e-faint);
  cursor: pointer; text-align: left;
}
.period-trigger.has-value { color: var(--e-ink); }
.period-trigger:hover { border-bottom-color: var(--e-sea); }
.period-trigger:focus-visible { outline: none; border-bottom-color: var(--e-sun); }
/* order:-1 remonte l'icone en tete sans toucher au balisage des quatre pages
   qui reprennent ce composant. */
.period-trigger svg { width: 20px; height: 20px; color: var(--e-muted); flex-shrink: 0; order: -1; }
.period-display { flex: 1 1 auto; min-width: 0; }
.period-arrow { color: var(--e-sun); font-weight: 700; padding: 0 4px; }

.period-pop {
  position: fixed; z-index: 200; background: var(--e-paper-hi);
  border: 1px solid var(--e-hair); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(18,45,60,.22); padding: 14px 16px 16px;
  max-width: 94vw;
}
.period-pop[hidden] { display: none; }
/* La barre est superposee aux titres de mois. Elle DOIT etre en position
   absolue : avec une marge negative sur .cal-months, le bloc des mois
   passait par-dessus et interceptait les clics — les fleches etaient
   inertes. pointer-events: none sur la barre, auto sur les boutons. */
.cal-bar {
  position: absolute; top: 14px; left: 16px; right: 16px;
  display: flex; justify-content: space-between;
  pointer-events: none; z-index: 2;
}
.cal-nav {
  pointer-events: auto;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--e-hair);
  background: var(--e-paper); color: var(--e-ink); font-size: 1.3rem; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.cal-nav:hover { border-color: var(--e-sea); color: var(--e-sea); }
.cal-months { display: flex; gap: 24px; margin-top: 6px; }
.cal-title {
  text-align: center; font-family: var(--font-display); text-transform: uppercase;
  font-weight: 600; letter-spacing: .02em; color: var(--e-ink); font-size: 1rem; margin: 0 0 10px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 1px; }
.cal-dow { text-align: center; font-size: .64rem; text-transform: uppercase; letter-spacing: .03em; color: var(--e-faint); font-weight: 600; padding-bottom: 5px; }
.cal-day {
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 9px;
  color: var(--e-ink); font: inherit; font-size: .9rem; cursor: pointer;
}
.cal-day:hover:not(.is-disabled):not(.is-start):not(.is-end) { background: #e6ecf4; }
.cal-day.is-disabled { color: var(--e-faint); opacity: .38; cursor: default; }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--e-hair); }
.cal-day.is-in { background: #dde7f5; border-radius: 0; }
.cal-day.is-start, .cal-day.is-end { background: var(--e-sea); color: #fff; font-weight: 600; }
.cal-day.is-start { border-radius: 9px 0 0 9px; }
.cal-day.is-end { border-radius: 0 9px 9px 0; }
.cal-day.is-start.is-end { border-radius: 9px; }
.period-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--e-hair); }
.period-clear { background: none; border: 0; color: var(--e-muted); font: inherit; cursor: pointer; text-decoration: underline; padding: 6px 2px; }
.period-clear:hover { color: var(--e-ink); }
.period-done { border-radius: 999px; padding: 9px 22px; }
@media (max-width: 560px) {
  .cal-day { width: 34px; height: 34px; }
  .period-pop { padding: 12px; }
}

/* ── Choix du type de tarif : par jour / pour le séjour ──
   Partagé par le générateur externe (codes.html) et celui de l'admin. */
.cg-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.cg-mode-opt {
  display: flex; min-width: 0; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--e-hair, #dcdbcf); border-radius: 12px;
  padding: 12px 14px; background: var(--e-paper-hi, #f7f7f1);
  transition: border-color .15s ease, background .15s ease;
}
.cg-mode-opt:hover { border-color: var(--e-sea, #1C5FAD); }
.cg-mode-opt:has(input:checked) { border-color: var(--e-sun, #E87B1A); background: #fbf4ea; }
/* Le radio hérite sinon du width:100% des champs de formulaire et
   écrase toute la largeur de la carte (le libellé tombe à 0 px). */
.cg-mode-opt input[type="radio"] {
  width: auto !important; min-width: 0 !important; max-width: none;
  flex: 0 0 auto; margin-top: 3px; padding: 0; border: 0; background: none;
  accent-color: var(--e-sun, #E87B1A);
}
.cg-mode-opt span { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cg-mode-opt strong { font-size: .95rem; color: var(--e-ink, #172530); }
.cg-mode-opt small { font-size: .76rem; color: var(--e-muted, #5f6b70); line-height: 1.3; }
@media (max-width: 560px) { .cg-mode { grid-template-columns: 1fr; } }
