/* ============================================================
   NOUS FOREZ — Formulaires mobile-first
   Fichier : nous-forez-theme/css/mobile-forms.css
   ============================================================
   Couvre : [nf_register], formulaire création action,
   formulaire dépôt source histoire, filtres agenda/annuaire.
   ============================================================ */

/* ── RESET BASE FORMULAIRES ─────────────────────────────────── */
@media (max-width: 768px) {

  /* Conteneur principal des formulaires du plugin */
  .nf-form-wrap,
  .nf-register-form,
  .nf-action-form,
  .nf-source-form {
    padding: 20px 16px;
    margin: 0;
  }

  /* ── CHAMPS TEXTE / EMAIL / TEL / SELECT ── */
  .nf-form-wrap input[type="text"],
  .nf-form-wrap input[type="email"],
  .nf-form-wrap input[type="tel"],
  .nf-form-wrap input[type="url"],
  .nf-form-wrap input[type="date"],
  .nf-form-wrap input[type="time"],
  .nf-form-wrap input[type="number"],
  .nf-form-wrap input[type="password"],
  .nf-form-wrap textarea,
  .nf-form-wrap select {
    /* Taille minimum 16px pour éviter le zoom auto iOS */
    font-size: 16px !important;
    font-family: 'Inter', sans-serif;

    width: 100%;
    box-sizing: border-box;

    padding: 14px 16px;
    border: 1.5px solid rgba(31, 31, 31, 0.2);
    border-radius: 4px;
    background: #fff;
    color: var(--nf-black, #1F1F1F);
    line-height: 1.5;

    appearance: none;
    -webkit-appearance: none;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .nf-form-wrap input:focus,
  .nf-form-wrap textarea:focus,
  .nf-form-wrap select:focus {
    outline: none;
    border-color: var(--nf-pink, #F62DAE);
    box-shadow: 0 0 0 3px rgba(246, 45, 174, 0.12);
  }

  /* Hauteur textarea confortable */
  .nf-form-wrap textarea {
    min-height: 120px;
    resize: vertical;
  }

  /* ── SELECT : flèche custom ── */
  .nf-form-wrap .nf-field-select {
    position: relative;
  }

  .nf-form-wrap .nf-field-select::after {
    content: '';
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--nf-gray, #333);
  }

  /* ── LABELS ── */
  .nf-form-wrap label,
  .nf-form-wrap .nf-field-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nf-gray, #333333);
    margin-bottom: 6px;
  }

  /* Indication champ obligatoire */
  .nf-form-wrap label .required,
  .nf-form-wrap .nf-field-label .required {
    color: var(--nf-pink, #F62DAE);
    margin-left: 2px;
  }

  /* ── GROUPES DE CHAMPS ── */
  .nf-form-wrap .nf-field-group,
  .nf-form-wrap .nf-field-row {
    margin-bottom: 20px;
  }

  /* Deux colonnes → une seule colonne sur mobile */
  .nf-form-wrap .nf-grid-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* ── RADIO / CHECKBOX — toggle type individu/orga ── */
  .nf-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
  }

  .nf-type-toggle input[type="radio"] {
    display: none;
  }

  .nf-type-toggle label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border: 1.5px solid rgba(31, 31, 31, 0.2);
    border-radius: 4px;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 500 !important;
    cursor: pointer;
    text-align: center;
    color: var(--nf-gray, #333);
    transition: all 0.15s ease;
    background: #fff;
    /* Touch target minimum 48px */
    min-height: 48px;
  }

  .nf-type-toggle input[type="radio"]:checked + label {
    background: var(--nf-black, #1F1F1F);
    border-color: var(--nf-black, #1F1F1F);
    color: var(--nf-cream, #F7F5F0);
  }

  /* ── CHECKBOXES THÈMES — chips horizontales scrollables ── */
  .nf-themes-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }

  .nf-theme-chip {
    display: inline-flex;
    align-items: center;
  }

  .nf-theme-chip input[type="checkbox"] {
    display: none;
  }

  .nf-theme-chip label {
    padding: 8px 14px;
    border: 1.5px solid rgba(31, 31, 31, 0.2);
    border-radius: 20px;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    color: var(--nf-gray, #333);
    background: #fff;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .nf-theme-chip input[type="checkbox"]:checked + label {
    background: var(--nf-pink, #F62DAE);
    border-color: var(--nf-pink, #F62DAE);
    color: #fff;
  }

  /* ── SECTIONS / ÉTAPES DU FORMULAIRE ── */
  .nf-form-section {
    border-top: 1px solid rgba(31, 31, 31, 0.1);
    padding-top: 20px;
    margin-top: 4px;
  }

  .nf-form-section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.05em;
    color: var(--nf-black, #1F1F1F);
    margin-bottom: 16px;
  }

  /* ── BOUTON SUBMIT ── */
  .nf-form-wrap .nf-submit,
  .nf-form-wrap button[type="submit"],
  .nf-form-wrap input[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    letter-spacing: 0.1em;
    background: var(--nf-black, #1F1F1F);
    color: var(--nf-cream, #F7F5F0);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    /* Touch target */
    min-height: 52px;
    transition: background 0.15s ease;
    -webkit-appearance: none;
  }

  .nf-form-wrap .nf-submit:active,
  .nf-form-wrap button[type="submit"]:active {
    background: var(--nf-pink, #F62DAE);
  }

  /* ── MESSAGES D'ERREUR ── */
  .nf-field-error,
  .nf-error-msg {
    font-size: 13px;
    color: var(--nf-pink, #F62DAE);
    margin-top: 5px;
    display: block;
    font-weight: 500;
  }

  .nf-form-wrap input.nf-has-error,
  .nf-form-wrap select.nf-has-error,
  .nf-form-wrap textarea.nf-has-error {
    border-color: var(--nf-pink, #F62DAE);
  }

  /* ── MESSAGE SUCCÈS ── */
  .nf-form-success {
    background: rgba(99, 164, 108, 0.12);
    border: 1.5px solid var(--nf-green, #63A46C);
    border-radius: 4px;
    padding: 16px;
    font-size: 15px;
    color: var(--nf-gray, #333);
    margin: 16px 0;
  }

  /* ── FILTRES (agenda, annuaire) ── */
  .nf-filters-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: var(--nf-cream, #F7F5F0);
    border-bottom: 1px solid rgba(31, 31, 31, 0.1);
    margin-bottom: 0;
  }

  /* Ligne horizontale scrollable pour les filtres chips */
  .nf-filters-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .nf-filters-chips::-webkit-scrollbar {
    display: none;
  }

  .nf-filter-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border: 1.5px solid rgba(31, 31, 31, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    background: #fff;
    color: var(--nf-gray, #333);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
  }

  .nf-filter-chip.is-active,
  .nf-filter-chip:active {
    background: var(--nf-black, #1F1F1F);
    border-color: var(--nf-black, #1F1F1F);
    color: var(--nf-cream, #F7F5F0);
  }

  /* ── SELECT FILTRE en pleine largeur ── */
  .nf-filters-bar select {
    font-size: 16px !important;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(31, 31, 31, 0.2);
    border-radius: 4px;
    background: #fff;
    color: var(--nf-black);
    appearance: none;
    -webkit-appearance: none;
  }

  /* ── UPLOAD FICHIER ── */
  .nf-form-wrap input[type="file"] {
    font-size: 14px !important;
    padding: 12px;
    border: 1.5px dashed rgba(31, 31, 31, 0.25);
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(247, 245, 240, 0.5);
    cursor: pointer;
  }

} /* fin @media 768px */
