@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&family=Big+Shoulders+Display:wght@800;900&display=swap');

:root {
  --ink: #1B2420; --ink-2: #3A443F; --muted: #4E5852; --ground: #F3F1EA; --card: #FFFFFF;
  --line: #E2DED3; --line-2: #CFCABD; --dark: #1B2420; --night: #0F1A16; --on-dark: #F3F1EA; --on-dark-2: #C9D2CC;
  --accent: #C2410C; --accent-hot: #FF5A1F; --accent-soft: #FBE9DF; --green: #2F5D50; --green-soft: #DDE7E1;
  --warn: #B45309; --bad: #B91C1C; --radius: 18px;
  --display: 'Space Grotesk', system-ui, sans-serif; --body: 'Inter', system-ui, sans-serif; --hand: 'Caveat', cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--ink); background: var(--ground); line-height: 1.45; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--display); font-size: clamp(30px, 4vw, 40px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.topbar { background: var(--dark); color: var(--on-dark); }
.topbar .container { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
/* Nom de marque : minuscules, très gras, lettres serrées */
.wordmark { font: 800 25px/1 var(--body); letter-spacing: -0.065em; padding-right: .06em; }
#logo .wordmark { font-size: 30px; }
.logo svg { flex-shrink: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { padding: 10px 14px; border-radius: 8px; color: var(--on-dark-2); text-decoration: none; font-size: 14px; }
.nav a.on, .nav a:hover { background: #2C3631; color: #FFF; }
.who { font-size: 13px; color: var(--on-dark-2); display: flex; gap: 10px; align-items: center; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 20px; background: var(--accent-hot); color: var(--night); }

/* Points avec assistance (profil, tableaux) */
.assist-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1D5A8C; margin-right: 8px; vertical-align: 1px; }
.plain-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #C2410C; margin-right: 6px; vertical-align: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
button.linkish { background: none; border: none; padding: 4px 0; font: 700 14px var(--body); color: var(--ink); cursor: pointer; text-align: left; text-decoration: underline dotted var(--line-2); text-underline-offset: 4px; }
button.linkish:hover { text-decoration-color: var(--accent); }

/* Onglets d'une course */
.ctabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.ctabs a { flex-shrink: 0; padding: 12px 14px 10px; font: 600 14px var(--body); color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ctabs a:hover { color: var(--ink); }
.ctabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Blocs */
main.page { padding: 28px 0 56px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px 24px; }
.card.dark { background: var(--dark); color: var(--on-dark); }
.card.dark .muted { color: var(--on-dark-2); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .main { flex: 999 1 640px; min-width: 0; }
.cols > .side { flex: 1 1 320px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--min, 240px), 1fr)); gap: var(--gap, 16px); }

/* Boutons et champs */
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); background: #FFF; color: var(--ink); font: 600 14px var(--body); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #FFF; }
.btn.primary:hover { background: #A3360A; }
.btn.hot { background: var(--accent-hot); border-color: var(--accent-hot); color: var(--night); font-weight: 700; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #FFF; }
.btn.ghost-dark { background: transparent; border-color: #4E5852; color: var(--on-dark); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); padding: 0 12px; font: 400 15px var(--body); color: var(--ink); background: #FFF; width: 100%;
}
textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
select.film-place { width: 100%; min-height: 34px; padding: 4px 8px; font-size: 13px; font-weight: 700; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=range] { accent-color: var(--accent); width: 100%; height: 28px; margin: 0; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: #FFF; border: 1px solid var(--line-2); border-radius: 12px; }
.seg a, .seg button { min-height: 38px; padding: 0 14px; border-radius: 9px; border: none; background: transparent; font: 500 14px var(--body); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.seg .on { background: var(--dark); color: #FFF; font-weight: 600; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert.ok { background: var(--green-soft); color: #1F3D35; }
.alert.warn { background: var(--accent-soft); color: #7C2D12; }
.alert.bad { background: #FDE2E2; color: #7F1D1D; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.plan { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 980px; }
table.plan th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #ECE9E0; padding: 10px 10px; }
table.plan td { padding: 10px; border-top: 1px solid #ECE9E0; vertical-align: middle; }
table.plan input[type=text], table.plan input[type=number], table.plan input[type=time] { min-height: 36px; font-size: 14px; padding: 0 8px; }
.strong { font-weight: 700; }
.time { font-family: var(--display); font-weight: 700; font-size: 15px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 18px; }
.big { font-family: var(--display); font-size: 48px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }

/* Profil */
svg.profile { width: 100%; height: auto; display: block; }

/* Post-it */
.board { background: #E7E1D3; }
.postits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 28px; padding: 8px 4px; }
.postit { position: relative; padding: 16px 16px 12px; min-height: 360px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 18px rgba(40,32,16,.16), 0 2px 3px rgba(40,32,16,.12); }
.postit::before { content: ''; position: absolute; top: -12px; left: 50%; width: 96px; height: 26px; margin-left: -48px; background: rgba(255,255,255,.55); transform: rotate(-3deg); }
.postit .place { font-family: var(--hand); font-size: 32px; line-height: 1; font-weight: 700; }
.postit .line { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--hand); line-height: 1.1; }
.postit .line span:first-child { font-size: 22px; color: #3A3524; }
.postit .line span:last-child { font-size: 28px; font-weight: 700; }
.postit .main-time { font-size: 50px; font-weight: 700; line-height: 1; padding: 0 10px; border: 3px solid var(--accent); border-radius: 48% 52% 46% 54% / 58% 44% 56% 42%; color: #9A3412; font-family: var(--hand); }
.postit .note { flex: 1; margin-top: 22px; padding-top: 12px; border-top: 1px solid rgba(58,53,36,.2); display: flex; flex-direction: column; gap: 4px; }
.postit .note p { font-family: var(--hand); font-size: 22px; line-height: 26px; background-image: repeating-linear-gradient(transparent 0 25px, rgba(58,53,36,.22) 25px 26px); min-height: 104px; white-space: pre-line; }
.postit { transition: outline-color .15s; outline: 4px solid transparent; outline-offset: 6px; }
.postit.is-near { outline-color: var(--accent); }
tr.is-near td { background: var(--accent-soft); }
.postit .note textarea { font-family: var(--hand); font-size: 22px; line-height: 26px; min-height: 104px; padding: 0; border: none; border-radius: 0; resize: none; color: inherit; background: transparent repeating-linear-gradient(transparent 0 25px, rgba(58,53,36,.22) 25px 26px); }
.postit .note textarea:focus-visible { outline: 2px dashed rgba(58,53,36,.45); outline-offset: 4px; }
.postit .note textarea::placeholder { color: rgba(58,53,36,.45); }
.tag { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.tag.ok { background: var(--dark); color: #FFF; }
.tag.no { background: rgba(27,36,32,.12); color: #3A3524; }

/* Landing */
.hero { background: var(--night); color: #F4F1E8; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(48px, 7vw, 86px); line-height: .98; letter-spacing: -0.04em; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--dark); display: flex; align-items: center; justify-content: center; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }

/* Impression (export PDF) */
@media print {
  .topbar, .no-print, .footer { display: none !important; }
  body { background: #FFF; }
  .card { padding: 8px 0; }
  table.plan { min-width: 0; font-size: 11px; }
  input[type=range] { display: none; }
}

/* Pages légales */
.legal-doc { max-width: 820px; padding-bottom: 64px; line-height: 1.65; }
.legal-doc h1 { margin-bottom: 6px; }
.legal-doc h2 { font: 700 21px/1.3 var(--display); margin: 34px 0 10px; scroll-margin-top: 20px; }
.legal-doc p, .legal-doc ul { margin: 0 0 12px; }
.legal-doc ul { padding-left: 20px; }
.legal-doc a { color: var(--accent); }
.legal-doc [data-pro], .legal-doc [data-perso] { display: none; }
.legal-doc.pro [data-pro], .legal-doc.perso [data-perso] { display: revert; }
.legal-doc .todo { background: #FFE97A; padding: 0 4px; border-radius: 3px; font-weight: 600; color: #7C2D12; }
.legal-toc { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 18px 0 8px; padding: 14px 18px; background: #FFF; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.legal-toc a { text-decoration: none; }
.legal-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; background: #FFF; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-table th { background: #ECE9E0; font-size: 13px; }
.legal-box { padding: 16px 20px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #FFF; }
.footer a { color: inherit; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #FFF; border-color: var(--line-2); font-weight: 600; }
.or-sep { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.consent input { margin-top: 2px; flex-shrink: 0; }
.consent a { color: var(--accent); }

/* Accueil : captures d'écran de l'application */
.shot-row, .phone-row { margin: 0; display: flex; flex-direction: column; gap: 18px; }
.shot-row figcaption { max-width: 760px; }
.shot-row figcaption strong, .phone-row figcaption strong { font: 700 22px/1.2 var(--display); letter-spacing: -.01em; }
.shot { border-radius: 16px; overflow: hidden; background: #FFF; border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(15,26,22,.28), 0 2px 6px rgba(15,26,22,.06); }
.shot-bar { display: flex; align-items: center; gap: 7px; padding: 11px 16px; background: #ECE9E0; border-bottom: 1px solid var(--line); }
.shot-bar i { width: 11px; height: 11px; border-radius: 50%; background: #D3CEC2; }
.shot-bar i:first-child { background: #FF5A1F; }
.shot-bar span { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.shot img { display: block; width: 100%; height: auto; }
.phone { align-self: center; width: min(100%, 320px); padding: 10px; border-radius: 42px; background: #0F1A16; box-shadow: 0 30px 60px -20px rgba(15,26,22,.4); }
.phone img { display: block; width: 100%; height: auto; border-radius: 32px; }
.phone-row figcaption { text-align: center; align-items: center; max-width: 420px; align-self: center; }

/* Fiche PDF du plan de course (A4 paysage) */
#print-sheet { display: none; }
@media print {
  body.printing { background: #FFF; }
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing #print-sheet { display: block; }
}
#print-sheet { font-family: var(--body); color: var(--ink); font-size: 8.4pt; line-height: 1.3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Bandeau nuit façon affiche de course */
#print-sheet .ps-hero { position: relative; background: #0F1A16; color: #F3F1EA; border-radius: 10px; padding: 14px 18px 8px; overflow: hidden; break-inside: avoid;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(255,90,31,.18), transparent 55%), radial-gradient(90% 80% at 0% 100%, rgba(47,93,80,.55), transparent 60%); }
#print-sheet .ps-ribbon { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(-45deg, #FF5A1F 0 7px, #F3F1EA 7px 14px); }
#print-sheet .ps-top { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
#print-sheet .ps-brand { display: flex; align-items: center; gap: 6px; font: 700 11pt var(--display); letter-spacing: -.01em; }
#print-sheet .ps-brand .wordmark { font-size: 15pt; color: #FFF; }
#print-sheet .ps-brand span:not(.wordmark) {font: 600 7pt var(--body); color: #8FA39A; margin-left: 6px; padding-left: 8px; border-left: 1px solid rgba(243,241,234,.25); text-transform: uppercase; letter-spacing: .14em; }
#print-sheet .ps-date { font-size: 7.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: #C9D2CC; }
#print-sheet .ps-mid { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 10px; }
#print-sheet .ps-runner { margin: 0 0 2px; font: 600 8pt var(--body); text-transform: uppercase; letter-spacing: .14em; color: #FF5A1F; }
#print-sheet .ps-title h1 { font: 700 30pt/.95 var(--display); letter-spacing: -.03em; margin: 0; color: #FFF; }
#print-sheet .ps-total { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
#print-sheet .ps-total span { font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: #8FA39A; }
#print-sheet .ps-total b { font: 700 30pt/1 var(--display); letter-spacing: -.03em; color: #FF5A1F; }
#print-sheet .ps-total small { font-size: 8pt; color: #C9D2CC; margin-top: 2px; }
#print-sheet .ps-stats { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 10px; border-top: 1px solid rgba(243,241,234,.16); border-bottom: 1px solid rgba(243,241,234,.16); }
#print-sheet .ps-stat { display: flex; flex-direction: column; padding: 6px 10px; }
#print-sheet .ps-stat:first-child { padding-left: 0; }
#print-sheet .ps-stat + .ps-stat { border-left: 1px solid rgba(243,241,234,.16); }
#print-sheet .ps-stat span { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #8FA39A; }
#print-sheet .ps-stat b { font: 700 12pt/1.2 var(--display); color: #FFF; margin-top: 1px; }
#print-sheet .ps-stat small { font-size: 7pt; color: #C9D2CC; }
#print-sheet .ps-profile { margin: 4px -4px 0; }
#print-sheet .ps-legend { display: flex; gap: 16px; font-size: 7pt; color: #8FA39A; margin-top: 2px; }
#print-sheet .ps-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; box-sizing: border-box; }
/* Tableau des passages */
#print-sheet .ps-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 8px; }
#print-sheet .ps-table thead { display: table-header-group; }
#print-sheet .ps-table th { text-align: left; vertical-align: bottom; font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 4px 5px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
#print-sheet .ps-table th em { display: block; font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 6.5pt; color: #8A918C; }
#print-sheet .ps-table td { padding: 4px 4px; border-bottom: 1px solid #ECE9E0; vertical-align: middle; }
#print-sheet .ps-table tr { break-inside: avoid; }
#print-sheet .ps-table tr.ps-assist td { background: #EEF4F9; }
#print-sheet .ps-table tr.ps-assist td:first-child { box-shadow: inset 3px 0 0 #1D5A8C; }
#print-sheet .ps-r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#print-sheet .ps-num { width: 1%; padding-left: 7px !important; }
#print-sheet .ps-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink); color: var(--ink); font: 700 7.5pt var(--display); }
#print-sheet .ps-badge.a { background: #1D5A8C; border-color: #1D5A8C; color: #FFF; }
#print-sheet .ps-name { font: 700 9pt var(--display); min-width: 40mm; }
#print-sheet .ps-name small { display: block; font: 600 6.8pt var(--body); color: #1D5A8C; }
#print-sheet .ps-km { font: 700 9pt var(--display); }
#print-sheet .ps-up { color: #C2410C; font-weight: 600; }
#print-sheet .ps-down { color: var(--green); font-weight: 600; }
#print-sheet .ps-time { font: 700 10.5pt var(--display); white-space: nowrap; letter-spacing: -.01em; }
#print-sheet .ps-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 7.3pt; font-weight: 700; white-space: nowrap; }
#print-sheet .ps-pill.ok { background: #DDE7E1; color: #2F5D50; }
#print-sheet .ps-pill.bad { background: #F8DCD3; color: #B91C1C; }
#print-sheet .ps-nut { white-space: nowrap; }
#print-sheet .ps-flasks { display: inline-flex; gap: 1.5px; margin-left: 4px; vertical-align: -1px; font-size: 7pt; color: #1D5A8C; font-weight: 700; align-items: center; }
#print-sheet .ps-note { font-size: 7.3pt; color: var(--ink-2); width: 40mm; overflow-wrap: anywhere; }
#print-sheet .ps-mute { color: var(--muted); }
#print-sheet .ps-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 6.6pt; color: var(--muted); }
#print-sheet .ps-mini-ribbon { flex: 0 0 34px; height: 5px; border-radius: 3px; background: repeating-linear-gradient(-45deg, #FF5A1F 0 4px, #F3F1EA 4px 8px); }
#print-sheet .ps-sign { margin-left: auto; display: flex; align-items: center; gap: 4px; white-space: nowrap; font: 700 7.5pt var(--display); color: var(--ink); }
#print-sheet .ps-sign svg { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .card { padding: 16px; }
  .big { font-size: 40px; }
}
