/* ============================================================
   main.css — Système de design global
   Palette : crème chaud + terracotta + or doux
   Typo : Cormorant Garamond (titres) + Outfit (corps)
   ============================================================ */

/* ─── Import des polices Google Fonts ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Outfit:wght@300;400;500;600&display=swap');

/* ─── Variables CSS (Design tokens) ────────────────────────────────────────── */
:root {
  /* Couleurs – mode clair (défaut) */
  --bg:          #FAF9F7;        /* fond principal crème très doux */
  --surface:     #F3F1EE;        /* cartes, sections alternées */
  --surface-2:   #EAE7E1;        /* hover sur surface */
  --border:      #DDD9D1;        /* séparateurs, contours */
  --text:        #1C1917;        /* texte principal */
  --text-2:      #6B6460;        /* texte secondaire, légendes */
  --text-3:      #9C9490;        /* placeholders, désactivé */

  /* Accent terracotta chaleureux */
  --accent:      #C8622A;
  --accent-h:    #B05525;        /* hover */
  --accent-l:    #F5E6DA;        /* fond clair accent */
  --accent-rgb:  200, 98, 42;

  /* Or doux pour les étoiles, badges premium */
  --gold:        #C49A3C;
  --gold-l:      #FBF3DC;

  /* Noir pour le mode sombre */
  --dark-bg:     #141210;
  --dark-surface:#1E1B18;
  --dark-surface-2: #2A2520;
  --dark-border: #3A3530;
  --dark-text:   #F2EDE8;
  --dark-text-2: #9A9490;

  /* Typographie */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Outfit', 'Segoe UI', system-ui, sans-serif;

  /* Tailles de police */
  --text-xs:   0.72rem;   /* 11.5px */
  --text-sm:   0.85rem;   /* 13.5px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Espacement */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Rayons */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(28,25,23,0.06), 0 1px 2px rgba(28,25,23,0.04);
  --shadow:    0 4px 12px rgba(28,25,23,0.08), 0 2px 4px rgba(28,25,23,0.04);
  --shadow-md: 0 8px 24px rgba(28,25,23,0.10), 0 4px 8px rgba(28,25,23,0.06);
  --shadow-lg: 0 20px 48px rgba(28,25,23,0.14), 0 8px 16px rgba(28,25,23,0.08);
  --shadow-xl: 0 40px 80px rgba(28,25,23,0.20);

  /* Transitions */
  --t-fast: 150ms ease;
  --t:      260ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Largeurs max */
  --max-content: 1200px;
  --max-wide:    1440px;
  --max-text:    680px;
}

/* ─── Mode sombre ───────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:       var(--dark-bg);
  --surface:  var(--dark-surface);
  --surface-2:var(--dark-surface-2);
  --border:   var(--dark-border);
  --text:     var(--dark-text);
  --text-2:   var(--dark-text-2);
  --text-3:   #6A6460;
  --accent-l: #2A1A10;
  --gold-l:   #1E1800;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow:    0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.6);
}

/* ─── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--t), color var(--t);
  overflow-x: hidden;
}

/* ─── Typographie ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl)); font-weight: 300; }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast), opacity var(--t-fast);
}
a:hover { color: var(--accent-h); }

strong { font-weight: 600; }
em { font-style: italic; }

img, video { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

button { cursor: pointer; border: none; background: none; }

/* ─── Layout utilitaires ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.container--wide { max-width: var(--max-wide); }
.container--text { max-width: var(--max-text); }

.section {
  padding: var(--sp-20) 0;
}
.section--sm { padding: var(--sp-12) 0; }
.section--lg { padding: var(--sp-24) 0; }

.section__header {
  margin-bottom: var(--sp-12);
}
.section__title {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  color: var(--text);
  margin-bottom: var(--sp-3);
}
.section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-2);
  font-weight: 300;
  max-width: 500px;
}
.section__header--center {
  text-align: center;
}
.section__header--center .section__subtitle {
  margin: 0 auto;
}

/* ─── Navigation ─────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  transition: background var(--t), box-shadow var(--t);
}

.nav.scrolled {
  background: rgba(250,249,247,0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .nav.scrolled {
  background: rgba(20,18,16,0.92);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: opacity var(--t-fast);
}
.nav__logo:hover { opacity: 0.7; color: var(--text); }
.nav__logo span { color: var(--accent); }
.nav__logo-img { height: 40px; width: auto; display: block; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color var(--t-fast);
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--t);
}
.nav__link:hover,
.nav__link.active { color: var(--text); }
.nav__link:hover::after,
.nav__link.active::after { transform: scaleX(1); }

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.nav__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.nav__icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Badge notifications */
.nav__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-full);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  line-height: 1;
}

/* Menu burger (mobile) */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px 0;
}
.nav__burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t), width var(--t);
}
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile */
.nav__mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-6);
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 99;
  box-shadow: var(--shadow-md);
}
.nav__mobile.open { display: flex; }

.nav__mobile .nav__link {
  font-size: var(--text-base);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

/* ─── Boutons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7em 1.6em;
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all var(--t);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  line-height: 1;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-h);
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
  transform: translateY(-1px);
}
.btn--primary:active { transform: translateY(0); }

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--outline:hover {
  border-color: var(--text-2);
  background: var(--surface);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
}
.btn--ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn--sm { padding: 0.5em 1em; font-size: var(--text-xs); }
.btn--lg { padding: 0.9em 2em; font-size: var(--text-base); }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── Formulaires ────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.02em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75em 1em;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  font-family: var(--font-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-3); }

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6460' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  padding-right: 2.5em;
}

.form-error {
  font-size: var(--text-xs);
  color: #E05252;
  margin-top: var(--sp-1);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: var(--sp-1);
}

/* ─── Badges et étiquettes ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.25em 0.7em;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.badge--available { background: #DBEAFE; color: #1E40AF; }
.badge--reserved  { background: #FEF3C7; color: #92400E; }
.badge--sold      { background: #FCE7F3; color: #9D174D; }
.badge--new       { background: var(--accent-l); color: var(--accent-h); }

/* ─── Toast (notifications flash) ───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--bg);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.toast--success { background: #166534; }
.toast--error   { background: #991B1B; }
.toast--info    { background: #1E3A5F; }

.toast.out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ─── Loader ─────────────────────────────────────────────────────────────────── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-8) 0;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-8);
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--text);
  margin-bottom: var(--sp-3);
}
.footer__brand span { color: var(--accent); }
.footer__logo-img { height: 48px; width: auto; display: block; }

.footer__desc {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 0;
}

.footer__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: var(--sp-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--text-2);
  transition: color var(--t-fast);
}
.footer__link:hover { color: var(--accent); }

.footer__bottom {
  max-width: var(--max-content);
  margin: var(--sp-8) auto 0;
  padding: var(--sp-6) var(--sp-6) 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--text-3);
}

/* ─── Animations globales ────────────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }
.stagger.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 320ms; }
.stagger.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 400ms; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --sp-20: 4rem;
    --sp-24: 5rem;
  }

  .nav__links { display: none; }
  .nav__burger { display: flex; }

  .footer__inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer__bottom { flex-direction: column; gap: var(--sp-2); text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--sp-4); }
  .toast-container { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
}
