/* thomashery.fr — page d'accueil verrouillée.
   Un seul écran sur fond uni : logo centré en haut, fleur de lin au cœur (bouton de connexion),
   pied discret. Aucune ressource tierce : polices servies depuis /assets/fonts. */

@font-face {
  font-family: "Montserrat Alternates";
  font-weight: 200;
  font-display: swap;
  src: url("fonts/montserrat-alternates-200.woff2") format("woff2");
}
@font-face {
  font-family: "Dawning of a New Day";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dawning-of-a-new-day-400.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #FFFFFF;
  --ink: #0A0C0F;
  --muted: #626973;
  --line: #E4E7EB;
  --surface: #FFFFFF;
  --surface-2: #F2F4F7;
  --accent: #2E5DA8;        /* bleu des nervures du lin */
  --ok: #23804A;
  --ok-soft: #E1F2E7;
  --ko: #B3261E;
  --ko-soft: #FBE7E5;
  --scrim: rgba(10, 12, 15, 0.42);
  --flax: #7EA6E3;
  --flax-light: #B8CFF3;
  --flax-base: #F1F5FC;
  --vein: #2F5A9A;
  --heart: #F2E6AE;
  --heart-deep: #D6C062;
  --filament: #FFFFFF;
  --anther: #4F76BA;

  --font-logo: "Montserrat Alternates", "Avenir Next", "Century Gothic", sans-serif;
  --font-script: "Dawning of a New Day", "Segoe Script", "Bradley Hand", cursive;
  --font-body: "Montserrat", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --ink: #F1F3F6; --muted: #8F96A0; --line: #22262C; --surface: #0D0F12; --surface-2: #171A1F;
    --accent: #8FB4F2; --scrim: rgba(0, 0, 0, 0.72);
    --ok: #5FD08F; --ok-soft: #12291B; --ko: #F2938C; --ko-soft: #321513;
    --flax: #6E9AE0; --flax-light: #9DBDEF; --flax-base: #DDE8F9; --vein: #234A82;
    --heart: #E9D994; --heart-deep: #BCA64C; --filament: #F4F6FA; --anther: #6A8FD0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --ink: #F1F3F6; --muted: #8F96A0; --line: #22262C; --surface: #0D0F12; --surface-2: #171A1F;
  --accent: #8FB4F2; --scrim: rgba(0, 0, 0, 0.72);
  --ok: #5FD08F; --ok-soft: #12291B; --ko: #F2938C; --ko-soft: #321513;
  --flax: #6E9AE0; --flax-light: #9DBDEF; --flax-base: #DDE8F9; --vein: #234A82;
  --heart: #E9D994; --heart-deep: #BCA64C; --filament: #F4F6FA; --anther: #6A8FD0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Logo : même recette que « la badgeuse » ---------- */
.brand { margin: 0; font-size: inherit; }
.logo {
  --s: 30px;                 /* taille du sans */
  --ratio: 2.2;              /* taille du script = sans × ratio */
  display: inline-flex; align-items: baseline; white-space: nowrap; line-height: 1;
  color: var(--ink); text-decoration: none;
}
.logo .sans { font-family: var(--font-logo); font-weight: 200; font-size: var(--s); letter-spacing: -0.10em; }
.logo .script {
  font-family: var(--font-script); font-weight: 400; font-size: calc(var(--s) * var(--ratio));
  color: var(--accent); display: inline-block; line-height: 0.6;
}
.logo .after { margin-left: -0.08em; }
.logo .space { width: 0.34em; font-size: var(--s); }

/* ---------- En-tête ---------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding-top: max(26px, env(safe-area-inset-top, 0px)); padding-bottom: 10px;
}
.state {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  font: 500 12px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.state svg { width: 15px; height: 15px; }
.theme {
  justify-self: end; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--ink);
}
.theme:hover { border-color: var(--muted); }
.theme svg { width: 18px; height: 18px; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.bell[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.bell:disabled { opacity: .5; cursor: default; }

/* ---------- Fleur de lin ---------- */
.stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-block: 12px 28px;
}
.flower-btn {
  width: min(76vw, 380px); aspect-ratio: 1; max-width: 100%; padding: 0; border: 0; background: transparent;
  border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.flower-btn:focus-visible { outline-offset: -6px; border-radius: 50%; }
.flower-btn svg { width: 100%; height: 100%; display: block; overflow: visible; }

.petals { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.flower-btn:hover .petals { transform: rotate(7deg); }
.flower-btn:active .petals { transform: rotate(7deg) scale(.97); }
.petal-wrap { transform: rotate(var(--r)); animation: unfold 1.4s cubic-bezier(.2,.75,.2,1) both; animation-delay: var(--d); }
.p1 { --r: 0deg;   --d: 0ms; }
.p2 { --r: 72deg;  --d: 90ms; }
.p3 { --r: 144deg; --d: 180ms; }
.p4 { --r: 216deg; --d: 270ms; }
.p5 { --r: 288deg; --d: 360ms; }
@keyframes unfold {
  from { transform: rotate(calc(var(--r) - 24deg)) scale(.8); }
  to   { transform: rotate(var(--r)) scale(1); }
}
.stop-base { stop-color: var(--flax-base); }
.stop-light { stop-color: var(--flax-light); }
.stop-edge { stop-color: var(--flax); }
.petal-shape { fill: url(#petal-fill); stroke: var(--vein); stroke-opacity: .32; stroke-width: .7; }
.veins path { fill: none; stroke: var(--vein); stroke-width: .9; stroke-linecap: round; stroke-opacity: .62; }
.heart-1 { fill: var(--heart); }
.heart-2 { fill: var(--heart-deep); }
.stamen line { stroke: var(--filament); stroke-width: 1.7; stroke-linecap: round; }
.stamen ellipse { fill: var(--anther); }

/* ---------- Pied ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px; padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.foot .mail { user-select: all; color: var(--ink); }
.foot i { font-style: italic; }
.foot a { color: inherit; text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ---------- Mentions légales ---------- */
.back {
  justify-self: start; font-size: 14px; font-weight: 500; color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--ink); }
.legal {
  width: 100%; max-width: 68ch; margin-inline: auto; padding-block: 40px 64px;
  display: flex; flex-direction: column; gap: 36px;
}
.legal h1 { margin: 0; font: 600 30px/1.2 var(--font-body); letter-spacing: -0.01em; }
.legal section { display: flex; flex-direction: column; gap: 12px; }
.legal h2 {
  margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font: 600 13px/1.3 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.legal h3 { margin: 8px 0 0; font: 600 15px/1.4 var(--font-body); }
.legal p { color: var(--muted); }
.legal a { color: var(--accent); text-underline-offset: 3px; }
.legal .mail { color: var(--ink); user-select: all; }
.legal dl { margin: 0; display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr); gap: 6px 20px; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.legal .updated { font-size: 13px; }
@media (max-width: 520px) {
  .legal { padding-block: 24px 48px; gap: 28px; }
  .legal dl { grid-template-columns: 1fr; gap: 0; }
  .legal dd { margin-bottom: 8px; }
}

/* ---------- Tableau de bord ---------- */
.state.is-on { color: var(--ok); }
.dash {
  width: 100%; max-width: 860px; margin-inline: auto; padding-block: 28px 64px;
  display: flex; flex-direction: column; gap: 28px;
}
.dash h1 { margin: 0; font: 600 28px/1.2 var(--font-body); letter-spacing: -0.01em; }
.dash section { display: flex; flex-direction: column; gap: 12px; }
.dash h2 {
  margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font: 600 13px/1.3 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
}
.toolbar p { color: var(--muted); font-size: 14px; flex: 1 1 320px; min-width: 0; }
.toolbar b { color: var(--ink); font-weight: 600; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs a {
  flex: 1 1 auto; padding: 11px 6px; margin-bottom: -1px; text-align: center; text-decoration: none; white-space: nowrap;
  font: 600 13.5px/1.3 var(--font-body); color: var(--muted); border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.note-head b { font-weight: 600; overflow-wrap: anywhere; }
.kind {
  font: 600 11.5px/1 var(--font-body); letter-spacing: .03em; padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--accent); white-space: nowrap;
}
.note-body { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.notice { font-size: 14px; min-height: 1.4em; }
.notice:empty { display: none; }
.hint, .empty { color: var(--muted); font-size: 13.5px; }
.hint code, .entry code {
  font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere;
  background: var(--surface-2); padding: 1px 5px; border-radius: 5px;
}
.entries { display: flex; flex-direction: column; gap: 10px; }
.entry { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-top time { font: 500 13.5px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.result { font: 600 11.5px/1 var(--font-body); letter-spacing: .03em; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.result.ok { background: var(--ok-soft); color: var(--ok); }
.result.ko { background: var(--ko-soft); color: var(--ko); }
.kv { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 5px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kv dd.soft { color: var(--muted); }
.kv a { color: var(--accent); text-underline-offset: 3px; }
.entry details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.entry details code { display: block; margin-top: 6px; padding: 8px 10px; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.keys li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.keys li div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.keys li span:not(.result) { font-size: 13px; color: var(--muted); }
.types { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.types label {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.types label > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.types label > span span { font-size: 13px; color: var(--muted); }
.types input {
  appearance: none; flex: none; margin: 0; cursor: pointer; position: relative;
  width: 42px; height: 24px; border-radius: 999px; transition: background .15s;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--muted);
}
.types input::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); transition: transform .15s;
}
.types input:checked { background: var(--accent); box-shadow: none; }
.types input:checked::after { transform: translateX(18px); background: var(--bg); }
.types input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.types input:disabled { opacity: .5; cursor: default; }
.kinds { margin: 6px 0 0 14px; }
.kinds summary { cursor: pointer; padding: 6px 0; font-size: 13px; color: var(--muted); }
.kinds-family {
  margin: 10px 0 6px; font: 600 11.5px/1.3 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.kinds .types label { padding: 9px 12px; }
.kinds .types b { font-weight: 500; font-size: 14px; }
@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 6px; }
}

/* ---------- Fenêtre de connexion ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; padding: 26px 26px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.45); animation: rise .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { transform: translateY(12px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .logo { --s: 20px; margin-bottom: 4px; }
.sensor {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--accent);
}
.sensor svg { width: 36px; height: 36px; }
.sensor.wait { position: relative; }
.sensor.wait::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent);
  animation: ping 1.4s ease-out infinite;
}
@keyframes ping { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.2); opacity: 0; } }
.sensor.done { color: var(--ok); }
.sensor.error { color: var(--ko); }
.sheet h1, .sheet h2 { margin: 0; font: 600 19px/1.25 var(--font-body); }
.sheet p { color: var(--muted); font-size: 14.5px; max-width: 34ch; }
.btn {
  cursor: pointer; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { filter: brightness(1.08); }
a.btn { text-decoration: none; }
.enrol-card { animation: none; box-shadow: none; }

@media (max-width: 520px) {
  .logo { --s: 24px; }
  .top { grid-template-columns: auto 1fr auto; }
  .state span { display: none; }
  .foot { flex-direction: column; }
}
