/* ================================================================
   contact.css — Les Lames de la Rose
   Styles spécifiques à la page Contact.

   TABLE DES MATIÈRES
   ------------------------------------------------------------------
   1.  Champs de formulaire (input, select, textarea)
   2.  Select stylisé (wrapper + chevron custom)
   3.  Compteur de caractères
   4.  Checkbox RGPD custom
   5.  Bouton d'envoi
   6.  Message de succès
   7.  Horaires de l'atelier
   8.  FAQ — accordion (open/close au clic)
   9.  Media queries (≤ 900px)
================================================================ */


/* ----------------------------------------------------------------
   1. CHAMPS DE FORMULAIRE
   Surcharge les styles de pages.css pour les affiner ici.
   Tous les inputs/textarea partagent le même look.
---------------------------------------------------------------- */

/* Label de champ */
.contact-form .form-group label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.55rem;
}

/* Indicateur "(optionnel)" dans le label */
.optional-tag {
  font-family: 'Raleway', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--white-dim);
  margin-left: 0.3rem;
}

/* Indicateur champ obligatoire */
.required-star {
  color: #c0392b;
  margin-left: 2px;
}

/* Style commun : input et textarea */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"] {
  width: 100%;
  background: var(--dark-card);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  /* Supprime l'apparence native */
  -webkit-appearance: none;
  appearance: none;
}

/* Focus : bordure dorée + légère lueur */
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form input[type="tel"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

/* Placeholder en gris discret */
.contact-form input::placeholder {
  color: rgba(158, 150, 137, 0.4);
  font-style: italic;
}

/* Textarea */
.contact-form textarea {
  width: 100%;
  background: var(--dark-card);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  padding: 0.85rem 1rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  resize: vertical;
  min-height: 150px;
  line-height: 1.7;
}

.contact-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.contact-form textarea::placeholder {
  color: rgba(158, 150, 137, 0.4);
  font-style: italic;
}

/* Champ en erreur (après validation) */
.contact-form input.error,
.contact-form select.error,
.contact-form textarea.error,
.rgpd-label.error .rgpd-check {
  border-color: #c0392b !important;
}


/* ----------------------------------------------------------------
   2. SELECT STYLISÉ
   Le <select> natif est masqué par un wrapper relatif et un
   chevron SVG custom positionné à droite.
---------------------------------------------------------------- */

/* Conteneur du select : positionné pour accueillir la flèche */
.select-wrapper {
  position: relative;
}

/* Le select prend toute la largeur du wrapper */
.contact-form select {
  width: 100%;
  background: var(--dark-card);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  padding: 0.85rem 2.5rem 0.85rem 1rem; /* Espace à droite pour la flèche */
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  /* Supprime la flèche native du navigateur */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.contact-form select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

/* Option par défaut grisée */
.contact-form select option[value=""] {
  color: rgba(158, 150, 137, 0.5);
}

/* Options normales : fond sombre (navigateurs supportant la couleur) */
.contact-form select option {
  background: var(--dark-card);
  color: var(--white);
}

/* Flèche SVG positionnée à droite du select */
.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none; /* La flèche ne bloque pas les clics sur le select */
  transition: transform 0.3s ease;
}

/* Rotation de la flèche quand le select est ouvert (focus) */
.select-wrapper:focus-within .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}


/* ----------------------------------------------------------------
   3. COMPTEUR DE CARACTÈRES
   Affiché sous le textarea, mis à jour en temps réel par le JS.
---------------------------------------------------------------- */
.contact-char-count {
  font-size: 0.72rem;
  color: rgba(158, 150, 137, 0.4);
  text-align: right;
  margin-top: 0.4rem;
  font-style: italic;
  transition: color 0.3s;
}

/* Couleur dorée quand on approche de la limite (> 800 sur 1000) */
.contact-char-count.near-limit {
  color: var(--gold);
}


/* ----------------------------------------------------------------
   4. CHECKBOX RGPD CUSTOM
   Remplace la checkbox native par un carré stylisé avec coche SVG.
---------------------------------------------------------------- */

/* Conteneur de la ligne RGPD */
.rgpd-label {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  cursor: pointer;
}

