/* =========================================
   FICHIER : css/global.css
   ROLE    : Design tokens + Reset + Base UI
   NOTE    : Ne DOIT PAS contenir de styles de page (uniquement global)
   ========================================= */

/* =========================
   1) Design Tokens
   ========================= */
:root{
  /* Couleurs */
  --color-deep: #1e3d59;   /* Bleu pétrole */
  --color-accent: #ff6e40; /* Terracotta */
  --color-sand: #f5f0e1;   /* Sable */
  --color-text: #2d3436;   /* Texte */
  --color-white: #ffffff;

  /* Typo */
  --font-title: "Cormorant Garamond", serif;
  --font-body: "Outfit", sans-serif;

  /* Layout */
  --container-max: 1300px;
  --container-pad: 40px;

  /* Rayons / Ombres */
  --radius-soft: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 15px 35px rgba(30, 61, 89, 0.10);
  --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* =========================
   2) Reset moderne
   ========================= */
*,
*::before,
*::after{
  box-sizing: border-box;
}

html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body{
  margin: 0;
  background: var(--color-sand);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Médias */
img, svg, video, canvas{
  max-width: 100%;
  height: auto;
  display: block;
}

/* Formulaires : héritent de la typo */
input, button, textarea, select{
  font: inherit;
  color: inherit;
}

/* =========================
   3) Typographie
   ========================= */
h1, h2, h3, h4, h5, h6{
  margin: 0 0 0.75rem 0;
  font-family: var(--font-title);
  color: var(--color-deep);
  font-weight: 700;
  line-height: 1.1;
}

h1{
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  letter-spacing: -1px;
}

h2{
  font-size: clamp(1.9rem, 3vw, 3rem);
}

p{
  margin: 0 0 1.4rem 0;
  font-size: 1.05rem;
  color: rgba(45, 52, 54, 0.85);
  font-weight: 300;
}

/* Listes : pas de reset total (utile pour contenus) */
ul, ol{
  margin: 0 0 1.2rem 1.2rem;
  padding: 0;
}

li{
  margin: 0.25rem 0;
}

/* =========================
   4) Liens (cohérents partout)
   ========================= */
a{
  color: var(--color-deep);
  text-decoration: none;
  transition: color .25s var(--ease), text-decoration-color .25s var(--ease);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 110, 64, 0.0);
}

a:hover{
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(255, 110, 64, 0.55);
}

/* Liens “bouton” : on laisse components.css gérer les classes.
   Ici on ne force pas. */

/* =========================
   5) Container
   ========================= */
.container{
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  position: relative;
  z-index: 1;
}

@media (max-width: 900px){
  :root{ --container-pad: 20px; }
}

/* =========================
   6) Accessibilité / Focus
   ========================= */
:focus-visible{
  outline: 3px solid rgba(255, 110, 64, 0.65);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Réduction des animations si besoin */
@media (prefers-reduced-motion: reduce){
  *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* =========================
   7) Reveal animations
   IMPORTANT : on NE met PAS .active global !
   ========================= */
.reveal,
.reveal-text,
.reveal-img{
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.reveal.active,
.reveal-text.active,
.reveal-img.active{
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   8) Cookie banner (global)
   ========================= */
.cookie-banner{
  position: fixed;
  left: 0;
  bottom: -140px;
  width: 100%;
  padding: 18px 16px;
  background: #152a3d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  transition: bottom 0.5s ease;
}

.cookie-banner.show{
  bottom: 0;
}

.cookie-banner p{
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
}

.cookie-banner a{
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(255, 110, 64, 0.6);
}

.btn-cookie{
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

.btn-cookie:hover{
  background: #fff;
  color: var(--color-accent);
  transform: translateY(-1px);
}

@media (max-width: 600px){
  .cookie-banner{
    flex-direction: column;
    text-align: center;
  }
}

/* =========================================
   RGPD + Fallback no-js (anti site "bloqué")
   ========================================= */

/* Si JS ne charge pas : on ne masque rien */
.no-js .intro-loader,
.no-js .page-loader { display: none !important; }

.no-js .reveal,
.no-js .reveal-text,
.no-js .reveal-img{
  opacity: 1 !important;
  transform: none !important;
}

/* Cookie banner */
.cookie-banner{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12000;
  padding: 14px;
  background: rgba(255,255,255,0.92);
  border-top: 1px solid rgba(30,61,89,0.12);
  backdrop-filter: blur(10px);
}

.cookie-banner__inner{
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.cookie-banner__text p{
  margin: 6px 0 0;
  color: rgba(45,52,54,0.82);
}

.cookie-banner__actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Cookie modal */
.cookie-modal{ position: fixed; inset: 0; z-index: 13000; }
.cookie-modal__backdrop{
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.cookie-modal__panel{
  position: relative;
  max-width: 720px;
  margin: 7vh auto 0;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(30,61,89,0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.cookie-modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(30,61,89,0.10);
}
.cookie-modal__content{ padding: 16px 18px; }
.cookie-modal__footer{
  padding: 14px 18px;
  border-top: 1px solid rgba(30,61,89,0.10);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.cookie-modal__close{
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.cookie-option{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,61,89,0.08);
}
.cookie-option p{
  margin: 6px 0 0;
  color: rgba(45,52,54,0.78);
}
.cookie-note{
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: rgba(45,52,54,0.72);
}

/* Pills */
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  background: rgba(30,61,89,0.10);
  color: rgba(30,61,89,0.92);
}
.pill--on{ background: rgba(46, 204, 113, 0.18); color: rgba(30,61,89,0.92); }

/* Switch */
.switch{ position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input{ opacity: 0; width: 0; height: 0; }
.slider{
  position: absolute; inset: 0;
  cursor: pointer;
  background: rgba(30,61,89,0.18);
  border-radius: 999px;
  transition: .2s;
}
.slider:before{
  content: "";
  position: absolute;
  height: 22px; width: 22px;
  left: 4px; top: 4px;
  background: white;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.switch input:checked + .slider{
  background: rgba(255,110,64,0.65);
}
.switch input:checked + .slider:before{
  transform: translateX(22px);
}

@media (max-width: 820px){
  .cookie-banner__inner{ grid-template-columns: 1fr; }
  .cookie-banner__actions{ justify-content: flex-start; }
  .cookie-modal__panel{ margin: 10vh 14px 0; }
}