/* ═══════════════════════════════════════════════════════════════
   STYLE.CSS — Feuille de styles
   ═══════════════════════════════════════════════════════════════
   Ce fichier contient TOUTE l'apparence de la page :
   couleurs, tailles, polices, animations, mise en page.

   Les commentaires CSS s'écrivent : (slash-étoile ... étoile-slash)
   Pas de // comme en JavaScript.
═══════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────
   📘 COURS CSS #1 — VARIABLES (custom properties)
   :root cible la racine du document (toute la page).
   On déclare des variables avec --nom: valeur;
   On les réutilise partout avec var(--nom)

   Avantage : changer une couleur ici = répercuté partout.
───────────────────────────────────────────────────────────── */
:root {
  /* Palette de couleurs */
  --noir:       #0a0a0a;
  --blanc:      #fafafa;
  --gris-clair: #f2f2f2;
  --gris-bord:  #d0d0d0;
  --gris-texte: #6b6b6b;
  --erreur:     #c0392b;

  /* Typographie */
  --font-titre: 'Cormorant Garamond', serif;
  --font-corps: 'DM Sans', sans-serif;

  /* Espacements / effets */
  --radius:     4px;
  --transition: 0.25s ease;
}


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


body {
  font-family: var(--font-corps);
  background-color: var(--blanc);
  color: var(--noir);
  min-height: 100vh; /* vh = viewport height. 100vh = écran entier */
  line-height: 1.6;  /* interligne = 1.6× la taille de la police */
}

header {
  padding: 24px 40px;
  border-bottom: 1px solid var(--gris-clair);
  display: flex;
  align-items: center;            /* centre verticalement */
  justify-content: space-between; /* logo à gauche, badge à droite */
}

.logo {
  font-family: var(--font-titre);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.08em; /* espace entre les lettres */
  text-transform: uppercase;
}

/* .logo span = cible les <span> à l'intérieur de .logo */
.logo span {
  font-weight: 300;
  color: var(--gris-texte);
}

.header-badge {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gris-texte);
  border: 1px solid var(--gris-bord);
  padding: 6px 14px;
  border-radius: 20px; /* très arrondi = pilule */
}

.hero {
  text-align: center;
  padding: 64px 24px 52px;
  border-bottom: 1px solid var(--gris-clair);
}

.hero-label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gris-texte);
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-titre);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
}

.hero p {
  color: var(--gris-texte);
  font-size: 0.92rem;
  max-width: 460px;
  margin: 0 auto; /* 0 haut/bas, auto gauche/droite = centré horizontalement */
}


main {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}

.form-section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: baseline; /* aligne sur la ligne de base du texte */
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gris-clair);
}

.section-num {
  font-family: var(--font-titre);
  font-size: 2.2rem;
  font-weight: 300;
  color: #8a8a8a; /* #d0d0d0 échouait WCAG (ratio 1.47) — 8a8a8a = 3.3:1 ✓ */
  line-height: 1;
}

.section-title {
  font-family: var(--font-titre);
  font-size: 1.35rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}


.full-width {
  grid-column: 1 / -1;
}


.field-group {
  display: flex;
  flex-direction: column; /* empile label + input verticalement */
  gap: 6px;
}

label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gris-texte);
  font-weight: 500;
}

.required {
  color: var(--noir);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--gris-bord);
  border-radius: var(--radius);
  font-family: var(--font-corps);
  font-size: 0.92rem;
  color: var(--noir);
  background: var(--blanc);
  outline: none; /* retire le contour bleu par défaut */
  appearance: none;
  -webkit-appearance: none;
  /* transition = animation douce sur les propriétés listées */
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus {
  border-color: var(--noir);
  /* box-shadow: décalageX décalageY flou expansion couleur */
  box-shadow: 0 0 0 3px rgba(10,10,10,0.07);
}

/* Classe ajoutée par JS quand la validation échoue */
input.error,
select.error {
  border-color: var(--erreur);
}


select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b6b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}


/* Input avec unité (cm) */
.input-with-unit {
  position: relative; /* requis pour positionner .unit en absolute À L'INTÉRIEUR */
}

.input-with-unit input {
  padding-right: 48px; /* espace à droite pour l'unité */
}

.unit {
  position: absolute; /* sort du flux normal */
  right: 14px;
  top: 50%;
  transform: translateY(-50%); /* centrage vertical parfait */
  font-size: 0.75rem;
  color: var(--gris-texte);
  pointer-events: none; /* le clic passe à travers vers l'input */
}


