/******************************
 * XW Conseil — Base globale  *
 ******************************/

/* ========== Variables globales ========== */
:root {
  /* Couleurs */
  --c-primary: #12354A;
  --c-primary-dark: #0d2433;
  --c-bg: #FFFFFF;
  --c-text: #333333;
  --c-muted: #E8E4DB;
  --c-beige: #f6f2ea;

  /* Accents */
  --c-accent: #12354A;
  --c-accent-2: #5A7B8C;
  --c-accent-3: #6A2E2E;
  --c-accent-4: #B0B8BC;
  --c-accent-5: #748F6C;
  --c-accent-6: #CDA349;
  --c-gold: var(--c-accent-6);

  /* Typos */
  --ff-title: "Garamond", serif;
  --ff-body: "Cambria", serif;
  --ff-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Layout & effets */
  --container-w: 1100px;
  --pad-x: 24px;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(18,53,74,.12);

  /* Dimensions */
  --logo-h: 100px;
  --header-height: 72px;
}

/* Palette nuit automatique : on garde la palette claire par défaut pour éviter les inversions inattendues */
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #FFFFFF;
    --c-text: #333333;
    --c-muted: #E8E4DB;
    --c-beige: #f6f2ea;
    --c-accent-4: #B0B8BC;
  }
}

body[data-theme="dark"] {
  --c-bg: #0b1c28;
  --c-text: #e6eef5;
  --c-muted: #102738;
  --c-accent-4: #203548;
}

/* ========== Reset & base ========== */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-body);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}

body.no-scroll {
  overflow: hidden;
}

main { flex: 1; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--container-w);
  margin: auto;
  padding: 0 var(--pad-x);
}

h1, h2, h3, h4 {
  color: var(--c-primary);
  margin: 0 0 .6rem;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--ff-title);
  font-size: clamp(2rem, 3vw + 1rem, 2.8rem);
  line-height: 1.2;
}

h2 {
  font-family: var(--ff-ui);
  font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem);
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--ff-ui);
  font-size: 1.2rem;
  font-weight: 650;
}

p {
  font-size: 1.05rem;
  color: var(--c-text);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4 {
  color: #e6eef5;
}

body[data-theme="dark"] p {
  color: #d9e5ef;
}

/* Focus accessible */
:where(a, button, .btn, input, select, textarea):focus {
  outline: 2px solid #8fb7ff;
  outline-offset: 2px;
}

/* ========== Formulaires ========== */
input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #ccd2d8;
  border-radius: 8px;
  font-family: var(--ff-ui);
  margin-bottom: 14px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--c-accent-6);
  border-color: var(--c-accent-6);
}

textarea {
  resize: none;
}

.contact-form textarea {
  min-height: 220px;
}

/* Masqué visuellement mais accessible */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Mode sombre : surfaces clés */
body[data-theme="dark"] .card,
body[data-theme="dark"] .card.hoverable,
body[data-theme="dark"] .card-inputs,
body[data-theme="dark"] .card-results,
body[data-theme="dark"] .contact-form,
body[data-theme="dark"] .pillars .pillar-card,
body[data-theme="dark"] .process .step,
body[data-theme="dark"] .trust-grid .card,
body[data-theme="dark"] .testimonial-grid .card {
  background: #102438;
  color: #e6eef5;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

body[data-theme="dark"] .section.alt {
  background: #0f1f2f;
}

body[data-theme="dark"] header.site-header {
  background: rgba(11,28,40,0.9);
  border-bottom-color: rgba(255,255,255,0.08);
}

body[data-theme="dark"] footer {
  background: linear-gradient(180deg, #081520 0%, #0c1f2e 100%);
}

body[data-theme="dark"] .hero-secondary {
  background: #e6eef5;
  color: #0d2433;
  border-color: #e6eef5;
}

/* ========== Tableaux simples ========== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

/* ========== Utilitaires ========== */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ========== Animations premium / utilitaires ========== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.glow-border { position: relative; }
.glow-border::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(205,163,73,.4), rgba(18,53,74,.28));
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 0;
}

.glow-border > * { position: relative; z-index: 1; }

.glow-border:hover::after { opacity: 1; }

.pill { border-radius: 999px !important; }

.lux-gold-text { color: var(--c-gold); }

@keyframes pulse-soft {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes underline-sweep {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}
