/* =============================================================
   Module cesaretractation — Styles front-office
   Auteur : Nicolas Fournier - Cesatech
   ============================================================= */

/* ── Utilitaire ── */
.cesa-hidden {
  display: none;
}

/* ── Conteneur général ── */
.cesa-retractation-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px 40px;
}

/* ── Bloc d'information ── */
.cesa-info-box {
  border-left: 4px solid #2c3e50;
  background-color: #eaf0fb;
  border-radius: 0 4px 4px 0;
  padding: 15px 20px;
  margin-bottom: 25px;
}
.cesa-info-box p {
  margin: 0;
  color: #2c3e50;
  font-size: 0.95em;
  line-height: 1.6;
}

/* ── Message de succès ── */
.cesa-success {
  border-left: 4px solid #27ae60;
  background-color: #eafaf1;
  border-radius: 0 4px 4px 0;
  padding: 20px 25px;
}
.cesa-success p {
  margin: 0 0 8px 0;
}
.cesa-success p:last-child {
  margin: 0;
}

/* ── Messages d'erreur ── */
.cesa-errors {
  border-left: 4px solid #e74c3c;
  border-radius: 0 4px 4px 0;
  padding: 15px 20px;
}
.cesa-errors ul {
  margin: 0;
  padding-left: 20px;
}
.cesa-errors li {
  margin-bottom: 4px;
}

/* ── Formulaire ── */
.cesa-form {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 25px 30px;
  margin-top: 10px;
}

.cesa-form-group {
  margin-bottom: 18px;
}

.cesa-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
  font-size: 0.9em;
}

.cesa-required {
  color: #e74c3c;
  margin-left: 2px;
}

.cesa-hint {
  display: block;
  color: #888;
  font-size: 0.82em;
  margin-top: 4px;
}

/* ── Champs ── */
.cesa-form .form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95em;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.cesa-form .form-control:focus {
  outline: none;
  border-color: #2c3e50;
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.12);
}
.cesa-form textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ── Case à cocher de confirmation ── */
.cesa-confirmation-group {
  background: #f8f9fa;
  border: 2px solid #2c3e50;
  border-radius: 4px;
  padding: 15px 18px;
  margin-top: 10px;
}
.cesa-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cesa-checkbox-wrapper input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #2c3e50;
}
.cesa-checkbox-label {
  font-size: 0.95em;
  line-height: 1.5;
  color: #2c3e50;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}

/* ── Légende champs obligatoires ── */
.cesa-required-legend {
  font-size: 0.82em;
  color: #888;
  margin: 8px 0 18px;
}

/* ── Bouton de soumission ── */
.cesa-form-submit {
  margin-top: 20px;
}
.cesa-submit-btn {
  padding: 12px 30px;
  font-size: 1em;
  font-weight: 700;
  background-color: #2c3e50;
  border-color: #2c3e50;
  color: #fff;
  border-radius: 4px;
  letter-spacing: 0.02em;
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
}
.cesa-submit-btn:hover,
.cesa-submit-btn:focus {
  background-color: #1a252f;
  border-color: #1a252f;
  color: #fff;
}
.cesa-submit-btn:active {
  transform: translateY(1px);
}

/* ── Notice légale ── */
.cesa-legal-notice {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  color: #888;
  font-size: 0.8em;
  line-height: 1.5;
}
.cesa-legal-notice p {
  margin: 0;
}

/* ── Hook footer ── */
.cesa-footer-retractation {
  display: inline-block;
  margin-top: 8px;
}
.cesa-footer-link {
  color: inherit;
  text-decoration: none;
  font-size: 0.9em;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.cesa-footer-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Hook compte client ── */
.cesa-account-retractation {
  margin: 10px 0;
}
.cesa-account-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #2c3e50;
  border-radius: 4px;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.2s, color 0.2s;
}
.cesa-account-link:hover {
  background-color: #2c3e50;
  color: #fff;
  text-decoration: none;
}

/* ── Hook détail commande ── */
.cesa-order-retractation {
  margin-top: 15px;
}
.cesa-retractation-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
}
.cesa-already-requested {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ── Widget / Hook displayCesaRetractationButton ── */
.cesa-widget {
  display: inline-block;
}
.cesa-widget__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  padding: 8px 18px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.cesa-widget__icon {
  font-size: 1.1em;
  line-height: 1;
}
.cesa-widget__hint {
  margin: 5px 0 0 0;
  font-size: 0.78em;
  color: #888;
}
.cesa-widget__link {
  font-size: 0.9em;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.cesa-widget__link:hover {
  opacity: 1;
  text-decoration: underline;
}
.cesa-widget--done .cesa-widget__status {
  font-size: 0.85em;
  color: #27ae60;
  font-weight: 600;
}

/* ── Erreur de validation JS ── */
.cesa-form .form-control.cesa-field-error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}
.cesa-checkbox-wrapper input[type="checkbox"].cesa-field-error {
  outline: 2px solid #e74c3c;
  outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cesa-form {
    padding: 18px 15px;
  }
  .cesa-form-group.row > div {
    margin-bottom: 14px;
  }
}
