/* ==========================================================
   Florentis — Teacher Hub Modals (Canonical)
   Supports:
   - .flth-modal + .flth-modal__dialog (new)
   - .fl-modal + .fl-modal-content (legacy)
   Goal: consistent modern modals + modern form controls inside them.
   ========================================================== */

/* Backdrop */
.flth-modal,
.fl-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999999;
  align-items: center;
  justify-content: center;
  background: rgba(23, 40, 48, 0.60);
  backdrop-filter: blur(4px);
  padding: 18px;
}

.flth-modal.is-open,
.fl-modal.is-open {
  display: flex !important;
}

/* Optional overlay click-catcher */
.flth-modal__overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

/* Dialog */
.flth-modal__dialog,
.fl-modal-content {
  position: relative;
  background: #fff;
  width: min(640px, 92vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid #e9edf1;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
  z-index: 1;
}

.flth-modal__body {
  overflow-y: auto;
  padding-right: 6px;
}

/* Close button */
.flth-modal__close,
.fl-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
}

.flth-modal__close:hover,
.fl-modal-close:hover {
  background: #e2e8f0;
  color: #172830;
}

/* ==========================================================
   Modern form controls INSIDE MODALS ONLY
   (beats theme + WP defaults)
   ========================================================== */

/* Text-ish inputs/selects/textarea */
.flth-modal__dialog input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.flth-modal__dialog select,
.flth-modal__dialog textarea,
.fl-modal-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.fl-modal-content select,
.fl-modal-content textarea,
.flth-modal__dialog .fl-input,
.fl-modal-content .fl-input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;

  min-height: 42px !important;
  padding: 10px 12px !important;

  font-size: 14px !important;
  line-height: 1.25 !important;

  border-radius: 12px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;

  box-shadow: none !important;
  outline: none !important;
  appearance: none !important;
}

/* Make select feel consistent */
.flth-modal__dialog select,
.fl-modal-content select {
  min-height: 42px !important;
}

/* Textarea better default */
.flth-modal__dialog textarea,
.fl-modal-content textarea {
  min-height: 96px !important;
  resize: vertical !important;
}

/* Focus state */
.flth-modal__dialog input:focus,
.flth-modal__dialog select:focus,
.flth-modal__dialog textarea:focus,
.fl-modal-content input:focus,
.fl-modal-content select:focus,
.fl-modal-content textarea:focus,
.flth-modal__dialog .fl-input:focus,
.fl-modal-content .fl-input:focus {
  border-color: #27537a !important;
  box-shadow: 0 0 0 3px rgba(39, 83, 122, 0.18) !important;
}

/* Labels inside modals: consistent */
.flth-modal__dialog label,
.fl-modal-content label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  color: #596c10;
}

/* Buttons in modals: modern rounding */
.flth-modal__dialog .button,
.flth-modal__dialog button,
.fl-modal-content .button,
.fl-modal-content button {
  border-radius: 12px;
}