/* ============================================================
   BASE — Solaire en Location
   ============================================================
   Reset, typographie, éléments HTML natifs, utilities layout,
   boutons, formulaires, cartes génériques.
   ============================================================ */

/* ==========================================================
   1. RESET MODERNE
   ========================================================== */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* compenser header sticky */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  tab-size: 4;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'ss01' 1;
}

/* Images & médias */
img, picture, video, canvas, svg, iframe {
  display: block;
  max-width: 100%;
  height: auto;
}
img { font-style: italic; background-repeat: no-repeat; background-size: cover; shape-margin: 1rem; }

/* Éléments interactifs */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

/* Listes — reset par défaut, restaurer avec .list-reset-off si besoin */
ul, ol {
  list-style: none;
}

/* Liens */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: var(--transition-colors);
}
a:hover { color: var(--color-link-hover); }

/* HR */
hr {
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-8) 0;
}

/* Tableaux */
table { border-collapse: collapse; width: 100%; }

/* Autre */
address { font-style: normal; }

/* ==========================================================
   2. TYPOGRAPHIE
   ========================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-bold);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-tighter);
}

h2 {
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-4xl));
  font-weight: var(--fw-bold);
}

h3 {
  font-family: var(--font-body); /* sans-serif pour les sous-titres, pattern Stripe/Linear */
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}

h5 {
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

h6 {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-text-soft);
}

p {
  margin: 0;
  line-height: var(--lh-relaxed);
  text-wrap: pretty;
}

/* Modifiers typographiques */
.text-display { font-family: var(--font-display); }
.text-body { font-family: var(--font-body); }

.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }
.text-3xl { font-size: var(--fs-3xl); }

.font-light { font-weight: var(--fw-light); }
.font-normal { font-weight: var(--fw-normal); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.font-extrabold { font-weight: var(--fw-extrabold); }
.font-black { font-weight: var(--fw-black); }

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; letter-spacing: var(--ls-wider); }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.tracking-tight { letter-spacing: var(--ls-tight); }
.tracking-wide { letter-spacing: var(--ls-wide); }
.tracking-wider { letter-spacing: var(--ls-wider); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-orange { color: var(--color-orange); }
.text-orange-dark { color: var(--color-orange-dark); }
.text-navy { color: var(--color-navy); }
.text-mint { color: var(--color-mint-dark); }
.text-soft { color: var(--color-text-soft); }
.text-muted { color: var(--color-text-muted); }
.text-white { color: var(--color-white); }

/* Lead paragraph */
.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-text-soft);
  font-weight: var(--fw-normal);
  max-width: 65ch;
  text-wrap: pretty;
}

/* Chiffres XXL (stat numbers) */
.stat-number {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: var(--fw-black);
  line-height: 0.95;
  letter-spacing: var(--ls-tighter);
  color: var(--color-orange);
  font-variant-numeric: tabular-nums;
}

/* Highlight éditorial jaune */
.highlight {
  background: linear-gradient(180deg, transparent 60%, rgba(255, 201, 60, 0.45) 60%);
  padding: 0 0.125em;
  font-style: italic;
  font-family: var(--font-display);
}

/* Texte barré pour les prix comparés */
.strike {
  text-decoration: line-through;
  text-decoration-color: var(--color-orange);
  text-decoration-thickness: 2px;
  color: var(--color-text-soft);
}

/* Gradient text pour accent */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* ==========================================================
   3. LAYOUT — container & grille
   ========================================================== */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-sm  { max-width: var(--container-sm); }
.container-md  { max-width: var(--container-md); }
.container-lg  { max-width: var(--container-lg); }
.container-xl  { max-width: var(--container-xl); }
.container-2xl { max-width: var(--container-2xl); }

.container-narrow {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Grille utilitaire */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ==========================================================
   4. SECTIONS & SPACING
   ========================================================== */

section {
  padding-block: var(--section-py);
}

.section-sm { padding-block: var(--section-py-sm); }
.section-lg { padding-block: var(--section-py-lg); }

.section-bg      { background-color: var(--color-bg); }
.section-bg-alt  { background-color: var(--color-bg-alt); }
.section-white   { background-color: var(--color-white); }
.section-navy    { background: var(--gradient-navy); color: var(--color-text-on-dark); }
.section-navy h1,
.section-navy h2,
.section-navy h3,
.section-navy h4 { color: var(--color-white); }
.section-navy .lead { color: var(--color-text-on-dark-soft); }

.section-primary { background: var(--gradient-primary); color: var(--color-white); }
.section-primary h1,
.section-primary h2,
.section-primary h3 { color: var(--color-white); }

/* ==========================================================
   5. BOUTONS
   ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--ls-normal);
  text-align: center;
  white-space: nowrap;
  border: var(--border-width-thick) solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  user-select: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* Primary — orange gradient */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #E54E00 0%, #C23D00 100%);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-hover);
}
.btn-primary:active {
  transform: translateY(0);
}

/* Secondary — navy outline */
.btn-secondary {
  background-color: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}
.btn-secondary:hover {
  background-color: var(--color-navy);
  color: var(--color-white);
}

