/* Tamewall design tokens and shared components, from the mockups
   (Maquettes Tamewall, 18 octobre 2026). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-grotesque-latin-78692770.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage-grotesque-latin-ext-2186fff6.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/figtree-latin-f7c28c58.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/figtree-latin-ext-ce5692a4.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --line: #ECEFF4;
  --border: #E2E6EE;
  --border-strong: #CFD5E1;
  --text: #13192B;
  --muted: #4A5468;
  --subtle: #5B6478;
  --faint: #7A8296;

  --primary: #3D4BE0;
  --primary-dark: #2B36B0;
  --primary-soft: #E8EAFD;
  --primary-tint: #F4F5FF;

  --green: #116A40;
  --green-soft: #E3F4EA;
  --orange: #9A3F0B;
  --orange-soft: #FDEBDD;
  --red: #A51F26;
  --red-soft: #FCE6E7;
  --violet: #5B32C4;
  --violet-soft: #EDE4FF;
  --teal: #0E6773;
  --teal-soft: #DDF2F4;
  --pink: #A2266B;
  --pink-soft: #FBE4F0;
  --night: #2A2F6B;

  --radius: 16px;
  --radius-card: 20px;
  --shadow: 0 10px 28px rgba(19, 25, 43, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
h1 { font-size: clamp(28px, 4.5vw, 34px); }
h2 { font-size: 22px; letter-spacing: -0.01em; }
h3 { font-size: 18px; letter-spacing: -0.005em; }
p { margin: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, label:focus-within {
  outline: 3px solid rgba(61, 75, 224, 0.45);
  outline-offset: 2px;
}

img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.icon { flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); font-size: 15px; }
.small { font-size: 14px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.grow { flex-grow: 1; min-width: 0; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-s { margin-top: 8px; } .mt-m { margin-top: 16px; } .mt-l { margin-top: 28px; } .mt-xl { margin-top: 44px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--primary); color: #FFFFFF;
  font-size: 17px; font-weight: 600; cursor: pointer; text-align: center;
  transition: background-color 0.15s ease;
}
.btn:hover { background: var(--primary-dark); color: #FFFFFF; }
.btn-block { display: flex; width: 100%; min-height: 56px; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: #F7F8FB; color: var(--text); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-dark { background: var(--text); }
.btn-dark:hover { background: #262E45; }
.btn-danger { background: var(--surface); color: var(--red); border-color: #F0C5C8; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
form.button_to { display: contents; }

/* Cards and lists */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 18px;
}
.card-tight { padding: 4px 16px; }
.list-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { color: var(--text); }
a.list-row:hover .list-title { color: var(--primary); }
.list-title { font-size: 16px; font-weight: 600; }
.list-sub { font-size: 14px; color: var(--subtle); margin-top: 2px; }
.list-strong { font-size: 14px; color: var(--text); font-weight: 600; margin-top: 2px; }
.chevron { color: var(--faint); }

.tile-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-dark);
}
.tile-icon.green { background: var(--green-soft); color: var(--green); }
.tile-icon.orange { background: var(--orange-soft); color: var(--orange); }
.tile-icon.red { background: var(--red-soft); color: var(--red); }
.tile-icon.night { background: var(--night); color: #FFFFFF; }
.tile-icon.grey { background: #EEF1F6; color: var(--muted); }

.section-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); margin: 28px 0 10px; }

/* Avatars use the profile color */
.avatar {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 21px;
}
.avatar-l { width: 72px; height: 72px; font-size: 30px; }
.avatar-xl { width: 88px; height: 88px; font-size: 38px; }
.color-violet { background: var(--violet-soft); color: var(--violet); }
.color-teal { background: var(--teal-soft); color: var(--teal); }
.color-orange { background: var(--orange-soft); color: var(--orange); }
.color-pink { background: var(--pink-soft); color: var(--pink); }
.color-blue { background: var(--primary-soft); color: var(--primary-dark); }
.color-green { background: var(--green-soft); color: var(--green); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: #EEF1F6; color: var(--muted); white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.badge.night { background: var(--night); color: #FFFFFF; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .legend { font-size: 15px; font-weight: 600; }
.input, select.input {
  height: 54px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface); font-size: 17px; width: 100%;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(61, 75, 224, 0.18); }
.input-time { width: 150px; font-variant-numeric: tabular-nums; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.hint { font-size: 14px; color: var(--subtle); }
.errors { padding: 12px 16px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 15px; }

/* Choice tiles (age, device) */
.choices { display: grid; gap: 10px; }
.choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 12px 16px;
  border: 2px solid var(--border-strong); border-radius: 16px; background: var(--surface);
  font-weight: 600; cursor: pointer;
}
.choice input:checked + .choice-body { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-dark); }
.choice input:focus-visible + .choice-body { outline: 3px solid rgba(61, 75, 224, 0.45); outline-offset: 2px; }
.choice input:disabled + .choice-body { opacity: 0.55; cursor: not-allowed; }
.choices-2 .choice-body { justify-content: center; }

/* Segmented control: Léger / Normal / Strict, Bloqué / Horaires / Ouvert */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: #EEF1F6; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 8px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; text-align: center;
}
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(19, 25, 43, 0.12); }
.segmented input:checked + span.on-block { background: var(--red); color: #FFFFFF; }
.segmented input:checked + span.on-schedule { background: var(--orange); color: #FFFFFF; }
.segmented input:checked + span.on-open { background: var(--green); color: #FFFFFF; }
.segmented input:checked + span.on-level { background: var(--primary); color: #FFFFFF; }
.segmented input:focus-visible + span { outline: 3px solid rgba(61, 75, 224, 0.45); }

/* Day pills */
.day-pills { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-pills label { position: relative; }
.day-pills input { position: absolute; opacity: 0; pointer-events: none; }
.day-pills span {
  display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 700; cursor: pointer;
}
.day-pills input:checked + span { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.day-pills input:focus-visible + span { outline: 3px solid rgba(61, 75, 224, 0.45); outline-offset: 2px; }

/* Checkbox rows and switches */
.check-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); flex-shrink: 0; }
.switch { position: relative; flex-shrink: 0; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--border-strong); transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(19, 25, 43, 0.25); transition: transform 0.15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid rgba(61, 75, 224, 0.45); outline-offset: 2px; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; background: var(--green-soft); color: var(--green); }
.flash.alert { background: var(--red-soft); color: var(--red); }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.logo:hover { color: var(--text); }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }

/* Dropdown menus built on <details> */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.menu-panel.right { left: auto; right: 0; }
.menu-panel button, .menu-panel a {
  display: flex; width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; background: none;
  font-size: 16px; font-weight: 600; text-align: left; color: var(--text); cursor: pointer;
}
.menu-panel button:hover, .menu-panel a:hover { background: var(--primary-tint); color: var(--primary-dark); }
