/* =====================
   COM_YOFORM — DÉCLARATION REX
   ===================== */

/* Full-width layout, pas de sidebar */
.com_yoform .page-layout {
  grid-template-columns: 1fr;
}
.com_yoform .page-sidebar {
  display: none;
}

/* Conteneur principal */
.yoform-wrapper {
  max-width: 760px;
}

/* Titre du formulaire */
.yoform-wrapper h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blue-dark);
  padding-left: 16px;
  border-left: 4px solid var(--blue);
  line-height: 1.2;
  margin-bottom: 10px;
}

/* Description courte (p.lead) */
.yoform-wrapper p.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* Carte du formulaire */
.yoform-form {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 32px 40px 36px;
}

/* Séparateur de section (h4.yoform-section) */
.yoform-section:first-child {
	margin-top: 0px;
}
.yoform-section {
  font-family: 'Montserrat', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--blue-dark);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  margin-top: 50px;
}

/* Champ individuel */
.yoform-field .form-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  display: block;
  margin-bottom: 6px;
  margin-top: 15px;
}

.yoform-field .form-label .yoform-required {
  color: var(--red);
  margin-left: 3px;
}

/* Inputs, textareas et selects */
.yoform-field .form-control,
.yoform-field .form-select {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
  display: block;
  box-sizing: border-box;
  margin-bottom: 15px;
}

.yoform-field textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

.yoform-field .form-control:focus,
.yoform-field .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20,82,155,.12);
}

.yoform-field .form-select {
  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='%236b7a8d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* Icône info + tooltip */
.yf-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
  flex-shrink: 0;
}

.yf-tooltip::before,
.yf-tooltip::after {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.yf-tooltip::before {
  content: attr(data-tip);
  bottom: calc(100% + 8px);
  background: #1a2a3a;
  color: var(--white);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 6px;
  width: max-content;
  max-width: 240px;
  white-space: normal;
  z-index: 100;
}

.yf-tooltip::after {
  content: '';
  bottom: calc(100% + 2px);
  border: 5px solid transparent;
  border-top-color: #1a2a3a;
}

.yf-tooltip:hover::before,
.yf-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Texte d'aide sous le champ */
.yoform-field .yoform-help {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 5px;
  display: block;
}

/* Bouton Envoyer */
.yoform-form > button[type="submit"],
.yoform-form .btn-primary {
  padding: 13px 40px;
  font-size: 15px;
}

/* =====================
   CONFIRMATION / MESSAGE DE SUCCÈS
   ===================== */
.yoform-success {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  border-top: 4px solid var(--teal);
}

.yoform-success h3 {
  font-size: 1.2rem;
  color: var(--blue-dark);
  margin-bottom: 10px;
}

.yoform-success p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* =====================
   LISTE DES SOUMISSIONS
   ===================== */
.yoform-results h2,
.yoform-submission h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blue-dark);
  padding-left: 16px;
  border-left: 4px solid var(--blue);
  line-height: 1.2;
  margin-bottom: 16px;
}

.yf-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.yf-results-table thead th {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.yf-results-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.yf-results-table tbody td:first-child {
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}

.yf-results-row:hover td {
  background: var(--blue-pale);
}

.yf-cell-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 320px;
}

/* =====================
   DÉTAIL D'UNE SOUMISSION
   ===================== */
.yoform-submission {
  max-width: 760px;
}

.yf-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--blue-dark);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.yf-detail-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.yf-detail-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
}

.yf-detail-value {
  font-size: 14px;
  color: var(--text);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
  .yoform-form {
    padding: 24px 20px 28px;
  }

  .yoform-wrapper h2 {
    font-size: 1.35rem;
  }

  /* Tableau REX → carte par ligne */
  .yf-results-table thead {
    display: none;
  }

  .yf-results-table,
  .yf-results-table tbody,
  .yf-results-table tr,
  .yf-results-table td {
    display: block;
    width: 100%;
  }

  .yf-results-table tbody tr {
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 14px 16px;
    border-bottom: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    cursor: pointer;
  }

  .yf-results-table tbody td {
    padding: 4px 0;
    border-bottom: none;
  }

  .yf-results-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  /* Masquer les colonnes 3 et 4 (Commentaires, Discipline) sur mobile */
  .yf-results-table tbody td:nth-child(3),
  .yf-results-table tbody td:nth-child(4) {
    display: none;
  }

  /* Date : mise en avant */
  .yf-results-table tbody td:first-child {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .yf-cell-preview {
    max-width: 100%;
    -webkit-line-clamp: 2;
  }

  .yf-results-row:hover td {
    background: transparent;
  }

  .yf-detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .yf-detail-label {
    font-size: 11px;
    color: var(--text-muted);
  }
}
