/**
 * GeoFazendas Modal Base - Forms, Utilities & Accessibility
 * Part of the modal-base component system.
 *
 * Form styling inside modals, utility variants (no-header, no-footer,
 * sticky-footer, loading state), and accessibility support
 * (reduced motion, focus styles, high contrast).
 */

/* ==========================================================================
   Form Inside Modal
   ========================================================================== */

.gf-modal form {
  display: contents;
}

.gf-modal .form-group,
.gf-modal .mb-3 {
  margin-bottom: 1rem;
}

.gf-modal .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* No footer variant */
.gf-modal--no-footer .gf-modal__footer {
  display: none;
}

/* No header variant */
.gf-modal--no-header .gf-modal__header {
  display: none;
}

.gf-modal--no-header .gf-modal__close {
  z-index: 10;
}

/* Sticky footer (always visible during scroll) */
.gf-modal--sticky-footer .gf-modal__footer {
  position: sticky;
  bottom: 0;
}

/* Loading state */
.gf-modal.is-loading .gf-modal__body {
  opacity: 0.5;
  pointer-events: none;
}

.gf-modal.is-loading .gf-modal__footer .btn {
  pointer-events: none;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .gf-modal,
  .gf-modal__dialog {
    transition: none;
  }
}

/* Focus visible styles */
.gf-modal__dialog:focus {
  outline: none;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .gf-modal__dialog {
    border: 2px solid CanvasText;
  }
  
  .gf-modal__handle-bar {
    background-color: CanvasText;
  }
}
