/* ============================================================
 * style.css -- Styles personnalisés (complément Tailwind CDN)
 * Projet : combienjefacture.fr
 * Version : 1.0 (2026-06-29)
 *
 * Philosophie : sobre, sérieux, lisible, accessible.
 * Tailwind est chargé via CDN ; ce fichier complète pour :
 *  - Police par défaut
 *  - Styles du slider natif (cross-browser)
 *  - Animations légères
 *  - Focus visibles (accessibilité)
 *  - Petits ajustements typographiques
 * ============================================================ */

/* ===== VARIABLES ===== */
:root {
  --color-primary: #1d4ed8; /* blue-700 */
  --color-primary-dark: #1e40af; /* blue-800 */
  --color-bg: #f8fafc; /* slate-50 */
  --color-text: #1e293b; /* slate-800 */
  --color-text-light: #64748b; /* slate-500 */
  --color-border: #e2e8f0; /* slate-200 */
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3 {
  letter-spacing: -0.02em;
}

/* ===== FOCUS VISIBLE (ACCESSIBILITÉ) ===== */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== SLIDER EXPÉRIENCE (cross-browser) ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -7px;
  height: 20px;
  width: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.3);
}

/* ===== INPUTS ===== */
input[type="text"],
input[type="email"],
select {
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:hover,
input[type="email"]:hover,
select:hover {
  border-color: #94a3b8; /* slate-400 */
}

/* ===== BOUTONS ===== */
button {
  transition: background-color 0.15s, transform 0.05s;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== ANIMATION FADE-IN (résultat) ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#resultat-container {
  animation: fadeInUp 0.4s ease-out;
}

/* ===== SECTIONS ===== */
section {
  scroll-margin-top: 80px; /* Compense le header sticky */
}

/* ===== TABLEAU COEFFICIENTS ===== */
#tableau-coefficients td {
  border-bottom: 1px solid var(--color-border);
}

#tableau-coefficients tr:last-child td {
  border-bottom: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  h1 {
    font-size: 1.875rem; /* 30px */
  }
  h2 {
    font-size: 1.5rem; /* 24px */
  }
}

/* ===== IMPRESSION (si quelqu'un imprime la page) ===== */
@media print {
  header, footer, #formulaire-simulateur, .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  #resultat-container {
    page-break-inside: avoid;
  }
}

/* ===== PRÉFÉRENCES UTILISATEUR : MOUVEMENT RÉDUIT ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