/* Masque la checkbox native tout en la gardant accessible */
.rgpd-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Carré custom qui remplace la checkbox */
.rgpd-check {
  width: 18px;
  height: 18px;
  min-width: 18px;   /* Empêche le carré de rétrécir */
  border: 1px solid var(--border);
  background: var(--dark-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: border-color 0.25s, background 0.25s;
}

/* Coche SVG invisible par défaut */
.rgpd-check svg {
  opacity: 0;
  transition: opacity 0.2s;
}

/* Quand la checkbox est cochée : bordure dorée + coche visible */
.rgpd-label input[type="checkbox"]:checked ~ .rgpd-check {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

.rgpd-label input[type="checkbox"]:checked ~ .rgpd-check svg {
  opacity: 1;
}

/* Texte RGPD */
.rgpd-text {
  font-size: 0.78rem;
  color: rgba(240, 235, 227, 0.5);
  line-height: 1.7;
}


/* ----------------------------------------------------------------
   5. BOUTON D'ENVOI
   Reprend l'esthétique du site avec l'effet slide doré.
---------------------------------------------------------------- */

/* Bouton principal du formulaire contact */
.contact-submit {
  width: 100%;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--white);
  padding: 1.1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.35s, border-color 0.35s;
  margin-top: 0.5rem;
}

/* Fond doré qui glisse de gauche à droite au survol */
.contact-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateX(-101%);
  transition: transform 0.35s ease;
  z-index: -1;
}

.contact-submit:hover {
  color: var(--black);
  border-color: var(--gold);
}

.contact-submit:hover::before {
  transform: translateX(0);
}

.contact-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.contact-form-error {
  margin: 16px 0 0;
  color: #d99a86;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}


/* ----------------------------------------------------------------
   6. MESSAGE DE SUCCÈS
   Remplace le formulaire après envoi.
---------------------------------------------------------------- */
.contact-success {
  text-align: center;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.contact-success svg {
  flex-shrink: 0;
}

.contact-success h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.contact-success p {
  font-size: 0.88rem;
  color: rgba(240, 235, 227, 0.6);
  line-height: 1.85;
  max-width: 360px;
}


/* ----------------------------------------------------------------
   7. HORAIRES DE L'ATELIER
   Tableau de jours / horaires avec ligne "Fermé" grisée.
---------------------------------------------------------------- */

/* Titre de la section horaires */
.contact-hours {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-hours h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}

/* Grille des horaires */
.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
}

/* Ligne jour / horaire */
.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-row:hover {
  background: rgba(201, 168, 76, 0.03);
}

/* Nom du jour */
.hours-day {
  font-size: 0.82rem;
  color: rgba(240, 235, 227, 0.65);
}

/* Horaire */
.hours-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.92rem;
  color: var(--white);
  font-weight: 300;
}

/* Ligne "Fermé" : grisée */
.hours-row--closed .hours-day,
.hours-row--closed .hours-time {
  color: rgba(158, 150, 137, 0.35);
}

/* Note sous les horaires */
.hours-note {
  font-size: 0.75rem;
  color: rgba(158, 150, 137, 0.4);
  font-style: italic;
  margin-top: 0.8rem;
  line-height: 1.6;
}


/* ----------------------------------------------------------------
   8. FAQ — ACCORDION
   Chaque item peut être ouvert/fermé au clic.
   La réponse se déploie avec une transition sur max-height.
---------------------------------------------------------------- */

/* Override : la grille FAQ est déjà définie dans pages.css.
   On ajoute ici uniquement le comportement accordion. */

/* Bouton d'ouverture (le h4 devient cliquable) */
.faq-item {
  cursor: pointer;
}

.faq-item h4 {
  /* Ajoute une icône "+" / "−" à droite via ::after */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 0;   /* Annule le padding-right hérité */
  padding-left: 1.2rem;
}

/* Icône "+" par défaut, "−" quand ouvert */
.faq-item h4::after {
  content: '+';
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  /* N'hérite pas du pseudo-élément "—" défini dans pages.css */
  position: static;
  left: auto;
  top: auto;
  opacity: 1;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

/* Quand l'item est ouvert : rotation du "+" → "×" */
.faq-item.open h4::after {
  content: '−';
}

/* Corps de la réponse : masqué par défaut via max-height */
.faq-item p {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.4s ease, margin-top 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

/* Ouvert : révèle le texte */
.faq-item.open p {
  max-height: 200px;       /* Valeur supérieure à la hauteur max du texte */
  margin-top: 0.8rem;
  opacity: 1;
}


/* ----------------------------------------------------------------
   9. MEDIA QUERIES (≤ 900px)
   Les styles de .contact-grid et .contact-form-row sont déjà
   gérés dans pages.css. On surcharge ici ce qui reste.
---------------------------------------------------------------- */
@media (max-width: 900px) {

  .contact-page-banner .page-banner-bg {
    background-position: center;
  }

  /* Formulaire en colonne sur mobile */
  .contact-form-row {
    grid-template-columns: 1fr;
  }

  /* Horaires : padding réduit */
  .contact-hours {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
}
.contact-page-banner .page-banner-bg {
  background-position: center 43%;
}
