/* Pages publiques de Dicoplante : mêmes couleurs que l'app (src/constants/theme.ts). */
:root {
  color-scheme: light dark;
  --text: #1d2419;
  --text-secondary: #5d6657;
  --background: #f4f6ef;
  --surface: #ffffff;
  --surface-muted: #e9ede2;
  --border: #d5dbcd;
  --primary: #2f6b3a;
  --on-primary: #ffffff;
  --primary-soft: #dcebd9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #eef2ea;
    --text-secondary: #a7b0a0;
    --background: #10140f;
    --surface: #1a2018;
    --surface-muted: #252c22;
    --border: #343d30;
    --primary: #86c792;
    --on-primary: #0e1a10;
    --primary-soft: #24402a;
  }
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--primary);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* En-tête */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: underline;
}

/* Contenu */
main.wrap {
  padding-top: 32px;
  padding-bottom: 48px;
}

h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  line-height: 1.2;
}

h2 {
  margin: 2.2em 0 0.5em;
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 {
  margin: 1.6em 0 0.4em;
  font-size: 1.1rem;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

li + li {
  margin-top: 0.3em;
}

.meta {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.lead {
  font-size: 1.1rem;
}

.callout {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* Étapes numérotées */
.steps {
  counter-reset: step;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.steps > li {
  position: relative;
  margin: 0 0 12px;
  padding: 14px 16px 14px 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.steps > li > :last-child {
  margin-bottom: 0;
}

/* Tableaux : défilent seuls sur petit écran */
.table-scroll {
  margin: 0 0 1.2em;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

tr:last-child > td {
  border-bottom: 0;
}

th {
  background: var(--surface-muted);
  font-weight: 600;
}

/* Accueil */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}

.hero img {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 20px;
}

.button {
  display: inline-block;
  margin: 8px 0 16px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.1);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 12px;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.cards > li {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cards strong {
  display: block;
  margin-bottom: 2px;
}

/* Pied de page */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding-top: 20px;
  padding-bottom: 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 8px;
}

.site-footer a {
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .hero img {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }
}
