*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--space-6);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--foreground);
  background: var(--background);
}

body > main {
  flex: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a:not(.btn) {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font-family: inherit;
}

:is(
  a[href], button, summary, select, label[for],
  label:has(input:is([type='checkbox'], [type='radio'])),
  input:is(
    [type='button'], [type='submit'], [type='reset'], [type='checkbox'],
    [type='radio'], [type='range'], [type='file'], [type='color']
  ),
  [role='button'], [role='link'], [role='option'], [role='menuitem']
):not(:disabled, [aria-disabled='true']) {
  cursor: pointer;
}

input[type='file']:not(:disabled)::file-selector-button {
  cursor: pointer;
}

input:is([type='date'], [type='time'], [type='datetime-local']):not(:disabled)::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1 {
  font-size: var(--text-display);
  line-height: var(--leading-heading);
  font-weight: 600;
  letter-spacing: -0.05em;
}

h2 {
  font-size: var(--text-heading);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}

:focus-visible:not(.input, .select, .btn) {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.container {
  width: min(var(--content-width), calc(100% - 2 * var(--page-gutter)));
  margin-inline: auto;
}

.icon {
  display: inline-block;
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Basecoat garde les variantes, les bordures et les états des composants. */
.btn {
  max-width: 100%;
  min-height: var(--control-height);
  height: auto;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  white-space: normal;
}

.btn[data-size='sm'] {
  min-height: var(--space-8);
  padding: var(--space-1) var(--space-3);
}

/* Un survol opaque conserve le contraste du texte blanc. */
.btn:not([data-variant]):hover,
.btn[data-variant='primary']:hover {
  background: var(--primary-hover);
}

.card {
  padding: var(--space-6);
  gap: var(--space-6);
}

.confirmation-dialog > form {
  width: min(calc(100% - var(--space-6)), var(--container-lg));
  max-height: calc(100dvh - var(--space-6));
  overflow-y: auto;
  padding: var(--space-6);
  gap: var(--space-6);
}

.confirmation-dialog h2 {
  padding-right: var(--space-8);
  font-size: var(--text-lg);
}

.confirmation-dialog [data-close-dialog] {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  min-height: auto;
  padding: var(--space-2);
}

.confirmation-dialog header p {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.usage-metric-values {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  font-variant-numeric: tabular-nums;
}

.usage-metric-values strong {
  font-size: var(--text-2xl);
}

.input:not([type='checkbox']) {
  min-height: var(--control-height);
  height: auto;
  width: 100%;
  padding-block: var(--space-3);
  font-size: var(--text-base);
}

.select:not(select),
.select:not(select) > button {
  width: 100%;
  min-width: 0;
}

.select:not(select) > button {
  min-height: var(--control-height);
  height: auto;
  font-size: var(--text-base);
}

.select [data-popover] {
  width: 100%;
}

.select [role='listbox'],
.dropdown-menu [role='menu'] {
  max-height: calc(5 * var(--control-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block: 0;
}

.select [role='option'],
.dropdown-menu [role='menuitem'] {
  height: var(--control-height);
  min-height: var(--control-height);
}

.field {
  gap: var(--space-2);
}
.field > label,
.field legend {
  font-weight: 600;
}
.range-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.range-field output {
  color: var(--primary);
  font-size: var(--text-sm);
}

.range-field input {
  width: 100%;
  min-height: var(--control-height);
  accent-color: var(--primary);
}

.field-help,
.privacy-note {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.field-error {
  font-size: var(--text-sm);
  color: var(--destructive);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  font-size: var(--text-sm);
  font-weight: 600;
}

.text-link:hover,
.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: var(--space-1);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.status-dot {
  width: var(--space-2);
  height: var(--space-2);
  flex: 0 0 var(--space-2);
  border-radius: 50%;
  background: var(--primary);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--space-20);
  gap: var(--space-4);
}

.menu-toggle {
  padding-inline: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.brand-dot {
  color: var(--primary);
  margin-left: calc(-1 * var(--space-2));
}
.brand-ball {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

#main-navigation {
  display: none;
  position: absolute;
  top: 100%;
  inset-inline: 0;
  padding: var(--space-4) var(--page-gutter);
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

#main-navigation.is-open {
  display: grid;
  gap: var(--space-2);
}
#main-navigation > a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  font-size: var(--text-sm);
}
#main-navigation > a[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: var(--space-2);
}

.page-intro {
  padding-block: var(--section-space) var(--space-8);
}
.page-intro h1 {
  margin-block: var(--space-5);
  font-size: var(--text-title);
}
.page-intro > p:not(.eyebrow) {
  color: var(--muted-foreground);
}
.centered {
  text-align: center;
}
.centered .eyebrow {
  justify-content: center;
}
.section {
  padding-block: var(--section-space);
}
.section-heading {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.section-heading h2 {
  margin-top: var(--space-3);
}
.section-heading > p {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.faq-section {
  display: grid;
  gap: var(--space-8);
  border-top: 1px solid var(--border);
  padding-block: var(--space-12) var(--section-space);
}
.faq-section h2 {
  margin-top: var(--space-3);
}
.faq-list {
  min-width: 0;
}
.faq-list summary {
  min-height: var(--control-height);
}
.faq-list p {
  color: var(--muted-foreground);
}

.site-footer {
  margin-top: var(--space-16);
  border-top: 1px solid var(--border);
}
.footer-main,
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-8);
}
.footer-main p {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}
.footer-main nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
}
.footer-main nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-8);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}
.footer-bottom a {
  text-decoration: underline;
  text-underline-offset: var(--space-1);
}

@media (min-width: 48rem) {
  .faq-section {
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-12);
  }
  .section-heading {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  .footer-main,
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 64rem) {
  .menu-toggle {
    display: none;
  }
  #main-navigation {
    display: flex;
    position: static;
    align-items: center;
    gap: var(--space-8);
    padding: 0;
    border: 0;
  }
}

.accordion summary {
  gap: var(--space-4);
}
