:root {
  --green: #009f4d;
  --green-dark: #007a3e;
  --bg: #ffffff;
  --card: #fafafa;
  --border: #dddddd;
  --text: #111111;
  --muted: #666666;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --result-bg: #eaffea;
  --result-border: #b5e7b5;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 700px) {
  body {
    padding: 10px;
  }
}

/* Header */
.header {
  max-width: 1100px;
  margin: 0 auto 12px;
  text-align: center;
  vertical-align: middle;
}

h1 {
  font-size: 36px;
  font-weight: 900;
  color: var(--green);
  margin: 0 0 8px;
}

@media (max-width: 600px) {
  h1 {
    font-size: 28px;
  }
}

.hero-sub {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--text);
}

.hero-sub-small {
  margin: 0 auto 10px;
  font-size: 13px;
  color: var(--muted);
  max-width: 960px;
}

.top-links {
  font-size: 13px;
  margin: 8px 0 0;
}

.top-links a {
  color: var(--green);
  text-decoration: none;
  margin: 0 6px;
}

.top-links a:hover {
  text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  margin: 10px 0;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--green);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Page container */
.page {
  max-width: 1100px;
  margin: 0 auto 30px;
}

.detail-wrap {
  max-width: 900px;
  margin: 0 auto 24px;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 12px 0;
}

.section-title {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 18px;
}

.section-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Family bar */
.family-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  background: #f3faf6;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  scrollbar-width: thin;
  justify-content: center;
}

.family-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.family-btn:hover {
  background: #e8f5ee;
}

.family-btn.active {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.search {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  outline: none;
}

.search:focus {
  border-color: var(--green);
}

/* Calculator grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.calc-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.calc-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.calc-tile h3 {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 16px;
}

.calc-tile p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.calc-tile a {
  display: inline-block;
  margin-top: 6px;
  color: var(--green);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.calc-tile a:hover {
  text-decoration: underline;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  font-size: 13px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--green);
}

.field small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Buttons */
.btn-primary {
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-outline {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--green-dark);
  background: #fff;
  font-size: 13px;
  display: inline-block;
  transition: background 0.2s;
}

.btn-outline:hover {
  background: #f0f8f3;
}

/* Result box */
.result-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  font-size: 13px;
  line-height: 1.6;
  display: none;
}

.result-box strong {
  font-size: 16px;
  color: var(--green-dark);
}

/* See also section */
.see-also ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.see-also a {
  color: var(--green);
  text-decoration: none;
}

.see-also a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 11px;
  color: #777;
  text-align: center;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

/* Ad wrapper */
.ad-wrap {
  max-width: 1100px;
  margin: 0 auto 14px;
  text-align: center;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #ddd;
  padding: 10px 15px;
  font-size: 13px;
  color: #333;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-banner button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: filter 0.2s;
}

.cookie-accept {
  background: var(--green);
  color: #fff;
}

.cookie-accept:hover {
  filter: brightness(1.1);
}

.cookie-more {
  background: #f0f0f0;
  color: #333;
}

.cookie-more:hover {
  background: #e0e0e0;
}

/* ============================================
   SECTION CALCULETTES COMPLEMENTAIRES
   Style badges comme les onglets du menu
   ============================================ */

.related-content {
    margin: 40px 0 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.related-content h2 {
    font-size: 1.3rem;
    color: white;
    background: #16a085;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    font-weight: 600;
}

.related-content > p {
    color: #333;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.related-card {
    background: white;
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
}

.related-card:hover {
    background: #16a085;
    color: white;
    border-color: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(22, 160, 133, 0.3);
}

.related-card h3 {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    color: inherit;
}

.related-card p {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .related-content {
        margin: 30px 0 20px 0;
        padding: 15px 0;
    }
    
    .related-content h2 {
        font-size: 1.1rem;
        padding: 6px 16px;
    }
    
    .related-links {
        gap: 10px;
    }
    
    .related-card {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