/* Tertiary — white sur navy */
.btn-tertiary {
  background-color: var(--color-white);
  color: var(--color-navy);
  border-color: var(--color-white);
}
.btn-tertiary:hover {
  background-color: transparent;
  color: var(--color-white);
}

/* Ghost — minimal */
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.btn-ghost:hover {
  background-color: rgba(10, 37, 64, 0.06);
  color: var(--color-navy);
}

/* Link style */
.btn-link {
  background: transparent;
  color: var(--color-orange-dark);
  border-color: transparent;
  padding: 0;
  min-height: auto;
  text-decoration: none;
  font-weight: var(--fw-semibold);
}
.btn-link:hover {
  color: var(--color-orange-darker);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Sizes */
.btn-sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}
.btn-lg {
  min-height: 56px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-md);
}
.btn-xl {
  min-height: 64px;
  padding: var(--space-5) var(--space-10);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.btn-full { width: 100%; }

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Icon in button */
.btn svg {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
}

/* ==========================================================
   6. FORMULAIRES
   ========================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-label .required {
  color: var(--color-orange-dark);
  margin-left: 2px;
}

.form-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

.form-control {
  display: block;
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  background-clip: padding-box;
  border: var(--border-width-thick) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-inner);
  transition: var(--transition-colors);
  appearance: none;
}

.form-control::placeholder {
  color: var(--color-text-soft);
  opacity: 1;
}

.form-control:hover {
  border-color: var(--color-border-strong);
}

.form-control:focus,
.form-control:focus-visible {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(255, 107, 26, 0.25);
}

.form-control:disabled {
  background-color: var(--color-gray-lighter);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-control[aria-invalid="true"],
.form-control.is-invalid {
  border-color: var(--color-danger);
}
.form-control[aria-invalid="true"]:focus,
.form-control.is-invalid:focus {
  box-shadow: 0 0 0 var(--focus-ring-width) rgba(220, 38, 38, 0.25);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select custom */
select.form-control {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%230A2540'><path d='M10 12.5l-5-5 1.4-1.4L10 9.7l3.6-3.6L15 7.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 20px;
  padding-right: var(--space-12);
}

/* Radio & checkbox custom */
.form-check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--color-text);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-orange);
  cursor: pointer;
}

/* Error message */
.form-error {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-danger);
  margin-top: var(--space-2);
}

/* Success state */
.form-success {
  padding: var(--space-6);
  background-color: var(--color-mint-light);
  border: var(--border-width-thick) solid var(--color-mint);
  border-radius: var(--radius-md);
  color: var(--color-navy);
  text-align: center;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-gray-light);
  border-radius: var(--radius-full);
  outline: none;
  accent-color: var(--color-orange);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  border: 2px solid var(--color-white);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  border: 2px solid var(--color-white);
}
input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* ==========================================================
   7. CARTES GÉNÉRIQUES
   ========================================================== */

.card {
  background-color: var(--color-bg-card);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: var(--transition-base);
}

.card-hover:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-elevated {
  background-color: var(--color-white);
  border: none;
  box-shadow: var(--shadow-md);
}

.card-padded { padding: var(--space-8); }
.card-padded-lg { padding: var(--space-10); }

@media (min-width: 768px) {
  .card { padding: var(--space-8); }
}

/* ==========================================================
   8. IMAGES & MEDIA WRAPPERS
   ========================================================== */

.img-rounded { border-radius: var(--radius-md); }
.img-lg { border-radius: var(--radius-lg); }
.img-xl { border-radius: var(--radius-xl); }

.aspect-video { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-card { aspect-ratio: 4 / 3; }

/* ==========================================================
   9. UTILITIES
   ========================================================== */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

/* Visibility responsive */
@media (max-width: 639px) {
  .hidden-mobile { display: none !important; }
}
@media (min-width: 640px) {
  .only-mobile { display: none !important; }
}
@media (max-width: 1023px) {
  .hidden-tablet { display: none !important; }
}
@media (min-width: 1024px) {
  .hidden-desktop { display: none !important; }
}

/* Margin helpers (quelques-uns seulement) */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* Rounded */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus,
.sr-only:focus-visible {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
}

/* Skip link (WCAG) */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-3) var(--space-6);
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transform: translateY(-100%);
  transition: transform var(--duration-fast) var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--color-white);
}

/* Divider decoratif */
.divider {
  width: 48px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  margin-block: var(--space-6);
}
.divider-center { margin-inline: auto; }

/* Global focus style (fallback au cas où un élément n'a pas son propre style) */
*:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-xs);
}

/* Retirer le focus par défaut, mais le garder pour navigation clavier */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Sélection de texte */
::selection {
  background-color: var(--color-orange);
  color: var(--color-white);
}

/* Scrollbar stylée (Webkit seulement) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--color-gray);
  border-radius: var(--radius-full);
  border: 3px solid var(--color-bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-navy); }

/* ==========================================================
   10. PRINT
   ========================================================== */

@media print {
  *, *::before, *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  a, a:visited { text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  .site-header, .site-footer, .btn, nav { display: none !important; }
  h1, h2, h3 { page-break-after: avoid; }
  p, img { page-break-inside: avoid; }
  @page { margin: 2cm; }
}
