/* ========================================
   Calcul-Gratuit.fr — Global Styles
   ======================================== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --orange: #ea580c;
  --orange-light: #ffedd5;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --max-w: 1100px;
  --transition: .2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- HEADER ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--blue); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.menu-toggle svg { display: block; }

/* ---- NAV TABS ---- */
.nav-tabs {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.nav-tabs-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs-inner::-webkit-scrollbar { display: none; }

.nav-tab {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .75rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
  cursor: pointer;
}
.nav-tab:hover {
  color: var(--blue);
  text-decoration: none;
}
.nav-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ---- MOBILE NAV ---- */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-tabs { display: none; }
  .nav-tabs.open { display: block; }
  .nav-tabs-inner {
    flex-direction: column;
    padding: .5rem 0;
  }
  .nav-tab {
    padding: .75rem 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }
  .nav-tab.active { border-left-color: var(--blue); border-bottom-color: transparent; }
}

/* ---- MAIN ---- */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ---- PAGE HERO ---- */
.page-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: .5rem;
}
.page-hero p {
  color: var(--gray-500);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- CARDS GRID (homepage) ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.card-icon {
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: .25rem;
}
.card p {
  font-size: .85rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ---- SECTION HEADINGS ---- */
.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-heading:first-of-type { margin-top: 0; }

/* ---- CALCULATOR PANEL ---- */
.calc-panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.calc-panel h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--gray-800);
}

/* ---- FORM ELEMENTS ---- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .6rem .75rem;
  font-size: 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--gray-800);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 140px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-200); }

/* ---- RESULT BOX ---- */
.result-box {
  background: var(--blue-light);
  border: 1px solid #93c5fd;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  display: none;
}
.result-box.visible { display: block; }
.result-box .result-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--blue-dark);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .25rem;
}
.result-box .result-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-dark);
}
.result-box .result-detail {
  font-size: .85rem;
  color: var(--gray-600);
  margin-top: .25rem;
}

/* ---- TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin-top: 1rem;
}
.data-table th,
.data-table td {
  padding: .6rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.data-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  position: sticky;
  top: 0;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
}

/* ---- RADIO / TOGGLE GROUP ---- */
.toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}
.toggle-group label {
  flex: 1;
  text-align: center;
  padding: .55rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--gray-600);
  border-right: 1px solid var(--gray-300);
  transition: background var(--transition), color var(--transition);
}
.toggle-group label:last-child { border-right: none; }
.toggle-group input { display: none; }
.toggle-group input:checked + label,
.toggle-group label.active {
  background: var(--blue);
  color: #fff;
}

/* ---- SEO CONTENT ---- */
.seo-content {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}
.seo-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: .75rem;
}
.seo-content p {
  color: var(--gray-600);
  font-size: .95rem;
  margin-bottom: .75rem;
  line-height: 1.7;
}
.seo-content ul {
  margin: .5rem 0 1rem 1.25rem;
  color: var(--gray-600);
  font-size: .95rem;
}
.seo-content li { margin-bottom: .3rem; }

/* ---- RELATED TOOLS ---- */
.related-tools {
  margin-top: 2rem;
}
.related-tools h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .75rem;
  color: var(--gray-700);
}
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.related-links a {
  padding: .4rem .85rem;
  background: var(--gray-100);
  border-radius: 20px;
  font-size: .85rem;
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}
.related-links a:hover {
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

/* ---- PARTNER LINK ---- */
.partner-link {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--gray-600);
}
.partner-link a { font-weight: 600; }

/* ---- FOOTER ---- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--gray-200);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-500);
  font-size: .85rem;
}
.site-footer a { color: var(--gray-500); }
.site-footer a:hover { color: var(--blue); }

/* ---- FAQ ACCORDION ---- */
.faq-section { margin: 3rem 0; }
.faq-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: #1e293b; }
.faq-item { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 0.5rem; overflow: hidden; }
.faq-question { width: 100%; text-align: left; background: #f8fafc; border: none; padding: 1rem 1.25rem; font-size: 1rem; font-weight: 600; color: #1e293b; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.faq-question:hover { background: #f1f5f9; }
.faq-question.open { background: #eff6ff; color: #2563eb; }
.faq-question::after { content: '+'; font-size: 1.4rem; font-weight: 300; color: #94a3b8; transition: transform 0.2s; }
.faq-question.open::after { content: '\2212'; color: #2563eb; }
.faq-answer { display: none; padding: 1rem 1.25rem; color: #475569; line-height: 1.7; background: white; border-top: 1px solid #e2e8f0; }
.faq-answer.open { display: block; }

/* ---- UTILITIES ---- */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-sm { font-size: .875rem; }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.hidden { display: none; }

@media (max-width: 640px) {
  .page-hero h1 { font-size: 1.5rem; }
  .calc-panel { padding: 1.25rem; }
  .form-row { flex-direction: column; gap: 0; }
  .result-box .result-value { font-size: 1.25rem; }
}
