/* ==========================================================================
   contact.css — Styles du Formulaire de Contact CODALYX
   =========================================================================
   Ce fichier étend auth.css sans le modifier.
   Il reprend exactement les variables CSS de la charte graphique CODALYX :
   - Palette Material 3 (light / dark)
   - Typographie Outfit / Inter
   - Radius, shadows, glassmorphism
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   CARTE CONTACT — Largeur étendue pour le formulaire
   ────────────────────────────────────────────────────────────────────────── */

.contact-wrapper {
  max-width: 800px;
}

/* ──────────────────────────────────────────────────────────────────────────
   SELECT — Champ Sujet
   ────────────────────────────────────────────────────────────────────────── */

.auth-select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 42px;
  font-size: 0.95rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Flèche dropdown custom */
.auth-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.auth-select:hover {
  border-color: var(--m3-outline);
}

.auth-select:focus {
  border-color: var(--m3-primary);
  box-shadow: var(--focus-glow);
}

.auth-select-wrap:focus-within::after {
  border-top-color: var(--m3-primary);
}

/* Option placeholder (grisée) */
.auth-select option[value=""] {
  color: var(--m3-outline);
}

/* ──────────────────────────────────────────────────────────────────────────
   TEXTAREA — Champ Message
   ────────────────────────────────────────────────────────────────────────── */

.auth-textarea {
  width: 100%;
  min-height: 140px;
  max-height: 300px;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  caret-color: var(--accent);
  line-height: 1.6;
}

.auth-textarea::placeholder {
  color: var(--m3-outline);
  opacity: 0.7;
}

.auth-textarea:hover {
  border-color: var(--m3-outline);
}

.auth-textarea:focus {
  border-color: var(--m3-primary);
  box-shadow: var(--focus-glow);
}

/* ──────────────────────────────────────────────────────────────────────────
   COMPTEUR DE CARACTÈRES
   ────────────────────────────────────────────────────────────────────────── */

.char-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
  transition: color 0.2s ease;
}

.char-counter.warning {
  color: #f59e0b;
}

.char-counter.danger {
  color: #ef4444;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────────
   HONEYPOT — Champ caché anti-bot
   ────────────────────────────────────────────────────────────────────────── */

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

/* ──────────────────────────────────────────────────────────────────────────
   CHECKBOX RGPD
   ────────────────────────────────────────────────────────────────────────── */

.rgpd-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .rgpd-field {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(129, 140, 248, 0.15);
}

.rgpd-field:has(.rgpd-checkbox:checked) {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

[data-theme="dark"] .rgpd-field:has(.rgpd-checkbox:checked) {
  background: rgba(16, 185, 129, 0.06);
}

.rgpd-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.rgpd-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   ERREURS SOUS LES CHAMPS
   ────────────────────────────────────────────────────────────────────────── */

.field-error {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 500;
  margin-top: 4px;
  display: none;
  animation: msg-enter 0.25s ease both;
}

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

/* Bordure rouge sur le champ en erreur */
.auth-input.input-error,
.auth-select.input-error,
.auth-textarea.input-error {
  border-color: #ef4444 !important;
}

.rgpd-field.input-error {
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   MESSAGE DE SUCCÈS — Remplace le formulaire après envoi
   ────────────────────────────────────────────────────────────────────────── */

.contact-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  text-align: center;
  animation: card-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.contact-success.visible {
  display: flex;
}

.success-icon {
  font-size: 3rem;
  line-height: 1;
}

.success-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.success-message {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 380px;
}

.success-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.success-back-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────────────────────
   LIEN RETOUR
   ────────────────────────────────────────────────────────────────────────── */

.contact-back {
  display: flex;
  justify-content: center;
  margin-top: -4px;
}

.contact-back-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.contact-back-link:hover {
  color: var(--accent);
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .contact-wrapper {
    max-width: 100%;
  }

  .auth-textarea {
    min-height: 120px;
  }

  .auth-select {
    height: 44px;
  }

  .rgpd-field {
    padding: 10px 12px;
  }

  .rgpd-label {
    font-size: 0.75rem;
  }

  .contact-success {
    padding: 24px 16px;
  }
}
