/* ============================================================================
   Rettel Nautique — Feuille de style (mobile-first, colonne centrée)
   Palette : bleu marine #1a2d4a · or #C8922A / #F5C842 · bleu ciel #2B5FA8
   ============================================================================ */

:root {
  --navy:        #1a2d4a;
  --navy-soft:   #243a5e;
  --gold:        #C8922A;
  --gold-light:  #F5C842;
  --sky:         #2B5FA8;
  --sky-light:   #e7eefb;
  --ink:         #1b2433;
  --muted:       #5d6b80;
  --bg:          #eef1f6;
  --card:        #ffffff;
  --line:        #e2e7f0;
  --ok:          #2e9e5b;
  --ok-bg:       #e6f6ec;
  --warn:        #c9871b;
  --warn-bg:     #fcf3e1;
  --bad:         #cf4040;
  --bad-bg:      #fbe9e9;
  --radius:      16px;
  --shadow:      0 4px 18px rgba(26, 45, 74, .08);
  --maxw:        440px;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  line-height: 1.45;
}

/* Colonne centrée façon mobile, utilisable sur desktop ----------------------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(26, 45, 74, .07);
}
.app.has-nav .content { padding-bottom: 78px; }

@media (min-width: 460px) {
  body { padding: 0; background: #dfe4ee; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* Bandeau supérieur ---------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 3px solid var(--gold);
}
.topbar__logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overFlow: hidden;
    background: #fff;
    flex-shrink: 0;
    border: 2px solid var(--gold);
}
.topbar__name { font-weight: 800; font-size: 1.12rem; letter-spacing: .2px; }
.topbar__affil { font-size: .68rem; color: var(--gold-light); margin-top: 2px; line-height: 1.25; }

/* Contenu -------------------------------------------------------------------- */
.content { flex: 1; padding: 16px; }
.content > h2.section,
h2.section {
  font-size: 1.05rem;
  margin: 18px 4px 8px;
  color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
h2.section:first-child { margin-top: 4px; }

/* Bulles (cartes) ------------------------------------------------------------ */
.bubble {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.bubble--accent { border-left: 4px solid var(--gold); }

/* Bandeau de navigation (pied) ---------------------------------------------- */
.bottomnav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(26,45,74,.06);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .68rem;
  font-weight: 600;
}
.bottomnav__item.is-active { color: var(--gold); }
.bottomnav__item.is-active svg { color: var(--gold); }

/* Boutons -------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: .98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, background .15s;
}
.btn:active { filter: brightness(.94); }
.btn--primary { background: var(--navy); color: #fff; }
.btn--gold    { background: var(--gold); color: #fff; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn--sky     { background: var(--sky); color: #fff; }
.btn--ghost   { background: var(--sky-light); color: var(--sky); }
.btn--outline { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn--danger  { background: var(--bad-bg); color: var(--bad); }
.btn + .btn { margin-top: 10px; }
.btn--sm { width: auto; padding: 8px 12px; font-size: .85rem; border-radius: 9px; }

/* Formulaires ---------------------------------------------------------------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.input, input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=date], input[type=number], textarea, select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: .98rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.4;
  min-height: 44px;
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-light);
}
input[type=date] {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
}
textarea { resize: vertical; min-height: 80px; }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1 1 0; min-width: 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }

/* Authentification ----------------------------------------------------------- */
.auth-wrap { padding: 22px 18px 30px; }
.auth-hero { text-align: center; margin-bottom: 18px; }
.auth-hero h1 { font-size: 1.5rem; margin: 6px 0 4px; color: var(--navy); font-weight: 800; }
.auth-hero p  { color: var(--muted); margin: 0; font-size: .92rem; }
.join-cta { text-align: center; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.alert {
  border-radius: 11px; padding: 11px 13px; font-size: .88rem; margin-bottom: 14px;
}
.alert--err { background: var(--bad-bg); color: var(--bad); }
.alert--ok  { background: var(--ok-bg);  color: var(--ok); }
.alert--info{ background: var(--sky-light); color: var(--sky); }
.alert--warn{ background: var(--warn-bg); color: var(--warn); }

/* Accueil : entête membre + stats ------------------------------------------- */
.greet { margin-bottom: 6px; }
.greet h1 { font-size: 1.35rem; margin: 0; color: var(--navy); }
.greet .formule { color: var(--muted); font-size: .9rem; }
.stats { display: flex; gap: 10px; margin: 12px 0 4px; }
.stat {
  flex: 1; background: var(--card); border-radius: 14px; padding: 0px; height: 52px;
  text-align: center; box-shadow: var(--shadow);
}
.stat .n { font-size: 1.5rem; font-weight: 800; color: var(--sky); }
.stat .l { font-size: .72rem; color: var(--muted); }

/* Bloc conditions de navigation --------------------------------------------- */
.cond-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cond-head .icon-wrap { color: var(--sky); }
.cond-head .temp { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.cond-head .desc { font-size: .85rem; color: var(--muted); }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric {
  display: flex; align-items: center; gap: 9px;
  background: var(--sky-light); border-radius: 11px; padding: 9px 11px;
}
.metric svg { color: var(--sky); flex: 0 0 auto; }
.metric .mv { font-weight: 700; font-size: .95rem; }
.metric .ml { font-size: .68rem; color: var(--muted); }
.cond-banner {
  margin-top: 12px; border-radius: 11px; padding: 10px 13px;
  font-weight: 700; font-size: .92rem; text-align: center;
}
.cond-banner.ok   { background: var(--ok-bg);   color: var(--ok); }
.cond-banner.warn { background: var(--warn-bg); color: var(--warn); }
.cond-banner.bad  { background: var(--bad-bg);  color: var(--bad); }
.updated { font-size: .72rem; color: var(--muted); text-align: right; margin-top: 8px; }

/* Prévision 5 jours ---------------------------------------------------------- */
.forecast-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.forecast-row:last-child { border-bottom: none; }
.forecast-row .fday { flex: 0 0 84px; font-weight: 700; font-size: .9rem; }
.forecast-row .fico { flex: 0 0 auto; color: var(--sky); }
.forecast-row .ftemp { flex: 1; font-size: .92rem; }
.forecast-row .ftemp b { color: var(--navy); }
.forecast-row .ftemp .min { color: var(--muted); }
.forecast-row .fwind { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .85rem; }
.forecast-row .fwind svg { color: var(--sky); }

/* Activités praticables ------------------------------------------------------ */
.sport {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.sport:last-child { border-bottom: none; }
.sport .sico { flex: 0 0 auto; color: var(--navy); }
.sport .sbody { flex: 1; min-width: 0; }
.sport .sname { font-weight: 700; font-size: .95rem; }
.sport .ssum { font-size: .76rem; color: var(--muted); }
.badge {
  flex: 0 0 auto; border-radius: 20px; padding: 4px 11px;
  font-size: .76rem; font-weight: 800;
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad  { background: var(--bad-bg);  color: var(--bad); }

/* Squelette de chargement (animation "mise à jour") -------------------------- */
.skeleton { position: relative; overflow: hidden; }
.loading-note {
  display: flex; align-items: center; gap: 9px;
  color: var(--sky); font-size: .88rem; padding: 6px 2px;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--sky-light); border-top-color: var(--sky);
  animation: spin .8s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.shimmer {
  height: 14px; border-radius: 7px; margin: 8px 0;
  background: linear-gradient(90deg, #eef1f6 25%, #e2e7f0 37%, #eef1f6 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Calendrier maison ---------------------------------------------------------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head button {
  background: var(--sky-light); border: none; color: var(--sky); font-weight: 800;
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1.1rem;
}
.cal-title { font-weight: 800; color: var(--navy); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .68rem; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.cal-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .82rem; cursor: default; position: relative; background: #fff;
  transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease, background .12s ease;
}
.cal-cell.empty { border: none; background: transparent; }
.cal-cell.has-libre   { border-color: var(--ok);   cursor: pointer; }
.cal-cell.has-pris    { border-color: var(--bad);  background: var(--bad-bg); }
.cal-cell.has-pending { border-color: var(--gold); background: var(--warn-bg); cursor: pointer; }
.cal-cell.has-event   { border-color: var(--sky); }
.cal-cell .dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 3px; }
.cal-cell .dot.libre   { background: var(--ok); }
.cal-cell .dot.pris    { background: var(--bad); }
.cal-cell .dot.pending { background: var(--gold); }
.cal-cell .dot.event   { background: var(--sky); }

/* Jours passés : grisés et estompés. */
.cal-cell.is-past { color: var(--muted); background: #f4f6fa; opacity: .5; }

/* Effet de survol sur les jours interactifs (ni vides, ni passés). */
.cal-cell:not(.empty):not(.is-past):hover {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--sky-light);
  transform: translateY(-1px);
  cursor: pointer;
}

/* « Aujourd'hui » bien marqué (anneau bleu + halo + fond teinté). */
.cal-cell.is-today {
  box-shadow: 0 0 0 2px var(--sky) inset, 0 3px 10px rgba(43, 95, 168, .50);
  background: #e7eefb;
  font-weight: 800;
}
.cal-cell.is-today::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 3px; border-radius: 2px; background: var(--sky);
}
.cal-legend { display: flex; gap: 14px; margin-top: 10px; font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Détail des créneaux / événements d'un jour -------------------------------- */
.day-detail { margin-top: 12px; }
.slot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px;
}
.slot .sl-when { font-weight: 700; font-size: .9rem; }
.slot .sl-meta { font-size: .76rem; color: var(--muted); }

/* Documents ------------------------------------------------------------------ */
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; text-decoration: none; color: var(--ink);
}
.doc-item:active { background: var(--sky-light); }
.doc-item .di-ico { color: var(--bad); flex: 0 0 auto; }
.doc-item .di-name { flex: 1; font-weight: 600; font-size: .9rem; }
.doc-item .di-dl { color: var(--sky); flex: 0 0 auto; }
.search-box { display: flex; align-items: center; gap: 8px; }
.search-box svg { color: var(--muted); flex: 0 0 auto; }

/* Profil --------------------------------------------------------------------- */
.profile-name { font-size: 1.25rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.pf-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.pf-row:last-child { border-bottom: none; }
.pf-row .pf-l { font-size: .74rem; color: var(--muted); font-weight: 700; }
.pf-row .pf-v { font-size: .96rem; }

/* Demande d'adhésion : sélecteur de formule --------------------------------- */
.formule-pick { display: flex; gap: 10px; }
.formule-opt {
  flex: 1; border: 2px solid var(--line); border-radius: 14px; padding: 14px 10px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.formule-opt.is-sel { border-color: var(--gold); background: var(--warn-bg); }
.formule-opt .fo-t { font-weight: 800; color: var(--navy); }
.formule-opt .fo-p { font-size: .82rem; color: var(--muted); margin-top: 3px; }

/* Tarifs bateau -------------------------------------------------------------- */
.price-line { display: flex; align-items: baseline; justify-content: space-between; padding: 7px 0; }
.price-line .pl-amt { font-weight: 800; color: var(--gold); font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* Admin ---------------------------------------------------------------------- */
.admin-bar {
  background: var(--navy); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-bar a { color: var(--gold-light); text-decoration: none; font-size: .85rem; }
.admin-tabs { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.admin-tabs a {
  padding: 8px 12px; border-radius: 10px 10px 0 0; text-decoration: none;
  background: #fff; color: var(--muted); font-size: .85rem; font-weight: 700;
}
.admin-tabs a.is-active { background: var(--sky); color: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-size: .74rem; text-transform: uppercase; }
.actions-inline { display: flex; gap: 6px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: .72rem; font-weight: 700; }
.tag.admin { background: var(--warn-bg); color: var(--warn); }
.tag.membre{ background: var(--sky-light); color: var(--sky); }
.tag.libre { background: var(--ok-bg); color: var(--ok); }
.tag.pris  { background: var(--bad-bg); color: var(--bad); }
.tag.pending { background: var(--warn-bg); color: var(--warn); }

/* Divers --------------------------------------------------------------------- */
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden { display: none !important; }
a.link { color: var(--sky); }
