@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #1e3a8a;         /* Bleu indigo profond */
  --primary-dark: #172554;
  --primary-soft: #eff6ff;
  --accent: #ea580c;          /* Orange terracotta chaleureux */
  --bg-page: #faf9f6;         /* Ivoire papier */
  --bg-card: #ffffff;
  --bg-subtle: #f3f4f6;
  --text-main: #1c1917;
  --text-muted: #57534e;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(30, 58, 138, 0.05);
  --shadow-md: 0 12px 32px -8px rgba(30, 58, 138, 0.1);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo::before {
  content: "%";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
}

.menu-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 1.2rem;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.nav-links a:hover { color: var(--primary); background: var(--bg-subtle); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); font-weight: 700; }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.85rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--bg-subtle); }
  .nav-links a:last-child { border-bottom: none; }
}

/* Main & Titres */
main { max-width: 860px; margin: 2.75rem auto; padding: 0 1.25rem; }

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
}

.subtitle { color: var(--text-muted); margin-bottom: 2.25rem; font-size: 1.05rem; max-width: 680px; }

/* Grille Accueil */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.35rem;
  margin-top: 1.5rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.65rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }

.tool-card h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.22rem;
  margin-bottom: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-card h2::after { content: "→"; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--accent); transition: transform 0.2s; }
.tool-card:hover h2::after { transform: translateX(4px); }
.tool-card p { font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }

/* Emplacement Pub */
.ad-slot {
  width: 100%;
  min-height: 95px;
  background: var(--bg-subtle);
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Calculateur */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.35rem; margin-bottom: 1.75rem; }
@media (max-width: 640px) { .calc-card { padding: 1.35rem; } .calc-grid { grid-template-columns: 1fr; } }

.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.45rem; }

.form-group input, .form-group select {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-page);
  font-variant-numeric: tabular-nums;
  transition: all 0.15s ease;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.14);
}

/* Résultats */
.results-box {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #faf9f6;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.28);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  gap: 1rem;
}

.result-row:last-child { border-bottom: none; }
.result-label { color: #dbeafe; font-size: 0.92rem; }
.result-value { font-weight: 700; font-size: 1.05rem; color: #ffffff; font-variant-numeric: tabular-nums; text-align: right; }
.result-main { font-family: 'Fraunces', Georgia, serif; color: #fdba74; font-size: 1.55rem; }

/* Section Éditoriale SEO */
.seo-content { margin-top: 3.5rem; }

.seo-content h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.seo-content h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
}

.seo-content h2:first-child { margin-top: 0; }
.seo-content p { margin-bottom: 1.15rem; color: #3f3b37; font-size: 1.01rem; line-height: 1.75; }
.seo-content a:not(.seo-pill) { color: var(--primary); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid rgba(30, 58, 138, 0.35); }
.seo-content a:not(.seo-pill):hover { background: var(--primary-soft); border-bottom-color: var(--primary); }

.seo-content code {
  display: inline-block;
  background: #ffffff;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  border-left: 3px solid var(--accent);
}

.seo-content ul {
  list-style: none !important;
  margin: 1.25rem 0 1.75rem 0 !important;
  padding: 1.35rem 1.5rem !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.seo-content ul li { position: relative; padding-left: 1.65rem; margin-bottom: 0.85rem; color: #3f3b37; }
.seo-content ul li:last-child { margin-bottom: 0; }
.seo-content ul li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Tableaux */
.table-wrapper { width: 100%; overflow-x: auto; margin: 1.5rem 0 2rem; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 0.95rem 1.15rem; text-align: left; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
th { background: var(--primary); color: #faf9f6; font-weight: 600; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:nth-child(even) { background: #f8fafc; }
tbody tr:hover { background: var(--primary-soft); }
tr:last-child td { border-bottom: none; }

/* Accordéons FAQ */
details.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 0.85rem; box-shadow: var(--shadow-sm); }
details.faq-item[open] { border-color: var(--primary); }
details.faq-item summary { padding: 1.1rem 1.35rem; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: "+"; font-size: 1.35rem; color: var(--accent); line-height: 1; }
details.faq-item[open] summary::after { content: "−"; color: var(--primary); }
details.faq-item .faq-answer { padding: 0.95rem 1.35rem 1.2rem; color: #44403c; font-size: 0.96rem; line-height: 1.7; border-top: 1px solid var(--bg-subtle); }

/* Badges SEO */
.seo-pills-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0 2rem; }
a.seo-pill {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
a.seo-pill:hover { background: var(--primary); color: #ffffff; border-color: var(--primary); transform: translateY(-1px); }

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
footer a { color: var(--text-main); font-weight: 600; text-decoration: none; }
footer a:hover { color: var(--primary); }