/* Message d'erreur — caché par défaut, JS le rend visible */
.field-error {
  font-size: 0.72rem;
  color: var(--erreur);
  display: none;
}

.field-error.visible {
  display: block;
}


.uploads-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.upload-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-zone {
  position: relative; /* requis pour positionner l'input en absolute */
  border: 1.5px dashed var(--gris-bord);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--gris-clair);
  transition: all var(--transition);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover {
  border-color: var(--noir);
  background: #ebebeb;
}

.upload-zone.has-photo {
  border-style: solid;
  border-color: var(--noir);
  padding: 0;
}

/* L'input invisible par-dessus toute la zone */
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0; /* raccourci : top:0; right:0; bottom:0; left:0; */
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2; /* couche d'empilement, par-dessus le placeholder */
}

.upload-placeholder {
  pointer-events: none; /* clics passent à travers vers l'input */
}

.upload-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.upload-label-main {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--noir);
  margin-bottom: 4px;
}

.upload-label-sub {
  font-size: 0.72rem;
  color: var(--gris-texte);
}

.upload-preview {
  display: none; /* caché par défaut, JS l'affiche */
  width: 100%;
  height: 180px;
  object-fit: cover;     /* remplit le cadre sans déformer */
  object-position: top;  /* cadre sur le haut (visage) */
  border-radius: var(--radius);
}


/* ─────────────────────────────────────────────────────────────
   📘 COURS CSS #11 — RADIOS STYLISÉS
   On cache le vrai radio et on stylise un <span> à la place.
   Quand le radio est :checked, on cible le span voisin avec ~

   ~ = sélecteur "frère général" → un élément qui suit dans le HTML.
   input:checked ~ span → le span qui suit un input coché.
───────────────────────────────────────────────────────────── */
.size-selector {
  display: flex;
  flex-wrap: wrap; /* passe à la ligne si pas assez de place */
  gap: 10px;
  margin-top: 4px;
}

.size-btn {
  position: relative;
  cursor: pointer;
}

/* On cache le vrai bouton radio */
.size-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Le "faux" bouton visible */
.size-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--gris-bord);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gris-texte);
  transition: all var(--transition);
  user-select: none; /* empêche la sélection de texte au clic */
}

.size-btn:hover span {
  border-color: var(--noir);
  color: var(--noir);
}

/* Quand le radio est coché → on stylise le span voisin */
.size-btn input[type="radio"]:checked ~ span {
  background: var(--noir);
  border-color: var(--noir);
  color: var(--blanc);
  font-weight: 600;
}


/* ─────────────────────────────────────────────────────────────
   📘 COURS CSS #12 — PSEUDO-ÉLÉMENTS ::before / ::after
   Permettent d'ajouter un élément visuel SANS HTML.
   content: '' est OBLIGATOIRE pour qu'ils s'affichent.
   Ici : effet de brillance qui glisse au survol du bouton.
───────────────────────────────────────────────────────────── */
.form-footer {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-submit {
  background: var(--noir);
  color: var(--blanc);
  border: none;
  padding: 18px 64px;
  font-family: var(--font-corps);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden; /* cache le ::before quand il dépasse */
  transition: box-shadow var(--transition), transform var(--transition);
}

/* Le pseudo-élément ::before = effet de brillance */
.btn-submit::before {
  content: ''; /* obligatoire */
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%); /* caché à gauche par défaut */
  transition: transform 0.35s ease;
}

/* Au survol, on fait glisser ::before de gauche à droite */
.btn-submit:hover::before {
  transform: translateX(0);
}

.btn-submit:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  transform: translateY(-1px); /* légère élévation */
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-note {
  font-size: 0.75rem;
  color: var(--gris-texte);
}


/* Message de succès */
.success-message {
  display: none;
  text-align: center;
  padding: 80px 24px;
}

.success-message.visible {
  display: block;
}

.success-icon {
  font-size: 2.8rem;
  margin-bottom: 20px;
}

.success-message h2 {
  font-family: var(--font-titre);
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 10px;
}

.success-message p {
  color: var(--gris-texte);
  font-size: 0.9rem;
}

.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (max-width: 640px) {
  header {
    padding: 16px 20px;
  }

  .logo {
    font-size: 1.2rem;
  }

  main {
    padding: 36px 16px 80px;
  }

  /* Sur mobile : tout passe à 1 colonne */
  .form-grid,
  .uploads-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: 1; /* plus besoin de s'étendre, il n'y a qu'une colonne */
  }
}