/* Site client : en-tête émail, recherche, liste à plaquettes, fiche, devis, compte. */
.top { background: var(--enamel); color: var(--on-enamel); padding: 0 20px 22px; }
.top-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.0625rem; line-height: 1.3; }
.brand small { display: block; font-weight: 500; font-size: var(--t-1); color: var(--on-enamel-2); }
.disc {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 2.5px solid #fff; font-weight: 800; font-size: 1.125rem; flex: none;
}
.top-nav { display: flex; gap: 4px; }
.top-nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: var(--r-s);
  color: #fff; text-decoration: none; font-weight: 700; transition: background-color 160ms ease;
}
.top-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); }
@media (hover: hover) and (pointer: fine) { .top-nav a:hover { background: rgba(255, 255, 255, .1); } }

.search {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.3fr 1.3fr 1fr .8fr auto; gap: 10px; align-items: end;
  padding: 12px; background: var(--enamel-deep); border-radius: var(--r-l);
}
.sf { display: grid; gap: 5px; min-width: 0; }
.sf > span { font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-enamel-2); }
.search .select { border-color: transparent; font-weight: 600; color: var(--ink); }
.search .btn-go { min-height: 44px; padding: 0 26px; }

main { outline: none; }
.view { max-width: 1240px; margin: 0 auto; padding: 26px 20px 10px; }

/* Résultats */
.results-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
.filters { position: sticky; top: 16px; display: grid; gap: 4px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters-head h2 { font-size: var(--t-3); }
.sheet-grip, .sheet-close, .sheet-apply, .filters-open { display: none; }
.fs { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 14px 0 12px; min-width: 0; }
.fs legend { float: left; width: 100%; padding: 0 0 8px; font-size: var(--t-1); font-weight: 800; color: var(--ink-2); }
.fs > :not(legend) { clear: both; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px; border: 1px solid var(--rule-strong); border-radius: var(--r-s); background: #fff; }
.seg button { min-height: 36px; border: 0; border-radius: 4px; background: transparent; font-size: var(--t-1); font-weight: 700; cursor: pointer; padding: 0 4px; }
.seg button[aria-checked="true"] { background: var(--enamel); color: #fff; }
input[type="range"] { width: 100%; accent-color: var(--enamel); }
.range-out { display: block; font-size: var(--t-1); font-weight: 700; color: var(--ink-2); }

.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.results-head h1 { font-size: var(--t-4); font-weight: 800; }
.source {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 12px; padding: 9px 12px;
  border-radius: var(--r-s); font-size: var(--t-1); font-weight: 600; background: #fff; border: 1px solid var(--rule);
}
.source .i { width: 16px; height: 16px; color: var(--free); }
.source.is-down { background: var(--hold-soft); border-color: #e8cf8a; color: #5c3f00; }
.source.is-down .i { color: var(--hold); }
.legend { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--free); display: inline-block; }
.legend i.t { background: var(--taken); }
.legend i.h { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M-2 2l4-4M0 8l8-8M6 10l4-4' stroke='%23f1d27a' stroke-width='3'/%3E%3C/svg%3E") #fff; border: 1.5px solid var(--hold); }

.boats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.boat {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; gap: 20px; align-items: center;
  padding: 16px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l);
  box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) { .boat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--rule-strong); } }
.boat.is-off { opacity: .72; }
.boat-pic { background: #e6eef5; border-radius: var(--r-m); aspect-ratio: 2 / 1; display: grid; place-items: center; position: relative; overflow: hidden; }
.hull { width: 88%; height: auto; fill: none; stroke: var(--enamel); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hull .sail { fill: #fff; }
.hull .sea { stroke: #8fb0cc; stroke-dasharray: 6 5; }
.boat-pic .kind { position: absolute; left: 8px; top: 8px; }
.kind { font-size: 0.6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px 2px; border-radius: 4px; background: var(--enamel); color: #fff; }
.boat h2 { font-size: var(--t-3); font-weight: 800; }
.boat h2 small { font-size: var(--t-2); font-weight: 600; color: var(--muted); margin-left: 6px; }
.facts { display: grid; grid-template-columns: repeat(5, auto); justify-content: start; gap: 4px 18px; margin: 6px 0 12px; font-size: var(--t-1); color: var(--ink-2); }
.facts b { display: block; font-size: var(--t-2); color: var(--ink); font-weight: 800; }
.boat-price { text-align: right; display: grid; gap: 8px; justify-items: end; }
.boat-price .amount { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.boat-price .per { font-size: var(--t-1); color: var(--muted); }
.empty { padding: 40px 24px; text-align: center; background: #fff; border: 1px dashed var(--rule-strong); border-radius: var(--r-l); display: grid; gap: 12px; justify-items: center; }
.empty h2 { font-size: var(--t-3); }
.skel-row { height: 150px; }

/* Fiche bateau */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-bottom: 14px; }
.boat-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 18px; }
.boat-head h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; }
.boat-head h1 small { display: block; font-size: var(--t-3); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-l); padding: 20px; box-shadow: var(--shadow-1); min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: var(--t-3); font-weight: 800; margin-bottom: 12px; }
.hero-pic { background: #e6eef5; border-radius: var(--r-m); display: grid; place-items: center; padding: 18px 0; margin-bottom: 16px; }
.hero-pic .hull { width: min(520px, 90%); }
.facts-lg { grid-template-columns: repeat(6, auto); gap: 6px 26px; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--rule); margin: -4px 0 16px; }
.tabs button { border: 0; background: transparent; padding: 10px 14px 9px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--enamel); }
.weekgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.weekgrid .plate { width: 100%; min-height: 44px; cursor: pointer; transition: transform 140ms var(--ease-out); }
.weekgrid .plate:active { transform: scale(0.96); }
.weekgrid .plate.is-taken, .weekgrid .plate.is-hold { cursor: not-allowed; }
.month { grid-column: 1 / -1; font-size: var(--t-1); font-weight: 800; color: var(--ink-2); margin-top: 6px; }
.equip { columns: 2; gap: 24px; padding: 0; margin: 0; list-style: none; }
.equip li { display: flex; gap: 8px; align-items: center; padding: 5px 0; break-inside: avoid; }
.equip .i { color: var(--free); width: 16px; height: 16px; }
.legs { list-style: none; margin: 0; padding: 0; counter-reset: leg; }
.legs li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); counter-increment: leg; }
.legs li::before { content: "J" counter(leg); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--enamel); font-size: var(--t-1); font-weight: 800; color: var(--enamel); }
.legs .nm { font-weight: 800; }
.legs-total { margin-top: 10px; font-size: var(--t-1); color: var(--muted); }

