/*
 * Système visuel commun (vacancier et équipe). Sobre : l'app sert un séjour de déconnexion.
 * Couleurs de la côte nord bretonne : vert d'eau profond, sable, granit, bruyère.
 * Chaque zone ajoute ses styles dans son propre fichier (stay.css, staff.css, booking.css…).
 */

:root {
  --ink: #1c2826;
  --ink-2: #3d4b48;
  --muted: #66716e;
  --sea: #22514d;
  --sea-2: #2f6c66;
  --sea-soft: #e3eeec;
  --sand: #f6f1e9;
  --sand-2: #eee6d9;
  --paper: #fffdf9;
  --line: #e2dacd;
  --line-strong: #cfc5b5;
  --heather: #7c5a78;
  --heather-soft: #f1e8f0;
  --ochre: #b8752c;
  --ochre-soft: #f8ecdc;
  --ok: #2d7650;
  --ok-soft: #e2f1e8;
  --warn: #9a6415;
  --warn-soft: #fbf0d9;
  --danger: #a93a2a;
  --danger-soft: #f8e4e0;
  --focus: #1f6fd1;
  --on-sea: #ffffff;
  --sea-deep: #22514d;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(28 40 38 / 6%), 0 4px 16px rgb(28 40 38 / 6%);
  --shadow-lg: 0 8px 32px rgb(28 40 38 / 14%);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --tap: 44px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-auto {
    --ink: #eef2f0;
    --ink-2: #cfd8d5;
    --muted: #9fb0ab;
    --sea: #7cc3b9;
    --sea-2: #9dd5cc;
    --sea-soft: #1d3432;
    --sand: #121a19;
    --sand-2: #1a2423;
    --paper: #18211f;
    --line: #2a3634;
    --line-strong: #3a4845;
    --heather: #d2a8cb;
    --heather-soft: #2c2230;
    --ochre: #e0a35e;
    --ochre-soft: #2e2418;
    --ok: #7dcfa1;
    --ok-soft: #173024;
    --warn: #e7b866;
    --warn-soft: #2e2615;
    --danger: #f08e7d;
    --danger-soft: #331b17;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-lg: 0 8px 32px rgb(0 0 0 / 45%);
    --on-sea: #0e1a18;
    --sea-deep: #1d4541;
    --focus: #8ab8ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
svg.icon { display: inline-block; flex: none; vertical-align: middle; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); }
h1, h2, .serif { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.6rem); }
h3 { font-size: 1.08rem; font-weight: 650; }
h4 { font-size: 0.95rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--sea); text-underline-offset: 3px; }
a:hover { color: var(--sea-2); }
small, .small { font-size: 0.86rem; }
.muted { color: var(--muted); }
.eyebrow { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.08rem; color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* --- Mise en page --------------------------------------------------------------------- */

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--space-4); }
.container--narrow { max-width: 640px; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack--tight { gap: var(--space-2); }
.stack--loose { gap: var(--space-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }
.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.section { padding: var(--space-6) 0; }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--space-4) 0; }
.spacer { flex: 1; }

