/* ═══════════════════════════════════════════════════════════════
   GASPARD — socle graphique commun aux applis (Bureau, Recettes)
   Direction « éditoriale » (28/11/2026), inspirée de la proposition sur-mesure :
   crème #FAF8F5, encre #1B1B1B, jaune #FDC516 ; titres Poppins 800,
   sous-titres en italique Lora, texte Inter ; [ crochets ] jaunes ;
   angles droits, un seul cadre noir de 2 px par bloc, filets fins ailleurs.
   ═══════════════════════════════════════════════════════════════ */

@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/shared/fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 800; font-display: swap; src: url("/shared/fonts/poppins-800.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400 500; font-display: swap; src: url("/shared/fonts/lora-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/shared/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/shared/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/shared/fonts/inter-600.woff") format("woff"); }

:root {
  --cream: #FAF8F5;
  --paper: #FFFFFF;
  --sand: #F1EEE8;
  --ink: #1B1B1B;
  --ink-2: rgba(27, 27, 27, 0.64);
  --ink-3: rgba(27, 27, 27, 0.34);
  --hair: rgba(27, 27, 27, 0.10);
  --line: rgba(27, 27, 27, 0.22);
  --muted: #6B665E;
  --yellow: #FDC516;
  --yellow-soft: rgba(253, 197, 22, 0.30);
  --red: #C62828;

  --display: "Poppins", "Montserrat", "Arial Black", sans-serif;
  --text: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;

  --border: 2px solid var(--ink);
  --pad: 16px;
  --maxw: 720px;
  --tabbar-h: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/24px var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ── Typo de marque ───────────────────────────── */
.caps { font-family: var(--display); text-transform: uppercase; }
.bracket {                     /* [ TITRE ] : crochets jaunes, comme les rubriques de la proposition */
  display: inline-block;
  margin: 0;
  font: 800 26px/34px var(--display);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.bracket::before { content: "[\2009"; color: var(--yellow); }
.bracket::after { content: "\2009]"; color: var(--yellow); }
.italic { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }
.label {
  font: 600 11px/16px var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ── Boutons & champs ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px;
  border: 0; background: var(--yellow); color: var(--ink);
  font: 800 13px/16px var(--display); letter-spacing: 1px; text-transform: uppercase;
}
.btn:active { filter: brightness(0.94); }
.btn:disabled { background: #CFC9BF; color: var(--ink-2); cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:active { background: var(--sand); }
.btn-dark { background: var(--ink); color: var(--yellow); }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; }
.input, .field input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); background: var(--paper);
  font: 400 16px/24px var(--text); outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow-soft); }

.form-error { margin: 0 0 16px; font: 500 14px/20px var(--text); color: var(--red); }
.form-error:empty { display: none; }

.close-btn {                   /* bouton rond noir à croix jaune, comme les fenêtres du site */
  width: 36px; height: 36px; border: 0; border-radius: 50% !important;
  background: var(--ink); color: var(--yellow);
  display: grid; place-items: center; flex: none;
}
.close-btn svg { width: 18px; height: 18px; stroke-width: 2.5; }

/* Icônes Lucide : trait de 2 px, bouts et angles arrondis */
svg.lucide { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.star-fill { fill: currentColor; }
.stars { display: inline-flex; align-items: center; gap: 1px; }
.stars svg { width: 14px; height: 14px; }

/* ── Connexion ────────────────────────────────── */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 360px; }
.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand img { width: 88px; height: 88px; display: block; margin: 0 auto 22px; }
.login-brand .bracket { font-size: 26px; line-height: 34px; }
.login-brand p { margin: 10px 0 0; font: italic 400 16px/24px var(--serif); color: var(--muted); }

/* ── Barre du haut ────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--cream);
  padding-top: env(safe-area-inset-top);
  transition: box-shadow .2s;
}
.topbar.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; height: 56px;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand img { width: 30px; height: 30px; }
.topbar-brand .label { font: 700 12px/16px var(--display); letter-spacing: 1.6px; color: var(--ink); }
.square-btn {
  width: 40px; height: 40px; border: 0; background: var(--ink); color: var(--yellow);
  display: grid; place-items: center;
}
.square-btn svg { width: 20px; height: 20px; }

/* ── Page ─────────────────────────────────────── */
.page {
  max-width: var(--maxw); margin: 0 auto;
  padding: 8px max(var(--pad), env(safe-area-inset-right)) calc(var(--tabbar-h) + 48px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
}
.page-head { margin: 8px 0 20px; text-align: center; }
.page-head p { margin: 6px 0 0; font: italic 400 15px/22px var(--serif); color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; background: var(--paper); border: var(--border); }
.empty .label { display: block; margin-bottom: 10px; color: var(--ink); font: 800 15px/20px var(--display); letter-spacing: 0.4px; }
.empty p { margin: 0 auto; max-width: 340px; font: italic 400 15px/23px var(--serif); color: var(--muted); }

/* ── Barre d'onglets : noire, l'onglet actif en jaune ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--ink);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tabbar-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tab {
  position: relative; height: var(--tabbar-h);
  border: 0; background: transparent; color: rgba(250, 248, 245, 0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 600 11px/14px var(--text); letter-spacing: 0.3px;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--yellow); }

/* ── Liste type « carte » : un cadre noir, des filets fins dedans ── */
.section-label { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 8px; }
.section-label span + span { color: var(--ink-3); }
.card { background: var(--paper); border: var(--border); }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 60px; padding: 12px 16px;
  border: 0; background: transparent; text-align: left;
}
.row + .row { border-top: 1px solid var(--hair); }
.row:active { background: var(--sand); }