.summary { position: sticky; top: 16px; }
.live { display: flex; align-items: center; gap: 8px; font-size: var(--t-1); font-weight: 700; padding: 8px 10px; border-radius: var(--r-s); background: var(--free-soft); color: var(--free); margin-bottom: 14px; }
.live.is-wait { background: #eef2f5; color: var(--ink-2); }
.live.is-bad { background: var(--taken-soft); color: var(--taken); }
.live.is-hold { background: var(--hold-soft); color: #5c3f00; }
.live.is-unknown { background: var(--hold-soft); color: #5c3f00; }
.live .i { width: 16px; height: 16px; }
.lines { display: grid; gap: 8px; margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.line { display: flex; justify-content: space-between; gap: 10px; font-size: var(--t-2); }
.line.total { font-weight: 800; font-size: 1.125rem; }
.note { font-size: var(--t-1); color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-weight: 700; cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--rule-strong); position: relative; cursor: pointer; transition: background-color 180ms ease; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 200ms var(--ease-out); }
.switch input:checked { background: var(--enamel); }
.switch input:checked::after { transform: translateX(18px); }
.summary .btn-go { width: 100%; margin-top: 4px; }

/* Devis */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.recap { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; padding-bottom: 14px; margin-bottom: 4px; }
.recap .boat-pic { aspect-ratio: 2 / 1; }
.recap b { display: block; font-size: 1.0625rem; }
.steps-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; }
.steps-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; position: relative; }
.steps-list li::before { content: ""; width: 14px; height: 14px; margin: 4px 7px 0; border-radius: 50%; border: 2.5px solid var(--rule-strong); background: #fff; position: relative; z-index: 1; }
.steps-list li::after { content: ""; position: absolute; left: 13px; top: 18px; bottom: 0; width: 2px; background: var(--rule); }
.steps-list li:last-child::after { display: none; }
.steps-list li.done::before { border-color: var(--free); background: var(--free); }
.steps-list li.now::before { border-color: var(--enamel); }
.steps-list b { display: block; }
.big-ref { font-size: 2rem; font-weight: 800; letter-spacing: .02em; color: var(--enamel); }
.confirm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.confirm-head .ok { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--free); color: #fff; flex: none; }
.confirm-head .ok .i { width: 26px; height: 26px; stroke-width: 2.5; }

/* Compte */
.account { max-width: 760px; }
.req { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.req:last-child { border-bottom: 0; }
.req b { font-size: 1.0625rem; }
.req .meta { font-size: var(--t-1); color: var(--muted); }
.mail-preview { margin-top: 14px; padding: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--r-m); background: #f7f9fa; font-size: var(--t-1); display: grid; gap: 8px; }

.scrim { position: fixed; inset: 0; background: rgba(12, 28, 43, .42); z-index: 40; opacity: 0; transition: opacity 260ms var(--ease-out); }
.scrim.is-on { opacity: 1; }

/* Plaquette qui bascule : le moment signature (option posée depuis le CRM) */
.plate.is-flip { animation: flip 520ms var(--ease-out); }
@keyframes flip { 0% { transform: rotateX(90deg); opacity: .4; } 100% { transform: rotateX(0); opacity: 1; } }

@media (max-width: 1080px) {
  .boat { grid-template-columns: 150px minmax(0, 1fr); }
  .boat-price { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; justify-items: start; text-align: left; border-top: 1px solid var(--rule); padding-top: 12px; }
  .boat-price .btn { justify-self: end; grid-row: 1 / 3; grid-column: 2; }
  .detail { grid-template-columns: minmax(0, 1fr) 320px; }
  .facts-lg { grid-template-columns: repeat(3, auto); }
}

@media (max-width: 900px) {
  .search { grid-template-columns: 1fr 1fr; }
  .search .btn-go { grid-column: 1 / -1; }
  .results-wrap { grid-template-columns: minmax(0, 1fr); }
  .filters-open { display: inline-flex; }
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 50;
    max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 18px 18px 0 0; padding: 8px 20px 20px; box-shadow: var(--shadow-2);
    transform: translateY(105%); visibility: hidden;
    transition: transform 420ms var(--ease-drawer), visibility 0s linear 420ms;
    touch-action: pan-y;
  }
  .filters.is-open { transform: translateY(0); visibility: visible; transition: transform 460ms var(--ease-drawer), visibility 0s; }
  .filters.is-dragging { transition: none; }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--rule-strong); margin: 4px auto 6px; }
  .sheet-close, .sheet-apply { display: inline-flex; }
  .sheet-apply { margin-top: 8px; width: 100%; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
}

@media (max-width: 620px) {
  .top { padding: 0 14px 14px; }
  .top-in { padding: 12px 0; }
  .brand small { display: none; }
  .top-nav a span { display: none; }
  .search { grid-template-columns: 1fr 1fr; padding: 10px; gap: 8px; }
  .search .sf:nth-child(1), .search .sf:nth-child(2) { grid-column: 1 / -1; }
  .view { padding: 18px 14px 6px; }
  .results-head h1 { font-size: 1.5rem; }
  .boat { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .boat-pic { aspect-ratio: 5 / 2; }
  .boat-pic .hull { width: auto; height: 92%; }
  .facts { grid-template-columns: repeat(3, auto); }
  .plates { gap: 5px; }
  .plates .plate { min-width: 0; flex: 1 1 0; padding: 5px 2px 4px; }
  .boat-head h1 { font-size: 1.75rem; }
  .facts-lg { grid-template-columns: repeat(3, auto); gap: 6px 16px; }
  .equip { columns: 1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .legend { margin-left: 0; width: 100%; }
  .source { flex-wrap: wrap; }
  .panel { padding: 16px; }
  .tabs button { padding: 10px 10px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .boat, .weekgrid .plate { transition: none; }
  .plate.is-flip { animation: none; }
  .filters, .filters.is-open { transition: visibility 0s; }
  .scrim { transition: opacity 200ms ease; }
}
