﻿/* ============================================================
   contact.css — Styles autonomes du composant contact-widget
   Aucune dépendance externe (zéro Bootstrap, zéro CDN)
   ============================================================ */

/* ===== TOKENS (variables CSS intégrées) ===== */
/* Valeurs de fallback — surchargées par theme.css (chargé avant ce fichier) */
:root {
  --cw-font:           system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Couleurs de marque — fallback = landing page PlannerWP */
  --cw-brand-1:        #2563EB;
  --cw-brand-1-dark:   #1E40AF;
  --cw-brand-2:        #22D3EE;
  --cw-brand-2-hover:  #06B6D4;
  --cw-brand-contrast: #ffffff;
  --cw-muted:          #64748B;

  /* Fond de section */
  --cw-section-bg:     linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #0e7490 100%);

  /* Champs de formulaire */
  --cw-radius:          12px;
  --cw-input-bg:        rgba(255, 255, 255, 0.12);
  --cw-input-bg-focus:  rgba(255, 255, 255, 0.22);
  --cw-input-border:    rgba(255, 255, 255, 0.30);
  --cw-input-color:     #ffffff;
  --cw-input-ph:        rgba(255, 255, 255, 0.55);
  --cw-focus-ring:      rgba(34, 211, 238, 0.35);
}

/* ===== RESET MINIMAL ===== */
.cw-section *,
.cw-section *::before,
.cw-section *::after {
  box-sizing: border-box;
}

/* ===== SECTION WRAPPER ===== */
.cw-section {
  background: var(--cw-section-bg);
  color: var(--cw-brand-contrast);
  padding: 5rem 1.5rem;
  font-family: var(--cw-font);
}

/* ===== EN-TÊTE DE SECTION ===== */
.cw-section__header {
  max-width: 48rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.cw-section__header h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  color: var(--cw-brand-contrast);
}

.cw-section__header p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* ===== FORMULAIRE ===== */
.cw-form {
  max-width: 48rem;
  margin: 0 auto;
}

/* Grille 2 colonnes (responsive) */
.cw-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

@media (min-width: 640px) {
  .cw-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
  }
}

/* Champ individuel */
.cw-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
}

.cw-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cw-brand-contrast);
}

.cw-field input,
.cw-field select,
.cw-field textarea {
  border-radius: var(--cw-radius);
  border: 1px solid var(--cw-input-border);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  background-color: var(--cw-input-bg);
  color: var(--cw-input-color);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.cw-field select {
  cursor: pointer;
  appearance: none;
  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='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.cw-field select option {
  background-color: var(--cw-brand-1-dark);
  color: #ffffff;
}

.cw-field input::placeholder,
.cw-field textarea::placeholder {
  color: var(--cw-input-ph);
}

.cw-field textarea {
  resize: vertical;
  min-height: 150px;
}

.cw-field input:focus,
.cw-field select:focus,
.cw-field textarea:focus {
  outline: none;
  border-color: var(--cw-brand-2);
  background-color: var(--cw-input-bg-focus);
  box-shadow: 0 0 0 3px var(--cw-focus-ring);
}

/* Champ honeypot — toujours caché */
.cw-honeypot {
  display: none !important;
  visibility: hidden;
}

/* ===== BOUTON ===== */
.cw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--cw-radius);
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  margin-top: 0.5rem;
}

.cw-btn:hover {
  transform: translateY(-1px);
}

.cw-btn--primary {
  background-color: var(--cw-brand-2);
  border-color: var(--cw-brand-2);
  color: var(--cw-brand-contrast);
}

.cw-btn--primary:hover {
  background-color: var(--cw-brand-2-hover);
  border-color: var(--cw-brand-2-hover);
  color: var(--cw-brand-contrast);
}

.cw-btn:disabled,
.cw-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== ALERTE FEEDBACK ===== */
.cw-alert {
  display: none;
  border-radius: var(--cw-radius);
  padding: 0.85rem 1.1rem;
  font-size: 0.93rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  border: 1px solid transparent;
}

.cw-alert.is-visible {
  display: block;
}

.cw-alert--success {
  background-color: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.cw-alert--danger {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ===== MENTION RGPD ===== */
.cw-rgpd {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

/* ===== EXTENSIBILITÉ — champs checkbox / radio ===== */
/* Utilisez ces classes pour de futurs champs booléens ou à choix multiples. */

.cw-field--check,
.cw-field--radio {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
}

.cw-field--check input[type="checkbox"],
.cw-field--radio  input[type="radio"] {
  /* Réinitialise les styles hérités (.cw-field input) */
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  background-color: var(--cw-input-bg);
  border: 2px solid var(--cw-input-border);
  border-radius: 0.2rem;         /* carré pour checkbox */
  padding: 0;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cw-field--radio input[type="radio"] {
  border-radius: 50%;            /* rond pour radio */
}

.cw-field--check input[type="checkbox"]:checked,
.cw-field--radio  input[type="radio"]:checked {
  background-color: var(--cw-brand-2);
  border-color: var(--cw-brand-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5l2.5 2.5L8 3' stroke='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.cw-field--check input[type="checkbox"]:focus,
.cw-field--radio  input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--cw-focus-ring);
}

.cw-field--check label,
.cw-field--radio  label {
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  line-height: 1.4;
}
