/* ═══════════════════════════════════════════════════════
   CalculPret.ca — Design System Principal
   Thème : Bleu marine & or — Premium Finance
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ───────────────────────────────────────── */
:root {
  --accent:     #1d4ed8;   /* bleu royal */
  --accent-2:   #2563eb;
  --accent-glow:#dbeafe;
  --gold:       #f59e0b;
  --gold-light: #fef3c7;
  --success:    #10b981;
  --danger:     #ef4444;
  --warn:       #f59e0b;

  --bg:         #f0f4ff;
  --surface:    #ffffff;
  --surface2:   #f8faff;
  --border:     #e2e8f0;
  --text:       #0f172a;
  --text-2:     #334155;
  --muted:      #64748b;

  --radius:     14px;
  --radius-sm:  8px;
  --shadow:     0 2px 16px rgba(29,78,216,0.08);
  --shadow-lg:  0 8px 40px rgba(29,78,216,0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Header ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem;
  color: var(--text); text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 3px 10px rgba(29,78,216,0.3);
}
.logo-text span { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex; gap: 4px;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--accent-glow); color: var(--accent); }
.nav-links a.active { background: var(--accent); color: #fff; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 60%, #e0e7ff 100%);
  padding: 120px 24px 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(29,78,216,0.1);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--accent); }

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* Tab selector hero */
.hero-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-tab {
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-2);
  transition: all 0.2s;
  text-decoration: none;
}
.hero-tab:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.hero-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 14px rgba(29,78,216,0.3); }

/* ── Layout principal ────────────────────────────────── */
.main-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Form ────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative; display: flex;
}
.input-prefix {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 14px;
  display: flex; align-items: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.form-input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,78,216,0.12); }

.form-input-full {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-input-full:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,78,216,0.12); }

.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.form-range {
  width: 100%; margin: 8px 0;
  accent-color: var(--accent);
}

.range-labels {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--muted);
}

/* Grid 2 colonnes dans le form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px) { .form-grid { grid-template-columns: 1fr; } }

/* ── Bouton Calculer ─────────────────────────────────── */
.btn-calc {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.03em;
  margin-top: 8px;
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29,78,216,0.35); }
.btn-calc:active { transform: translateY(0); }

/* ── Résultats ───────────────────────────────────────── */
.results-panel {
  display: none;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-highlight {
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.result-highlight-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.result-highlight-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.result-highlight-suffix {
  font-size: 1rem;
  color: var(--muted);
  margin-left: 4px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row-label { color: var(--text-2); }
.result-row-value { font-weight: 700; color: var(--text); }
.result-row-value.danger { color: var(--danger); }
.result-row-value.success { color: var(--success); }
.result-row-value.gold { color: var(--gold); }

/* ── Barre Intérêts / Capital ────────────────────────── */
.breakdown-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin: 16px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
}
.bar-int {
  background: linear-gradient(90deg, var(--danger), #f97316);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: width 0.6s ease;
}
.bar-cap {
  background: linear-gradient(90deg, var(--success), #34d399);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: width 0.6s ease; flex: 1;
}
.bar-legend {
  display: flex; gap: 16px;
  font-size: 0.78rem; color: var(--muted);
}
.bar-legend span { display: flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── Tableau d'amortissement ────────────────────────── */
.amort-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.85rem;
}
.amort-table th {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 2px solid var(--accent);
}
.amort-table th:first-child { text-align: left; border-radius: 6px 0 0 0; }
.amort-table th:last-child { border-radius: 0 6px 0 0; }
.amort-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.amort-table td:first-child { text-align: left; font-weight: 600; }
.amort-table tr:hover { background: var(--surface2); }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.sidebar-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.sidebar-tool {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 8px;
  transition: all 0.15s;
}
.sidebar-tool:hover { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); text-decoration: none; }
.sicon { font-size: 1.1rem; }

/* Taux du jour card */
.taux-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.taux-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.taux-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; }
.taux-value { font-size: 1.1rem; font-weight: 800; color: var(--accent); }

/* ── Section texte SEO ──────────────────────────────── */
.seo-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}
.seo-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}
.seo-section p { color: var(--text-2); margin-bottom: 14px; line-height: 1.75; }
.seo-section ul { padding-left: 20px; color: var(--text-2); margin-bottom: 14px; }
.seo-section li { margin-bottom: 6px; }

/* ── FAQ Accordion ──────────────────────────────────── */
.faq-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 24px;
}
.faq-inner {
  max-width: 800px; margin: 0 auto;
}
.faq-title {
  font-size: 1.6rem; font-weight: 800;
  text-align: center; margin-bottom: 32px;
  color: var(--text);
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left;
  background: var(--surface2);
  border: none; cursor: pointer;
  padding: 16px 20px;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text); display: flex;
  justify-content: space-between; align-items: center;
  transition: background 0.2s; font-family: inherit;
}
.faq-q:hover { background: var(--accent-glow); color: var(--accent); }
.faq-q.active { background: var(--accent); color: #fff; }
.faq-q.active .faq-arrow { transform: rotate(180deg); }
.faq-arrow { transition: transform 0.2s; font-size: 0.8rem; }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
  font-size: 0.9rem; color: var(--text-2); line-height: 1.7;
  padding: 0 20px;
}
.faq-a.open { max-height: 400px; padding: 16px 20px; }

/* ── Disclaimer ─────────────────────────────────────── */
.disclaimer {
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.8rem;
  color: #92400e;
  margin-top: 16px;
  display: flex; gap: 8px;
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: #fff; }

/* ── Error msg ──────────────────────────────────────── */
.error-msg {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #991b1b; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.9rem;
  display: flex; align-items: center; gap: 8px;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 90px 16px 40px; }
  .hero h1 { font-size: 1.75rem; }
  .card { padding: 20px; }
  .result-highlight-value { font-size: 1.8rem; }
}
