/* =========================================================================
   UWB V7 — Shared style guide
   Extracted from documentation_donnees_reelles.html, extended for the project site.
   ========================================================================= */

:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #1a1f2e;
  --muted: #5b6478;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --warn-bg: #fff4e5;
  --warn-border: #f59e0b;
  --warn-ink: #7c4a03;
  --danger-bg: #fde8e8;
  --danger-border: #dc2626;
  --danger-ink: #7f1d1d;
  --ok-bg: #e7f6ec;
  --ok-border: #16a34a;
  --ok-ink: #0e5128;
  --table-row: #f1f3f9;
  --border: #e2e6ee;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  padding-top: var(--header-h);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

h1 { font-size: 30px; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 22px; margin: 30px 0 10px; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }
h3 { font-size: 17px; margin: 16px 0 8px; color: var(--accent); }
h4 { font-size: 14px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 16px; }

/* =================== Generic components (original style guide) =================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.alert { border-left: 5px solid; padding: 12px 16px; border-radius: 6px; margin: 12px 0; }
.alert.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-ink); }
.alert.warn   { background: var(--warn-bg);   border-color: var(--warn-border);   color: var(--warn-ink); }
.alert.ok     { background: var(--ok-bg);     border-color: var(--ok-border);     color: var(--ok-ink); }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #eef1f7; font-weight: 600; }
tr:nth-child(even) td { background: var(--table-row); }

code { background: #eef1f7; padding: 1px 6px; border-radius: 4px; font-size: 13px; font-family: 'Courier New', monospace; }

ul, ol { margin: 6px 0 0 20px; }
li { margin-bottom: 5px; }

.formula {
  background: #0f172a; color: #e2e8f0; padding: 13px 16px; border-radius: 8px;
  font-size: 13px; font-family: 'Courier New', monospace; white-space: pre-wrap;
  overflow-x: auto; line-height: 1.55; margin: 10px 0;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

.comp-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: #fafbfd; }
.comp-card h4 { margin: 0 0 6px; font-size: 14px; }
.comp-card p { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; color: #fff;
}
.badge.accent  { background: var(--accent); }
.badge.warn    { background: var(--warn-border); }
.badge.danger  { background: var(--danger-border); }
.badge.ok      { background: var(--ok-border); }
.badge.muted   { background: var(--muted); }

/* =================== Sticky header =================== */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: #fff; border-bottom: 1px solid var(--border);
  z-index: 100; display: flex; align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.site-header .inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px; width: 100%;
  display: flex; align-items: center; gap: 24px;
}
.site-header .logo {
  font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -0.5px;
}
.site-header .logo span { color: var(--accent); }
.site-header nav { display: flex; gap: 18px; flex: 1; }
.site-header nav a {
  color: var(--ink); font-size: 14px; font-weight: 500;
  padding: 6px 8px; border-radius: 4px;
}
.site-header nav a:hover { background: var(--table-row); text-decoration: none; }
.site-header nav a.active { color: var(--accent); }
.site-header .lang { display: flex; gap: 4px; font-size: 13px; }
.site-header .lang a {
  color: var(--muted); padding: 4px 8px; border-radius: 4px;
}
.site-header .lang a.current { color: var(--ink); font-weight: 700; background: var(--table-row); }

@media (max-width: 720px) {
  .site-header nav { display: none; }
}

/* =================== CTA buttons =================== */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  font-family: inherit;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost { background: #fff; border-color: var(--border); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.large { padding: 14px 28px; font-size: 16px; }
.btn.donate { background: #ffc439; color: #142c8e; border-color: #f0b000; }
.btn.donate:hover { background: #f5b400; color: #142c8e; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Contribution box (open-hardware project, no sales) */
.contribute {
  background: linear-gradient(135deg, #fff8e6 0%, #f7f8fb 100%);
  border: 1px solid #f0d68a; border-radius: 10px;
  padding: 22px 24px; margin: 18px 0; text-align: center;
}
.contribute h3 { color: var(--ink); margin-top: 0; }
.contribute p { color: var(--muted); max-width: 560px; margin: 8px auto 16px; }

/* =================== Hero =================== */

.hero {
  background: linear-gradient(135deg, #eef2fd 0%, #f7f8fb 100%);
  padding: 60px 24px;
  margin: -24px -24px 32px;
  border-radius: 0 0 12px 12px;
}
.hero .inner { max-width: 1180px; margin: 0 auto; }
.hero h1 { font-size: 40px; line-height: 1.15; margin-bottom: 12px; max-width: 720px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 640px; margin-bottom: 24px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 28px; }
  .hero .lead { font-size: 16px; }
}

/* =================== Product cards (catalog) =================== */

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card .img {
  background: #eef2fd; height: 180px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
.product-card .body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.product-card h3 { margin: 0 0 6px; color: var(--ink); font-size: 17px; }
.product-card .desc { color: var(--muted); font-size: 14px; margin-bottom: 12px; flex: 1; }
.product-card .price { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.product-card .price .currency { font-size: 13px; color: var(--muted); font-weight: 500; }
.product-card a.btn { align-self: flex-start; }

/* =================== Product sheet (detail page) =================== */

.product-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
@media (max-width: 900px) { .product-detail { grid-template-columns: 1fr; } }
.product-gallery {
  background: #eef2fd; border-radius: 10px; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.product-info .price-line {
  display: flex; align-items: baseline; gap: 12px; margin: 20px 0;
}
.product-info .price-line .price {
  font-size: 32px; font-weight: 700; color: var(--accent);
}
.product-info .specs { margin-top: 18px; }
.product-info .box-contents { margin: 18px 0; }
.product-info .box-contents li { font-size: 14px; }

/* =================== Footer =================== */

.site-footer {
  background: #1a1f2e; color: #c4ccdc;
  padding: 40px 24px 20px; margin-top: 60px;
}
.site-footer .inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
}
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; font-size: 14px; }
.site-footer a { color: #c4ccdc; }
.site-footer a:hover { color: #fff; }
.site-footer .copyright {
  max-width: 1180px; margin: 30px auto 0; padding-top: 20px;
  border-top: 1px solid #2d3548; font-size: 12px; color: #8a93a8;
}

@media (max-width: 720px) {
  .site-footer .inner { grid-template-columns: 1fr 1fr; }
}

/* =================== Utilities =================== */

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

.kbd {
  background: #fff; border: 1px solid #c4ccdc; border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: 'Courier New', monospace;
}