/* --- Cartes ---------------------------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card--tight { padding: var(--space-4); }
.card--sea { background: var(--sea-deep); border-color: var(--sea-deep); color: #fff; }
.card--sea h1, .card--sea h2, .card--sea h3, .card--sea .muted, .card--sea .eyebrow { color: #fff; }
.card--sea .muted, .card--sea .eyebrow { opacity: 0.8; }
.card--soft { background: var(--sea-soft); border-color: transparent; box-shadow: none; }
.card--ochre { background: var(--ochre-soft); border-color: transparent; box-shadow: none; }
.card--link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card--link:hover { border-color: var(--line-strong); color: inherit; }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }

/* --- Boutons --------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-5);
  border: 1px solid var(--sea); border-radius: 999px;
  background: var(--sea); color: var(--on-sea);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--sea-2); border-color: var(--sea-2); color: var(--on-sea); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--sea); }
.btn--ghost:hover { background: var(--sea-soft); color: var(--sea); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--sea); padding: 0 var(--space-3); }
.btn--quiet:hover { background: var(--sea-soft); border-color: transparent; color: var(--sea); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: var(--on-sea); }
.btn--danger:hover { background: #8e2f22; border-color: #8e2f22; }
.btn--ochre { background: #8f5518; border-color: #8f5518; color: #fff; }
.btn--block { width: 100%; }
.btn--small { min-height: 36px; padding: 0 var(--space-4); font-size: 0.9rem; }
.btn--large { min-height: 54px; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--sea); text-decoration: underline; cursor: pointer; }
.icon-button {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer;
}

/* --- Formulaires ----------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 0.93rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); }
.field .error { font-size: 0.85rem; color: var(--danger); }
.form-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.input, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"],
input[type="time"], input[type="password"], input[type="search"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgb(34 81 77 / 18%); }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: var(--danger); }
.field_with_errors { display: contents; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--sea); flex: none; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.errors ul { margin: var(--space-2) 0 0; padding-left: 1.2em; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--paper); color: var(--sea); cursor: pointer; font-size: 1.2rem; }
.stepper input { width: 44px; min-height: 40px; border: 0; border-radius: 0; text-align: center; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--sand-2); border-radius: 999px; flex-wrap: wrap; }
.segmented a, .segmented button, .segmented label {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-4);
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: 0.92rem;
  text-decoration: none; cursor: pointer;
}
.segmented [aria-current="page"], .segmented .is-active, .segmented input:checked + span { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* --- Badges, puces, messages ----------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 650; background: var(--sand-2); color: var(--ink-2); white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--sea-soft); color: var(--sea); }
.badge--heather { background: var(--heather-soft); color: var(--heather); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; color: var(--ink-2); background: var(--paper); }

.flash { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--sea-soft); color: var(--sea); }
.flash--alert { background: var(--danger-soft); color: var(--danger); }
.flash--demo { background: var(--ochre-soft); color: var(--warn); }

/* --- Listes et données ------------------------------------------------------------------ */

.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list-item__main { flex: 1; min-width: 0; }
.list--links > li > a { display: flex; align-items: center; gap: var(--space-3); flex: 1; color: inherit; text-decoration: none; min-height: var(--tap); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; }

.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price--large { font-size: 1.5rem; font-family: var(--font-serif); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line-strong); }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .right, .right { text-align: right; }

.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--muted); }
.empty .icon { margin: 0 auto var(--space-3); color: var(--line-strong); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__value { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 0.85rem; color: var(--muted); }

.icon-circle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); flex: none; }
.icon-circle--ochre { background: var(--ochre-soft); color: var(--ochre); }
.icon-circle--heather { background: var(--heather-soft); color: var(--heather); }

/* Illustration d'hébergement quand il n'y a pas encore de photo. */
.visual { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(160deg, #cfe0d9 0%, #9cbfb6 55%, #5f8f86 100%); }
.visual--cabin { background: linear-gradient(160deg, #e6d9c4 0%, #c7ab86 55%, #8c6a48 100%); }
.visual--pitch { background: linear-gradient(160deg, #dfe8cf 0%, #b3c796 55%, #7a9460 100%); }
.visual img { width: 100%; height: 100%; object-fit: cover; }
.visual svg.visual__art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Bandeau des étapes d'un parcours. */
.steps { display: flex; gap: var(--space-2); list-style: none; margin: 0; padding: 0; counter-reset: step; overflow-x: auto; }
.steps li { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.88rem; color: var(--muted); }
.steps li::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--sand-2); font-weight: 650; font-size: 0.8rem; }
.steps li.is-done::before { content: "✓"; background: var(--sea-soft); color: var(--sea); }
.steps li.is-current { color: var(--ink); font-weight: 650; }
.steps li.is-current::before { background: var(--sea); color: var(--on-sea); }
.steps li + li::after { content: none; }

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