/* calculcredit.fr — shared styles */

:root {
  --blue: #1a3a6b;
  --blue-light: #eef3fb;
  --blue-mid: #2d5da1;
  --green: #1D9E75;
  --green-light: #edfbf5;
  --grey: #f5f6f8;
  --grey-mid: #e2e5ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --border: #d1d5db;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(26,58,107,0.08);
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--grey);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--blue-mid); }
a:hover { color: var(--blue); }

/* ── Layout ── */
.site-header {
  background: var(--blue);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.site-header nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.88rem;
  margin-left: 20px;
}

.site-header nav a:hover { color: var(--white); }

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  padding: 32px 0 60px;
}

/* AdSense top slot */
.ad-top {
  background: var(--grey);
  text-align: center;
  padding: 0;
}

/* ── Hero ── */
.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--blue);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 580px;
  margin: 0 auto;
}

/* ── Calculator card ── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
}

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

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  appearance: textfield;
  -moz-appearance: textfield;
}

.field input[type="number"]:focus {
  outline: none;
  border-color: var(--blue-mid);
}

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { opacity: 0.4; }

.field input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--blue-mid);
}

/* ── Results ── */
.results-card {
  background: var(--blue);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.results-primary {
  text-align: center;
  margin-bottom: 20px;
}

.results-primary .label {
  font-size: 0.85rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.results-primary .amount {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -1px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.result-item {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.result-item .r-label {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-bottom: 4px;
}

.result-item .r-value {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ── Affiliate CTA ── */
.cta-box {
  background: var(--green-light);
  border: 1.5px solid #a7e8d2;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.cta-box .cta-headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.cta-box .cta-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.cta-box .cta-monthly {
  font-weight: 700;
  color: var(--blue);
}

.btn-cta {
  display: inline-block;
  background: var(--green);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-cta:hover {
  background: #179067;
  color: var(--white);
  transform: translateY(-1px);
}

.btn-cta-outline {
  display: inline-block;
  background: transparent;
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--green);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.3;
}

.btn-cta-outline:hover {
  background: var(--green-light);
  color: var(--green);
}

.cta-fine {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Ad mid ── */
.ad-mid {
  text-align: center;
  margin-bottom: 20px;
}

/* ── Amortisation table ── */
.table-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 24px 20px;
  margin-bottom: 20px;
}

.table-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-toggle {
  background: none;
  border: 1.5px solid var(--blue-mid);
  color: var(--blue-mid);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-toggle:hover {
  background: var(--blue-light);
}

.btn-csv {
  background: none;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-csv:hover { background: var(--green-light); }

.amortisation-wrap { overflow-x: auto; }

.amortisation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.amortisation-table th {
  text-align: right;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--grey-mid);
}

.amortisation-table th:first-child,
.amortisation-table td:first-child { text-align: left; }

.amortisation-table td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grey);
}

.amortisation-table tr:last-child td { border-bottom: none; }
.amortisation-table tr:nth-child(even) td { background: var(--grey); }

.btn-show-all {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 7px;
  cursor: pointer;
}

.btn-show-all:hover { border-color: var(--blue-mid); color: var(--blue-mid); }

/* ── Insurance upsell ── */
.cta-insurance {
  background: #fff8ed;
  border: 1.5px solid #f5c97a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.cta-insurance strong { color: #7c4f00; }
.cta-insurance a { color: #a66200; font-weight: 700; }

/* ── Secondary CTA ── */
.cta-secondary {
  background: var(--blue-light);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.cta-secondary strong { color: var(--blue); }

.cta-secondary a {
  color: var(--blue-mid);
  font-weight: 700;
  text-decoration: underline;
}

/* ── SEO copy ── */
.seo-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.seo-section h2 {
  font-size: 1.15rem;
  color: var(--blue);
  margin-bottom: 12px;
}

.seo-section h3 {
  font-size: 1rem;
  color: var(--blue);
  margin-top: 20px;
  margin-bottom: 8px;
}

.seo-section p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 10px;
}

/* ── FAQ ── */
.faq-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 20px;
}

.faq-section h2 {
  font-size: 1.1rem;
  color: var(--blue);
  margin-bottom: 18px;
}

.faq-item {
  border-bottom: 1px solid var(--grey-mid);
  padding: 14px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--blue-mid);
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ── Rate table ── */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 16px;
}

.rate-table th {
  background: var(--blue);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.rate-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey-mid);
}

.rate-table tr:nth-child(even) td { background: var(--grey); }

/* ── Internal links ── */
.internal-links {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.internal-links h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.internal-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.internal-links a {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue-mid);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}

.internal-links a:hover { background: #d5e2f5; color: var(--blue); }

/* ── Footer ── */
.site-footer {
  background: var(--blue);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 28px 16px;
  font-size: 0.83rem;
}

.site-footer a { color: rgba(255,255,255,0.85); }
.site-footer .footer-links { margin-bottom: 10px; }
.site-footer .footer-links a { margin: 0 10px; }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.breadcrumb a { color: var(--blue-mid); text-decoration: none; }
.breadcrumb span { margin: 0 6px; }

/* ── Articles ── */
.article-body {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  margin-bottom: 20px;
  max-width: 680px;
}

.article-body h2 {
  font-size: 1.15rem;
  color: var(--blue);
  margin: 24px 0 10px;
}

.article-body h3 {
  font-size: 1rem;
  color: var(--blue);
  margin: 18px 0 8px;
}

.article-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
  line-height: 1.75;
}

.article-body ul, .article-body ol {
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 2;
  margin-bottom: 12px;
}

.article-body strong { color: var(--text); }

.article-body .highlight-box {
  background: var(--blue-light);
  border-left: 4px solid var(--blue-mid);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 0.93rem;
  color: var(--text);
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Article index grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,58,107,0.12);
  color: var(--text);
}

.article-card .card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue-mid);
  margin-bottom: 8px;
}