/* ── Feuille (fiche) ──────────────────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(27, 27, 27, 0.5); animation: fade .2s ease; }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0;
  top: calc(env(safe-area-inset-top) + 16px);
  display: flex; flex-direction: column;
  background: var(--cream); border-top: var(--border);
  animation: rise .32s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 760px) {
  .sheet { top: 5vh; bottom: 5vh; left: 50%; right: auto; width: 600px; transform: translateX(-50%); border: var(--border); animation: pop .2s ease; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }
.sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px 20px;
}
.sheet-head .bracket { font-size: 19px; line-height: 28px; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 20px 24px; }
.sheet-foot {
  flex: none; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--cream);
}

/* ── Toast ────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; z-index: 30;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 12px 18px; background: var(--ink); color: var(--cream);
  font: 800 12px/16px var(--display); letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.toast::before { content: "[ "; color: var(--yellow); }
.toast::after { content: " ]"; color: var(--yellow); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Compte ───────────────────────────────────── */
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.kv + .kv { border-top: 1px solid var(--hair); }
.kv span:last-child { color: var(--ink-2); text-align: right; font-size: 15px; }
.kv .label { flex: none; padding-top: 2px; }
.account-actions { margin-top: 32px; }

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

/* ── Majuscules comme sur gaspard-tours.fr (28/11) ── */
.tab { font: 700 10.5px/14px var(--display); letter-spacing: 0.6px; text-transform: uppercase; }
.empty .label, .sheet-empty .label { text-transform: uppercase; }

/* ── Accès aux applis (page Compte de la direction) et écran d'invitation ── */
.btn svg { width: 18px; height: 18px; flex: none; }
.access-hint, .invite-note { margin: 0 0 12px; font: italic 400 14px/21px var(--serif); color: var(--muted); }
.access-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.access-row + .access-row, .access-editor + .access-row { border-top: 1px solid var(--hair); }
.access-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.access-name { font: 700 14px/19px var(--display); text-transform: uppercase; letter-spacing: 0.2px; }
.access-sum { font: italic 400 13px/18px var(--serif); color: var(--muted); overflow-wrap: anywhere; }
.access-link {
  flex: none; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); background: var(--paper);
  font: 700 11px/16px var(--display); letter-spacing: 0.5px; text-transform: uppercase;
}
.access-invite { margin-top: 16px; }
.access-editor { padding: 14px 16px 16px; background: var(--sand); border-top: 1px solid var(--hair); }
.access > .access-editor, .access > div > .access-editor { margin-top: 16px; border: var(--border); background: var(--paper); }
.access-editor > .label { display: block; margin-bottom: 10px; }
.acc-app { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.acc-app + .acc-app { border-top: 1px solid var(--hair); }
.acc-app-name { font: 700 12.5px/16px var(--display); letter-spacing: 0.4px; text-transform: uppercase; }
.acc-seg { display: flex; gap: 4px; flex: none; }
.acc-seg button {
  min-height: 36px; padding: 0 9px; border: 1px solid var(--line); background: var(--paper); color: #4A463F;
  font: 700 11px/14px var(--display); letter-spacing: 0.3px; text-transform: uppercase;
}
.acc-seg button.is-on { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.acc-costs { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hair); }
.acc-costs small { display: block; margin-top: 2px; font: italic 400 13px/18px var(--serif); color: var(--muted); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.acc-actions .btn { flex: 1 1 auto; height: 44px; padding: 0 16px; }
.invite-result { margin-top: 12px; }
.invite-url { font: 400 13px/20px var(--text); }
#invite-form .invite-note { text-align: center; margin-bottom: 20px; }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 50px; height: 28px; border: 1.5px solid var(--ink); background: var(--paper); position: relative; cursor: pointer;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--ink-3); transition: transform .15s, background .15s; }
.switch:checked { background: var(--yellow); }
.switch:checked::after { transform: translateX(22px); background: var(--ink); }
.link-danger {
  display: block; margin: 20px auto 0; padding: 8px; border: 0; background: transparent; color: var(--red);
  font: 600 13px/16px var(--text); text-decoration: underline; text-underline-offset: 4px;
}
.link-danger.is-confirm { width: 100%; min-height: 48px; background: var(--red); color: #fff; text-decoration: none; }
@media (max-width: 380px) {
  .acc-app { flex-wrap: wrap; }
  .acc-seg { width: 100%; }
  .acc-seg button { flex: 1; }
}
