/* ============================================================
   FORMS.CSS — Athenia Academy
   Rôle : modales, formulaires, champs, messages de succès/erreur.
   À charger APRÈS components.css pour stabiliser/override l'existant.
   ============================================================ */

/* Overlay modal */
.ath-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 15, 20, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ath-overlay.open {
  opacity: 1;
  visibility: visible;
}

.ath-modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2.25rem 2.5rem;
  position: relative;
  background: #FFFFFF;
  color: #1D1D1F;
  border: 1px solid rgba(29, 29, 31, 0.10);
  border-radius: 28px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.20);
  transform: translateY(16px) scale(0.985);
  transition: transform 0.22s ease;
}

.ath-overlay.open .ath-modal {
  transform: translateY(0) scale(1);
}

.ath-modal-close {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #F5F5F7;
  border: none;
  border-radius: 50%;
  color: #6E6E73;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.ath-modal-close:hover {
  background: #ECECF0;
  color: #1D1D1F;
}

.ath-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  color: #00A86B;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ath-modal-title {
  margin: 0 0 0.4rem;
  color: #1D1D1F;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.ath-modal-sub {
  margin: 0 0 1.75rem;
  color: #6E6E73;
  font-size: 0.95rem;
  line-height: 1.6;
}

.ath-divider {
  height: 1px;
  background: rgba(29, 29, 31, 0.10);
  margin: 1.25rem 0;
}

/* Champs */
.ath-field,
.form-group {
  margin-bottom: 1rem;
}

.ath-field label,
.form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #6E6E73;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
}

.ath-field label .req {
  color: #00A86B;
}

.ath-field input,
.ath-field select,
.ath-field textarea,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 0.9rem;
  background: #FFFFFF;
  border: 1px solid rgba(29, 29, 31, 0.16);
  border-radius: 14px;
  color: #1D1D1F;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ath-field textarea,
.form-textarea {
  min-height: 110px;
  resize: vertical;
}

.ath-field input:focus,
.ath-field select:focus,
.ath-field textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #00A86B;
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.10);
}

.ath-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Consentement */
.ath-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 1.25rem 0;
}

.ath-consent input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: #00A86B;
}

.ath-consent label {
  color: #6E6E73;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Boutons formulaire */
.ath-btn-submit {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.5rem;
  background: #1D1D1F;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ath-btn-submit:hover:not(:disabled) {
  background: #00A86B;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 168, 107, 0.20);
}

.ath-btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ath-reassurance {
  margin-top: 0.8rem;
  color: #86868B;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Messages */
.ath-success,
.ath-error {
  display: none;
  padding: 1.35rem;
  margin-top: 1rem;
  border-radius: 18px;
  text-align: center;
}

.ath-success {
  background: rgba(0, 168, 107, 0.08);
  border: 1px solid rgba(0, 168, 107, 0.20);
  color: #1D1D1F;
}

.ath-error {
  background: rgba(184, 48, 48, 0.08);
  border: 1px solid rgba(184, 48, 48, 0.22);
  color: #B83030;
}

.ath-success-title {
  margin-bottom: 0.4rem;
  color: #00A86B;
  font-weight: 700;
}

.ath-success-text {
  color: #6E6E73;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Responsive forms */
@media (max-width: 580px) {
  .ath-overlay {
    align-items: flex-end;
    padding: 0.75rem;
  }

  .ath-modal {
    max-height: 92vh;
    padding: 1.75rem 1.25rem;
    border-radius: 24px;
  }

  .ath-field-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ath-overlay,
  .ath-modal,
  .ath-modal-close,
  .ath-btn-submit,
  .ath-field input,
  .ath-field select,
  .ath-field textarea {
    transition: none !important;
  }
}

.ath-form-reassurance {
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}