.article-card h2 {
  font-size: 0.97rem;
  color: var(--blue);
  margin-bottom: 8px;
  line-height: 1.35;
}

.article-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Plan de financement button ── */
.btn-plan {
  background: var(--blue);
  color: var(--white);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-plan:hover { background: var(--blue-mid); }

/* ── Print — Plan de financement ── */
#plan-print { display: none; }

@media print {
  body > *:not(#plan-print) { display: none !important; }
  #plan-print {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    color: #111;
    font-size: 10pt;
    margin: 0;
    padding: 0;
  }

  .plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2.5pt solid #1a3a6b;
    padding-bottom: 10pt;
    margin-bottom: 18pt;
  }

  .plan-title {
    font-size: 16pt;
    font-weight: bold;
    color: #1a3a6b;
    letter-spacing: 0.5px;
  }

  .plan-subtitle {
    font-size: 11pt;
    color: #333;
    margin-top: 3pt;
  }

  .plan-meta {
    text-align: right;
    font-size: 8.5pt;
    color: #555;
    line-height: 1.6;
  }

  .plan-columns {
    display: flex;
    gap: 24pt;
    margin-bottom: 18pt;
  }

  .plan-col {
    flex: 1;
  }

  .plan-section {
    margin-bottom: 18pt;
  }

  .plan-section h2 {
    font-size: 10pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a3a6b;
    border-bottom: 1px solid #c5d4ed;
    padding-bottom: 4pt;
    margin-bottom: 8pt;
  }

  .plan-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .plan-data-table td {
    padding: 4pt 6pt;
    border-bottom: 1px solid #eee;
  }

  .plan-data-table td:first-child { color: #444; width: 55%; }
  .plan-data-table td:last-child { font-weight: bold; text-align: right; }

  .plan-highlight td:last-child {
    font-size: 13pt;
    color: #1a3a6b;
  }

  .plan-amort-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
  }

  .plan-amort-table th {
    background: #1a3a6b;
    color: white;
    padding: 4pt 6pt;
    text-align: right;
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .plan-amort-table th:first-child,
  .plan-amort-table td:first-child { text-align: left; }

  .plan-amort-table td {
    padding: 3.5pt 6pt;
    border-bottom: 0.5pt solid #e5e5e5;
    text-align: right;
  }

  .plan-amort-table tr:nth-child(even) td { background: #f8f9fb; }

  .plan-footer {
    margin-top: 20pt;
    padding-top: 8pt;
    border-top: 1px solid #ccc;
    font-size: 7.5pt;
    color: #777;
    text-align: center;
  }

  @page {
    margin: 22mm 24mm;
    size: A4 portrait;
  }
}
