/* =============================================================================
   _sp_utilities.css
   Classes utilitárias para formulários ECM — Bootstrap 3 carece de spacing
   e flex. Todas as classes usam prefixo sp- para evitar conflito com BS3.
   NÃO remove/altera classes dos formulários existentes — migração gradual.
   ============================================================================= */

/* ── Margin ─────────────────────────────────────────────────────────────── */

.sp-m-0 {
  margin: 0 !important;
}
.sp-mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.sp-mt-0 {
  margin-top: 0 !important;
}
.sp-mt-5 {
  margin-top: 5px !important;
}
.sp-mt-10 {
  margin-top: 10px !important;
}
.sp-mt-15 {
  margin-top: 15px !important;
}
.sp-mt-20 {
  margin-top: 20px !important;
}
.sp-mt-25 {
  margin-top: 25px !important;
}
.sp-mt-30 {
  margin-top: 30px !important;
}
.sp-mt-40 {
  margin-top: 40px !important;
}
.sp-mt-50 {
  margin-top: 50px !important;
}

.sp-mb-0 {
  margin-bottom: 0 !important;
}
.sp-mb-5 {
  margin-bottom: 5px !important;
}
.sp-mb-10 {
  margin-bottom: 10px !important;
}
.sp-mb-15 {
  margin-bottom: 15px !important;
}
.sp-mb-20 {
  margin-bottom: 20px !important;
}
.sp-mb-25 {
  margin-bottom: 25px !important;
}
.sp-mb-30 {
  margin-bottom: 30px !important;
}
.sp-mb-40 {
  margin-bottom: 40px !important;
}
.sp-mb-50 {
  margin-bottom: 50px !important;
}

.sp-ml-0 {
  margin-left: 0 !important;
}
.sp-ml-5 {
  margin-left: 5px !important;
}
.sp-ml-10 {
  margin-left: 10px !important;
}
.sp-ml-15 {
  margin-left: 15px !important;
}
.sp-ml-20 {
  margin-left: 20px !important;
}

.sp-mr-0 {
  margin-right: 0 !important;
}
.sp-mr-5 {
  margin-right: 5px !important;
}
.sp-mr-10 {
  margin-right: 10px !important;
}
.sp-mr-15 {
  margin-right: 15px !important;
}
.sp-mr-20 {
  margin-right: 20px !important;
}

/* ── Padding ─────────────────────────────────────────────────────────────── */

.sp-p-0 {
  padding: 0 !important;
}
.sp-p-5 {
  padding: 5px !important;
}
.sp-p-10 {
  padding: 10px !important;
}
.sp-p-15 {
  padding: 15px !important;
}
.sp-p-20 {
  padding: 20px !important;
}
.sp-p-25 {
  padding: 25px !important;
}
.sp-p-30 {
  padding: 30px !important;
}

.sp-pt-0 {
  padding-top: 0 !important;
}
.sp-pt-5 {
  padding-top: 5px !important;
}
.sp-pt-10 {
  padding-top: 10px !important;
}
.sp-pt-15 {
  padding-top: 15px !important;
}
.sp-pt-20 {
  padding-top: 20px !important;
}
.sp-pt-25 {
  padding-top: 25px !important;
}

.sp-pb-0 {
  padding-bottom: 0 !important;
}
.sp-pb-5 {
  padding-bottom: 5px !important;
}
.sp-pb-10 {
  padding-bottom: 10px !important;
}
.sp-pb-15 {
  padding-bottom: 15px !important;
}
.sp-pb-20 {
  padding-bottom: 20px !important;
}
.sp-pb-25 {
  padding-bottom: 25px !important;
}

.sp-pl-0 {
  padding-left: 0 !important;
}
.sp-pl-5 {
  padding-left: 5px !important;
}
.sp-pl-10 {
  padding-left: 10px !important;
}
.sp-pl-15 {
  padding-left: 15px !important;
}
.sp-pl-20 {
  padding-left: 20px !important;
}

.sp-pr-0 {
  padding-right: 0 !important;
}
.sp-pr-5 {
  padding-right: 5px !important;
}
.sp-pr-10 {
  padding-right: 10px !important;
}
.sp-pr-15 {
  padding-right: 15px !important;
}
.sp-pr-20 {
  padding-right: 20px !important;
}

/* ── Display ─────────────────────────────────────────────────────────────── */

.sp-d-none {
  display: none !important;
}
.sp-d-block {
  display: block !important;
}
.sp-d-inline {
  display: inline !important;
}
.sp-d-inline-block {
  display: inline-block !important;
}
.sp-d-flex {
  display: flex !important;
}

/* ── Flexbox ─────────────────────────────────────────────────────────────── */

.sp-flex-row {
  flex-direction: row !important;
}
.sp-flex-column {
  flex-direction: column !important;
}
.sp-flex-wrap {
  flex-wrap: wrap !important;
}
.sp-flex-nowrap {
  flex-wrap: nowrap !important;
}
.sp-flex-1 {
  flex: 1 !important;
}
.sp-flex-auto {
  flex: auto !important;
}

/* Justify-content */
.sp-justify-start {
  justify-content: flex-start !important;
}
.sp-justify-center {
  justify-content: center !important;
}
.sp-justify-end {
  justify-content: flex-end !important;
}
.sp-justify-between {
  justify-content: space-between !important;
}
.sp-justify-around {
  justify-content: space-around !important;
}

/* Align-items */
.sp-align-start {
  align-items: flex-start !important;
}
.sp-align-center {
  align-items: center !important;
}
.sp-align-end {
  align-items: flex-end !important;
}
.sp-align-stretch {
  align-items: stretch !important;
}

/* Atalhos flex compostos — os mais usados nos formulários */
.sp-flex-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sp-flex-between {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.sp-flex-start {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.sp-flex-col-center {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* ── Gap ─────────────────────────────────────────────────────────────────── */

.sp-gap-2 {
  gap: 2px !important;
}
.sp-gap-5 {
  gap: 5px !important;
}
.sp-gap-10 {
  gap: 10px !important;
}
.sp-gap-15 {
  gap: 15px !important;
}
.sp-gap-20 {
  gap: 20px !important;
}

/* ── Largura e Altura ────────────────────────────────────────────────────── */

.sp-w-100 {
  width: 100% !important;
}
.sp-w-75 {
  width: 75% !important;
}
.sp-w-50 {
  width: 50% !important;
}
.sp-w-25 {
  width: 25% !important;
}
.sp-w-auto {
  width: auto !important;
}

.sp-h-100 {
  height: 100% !important;
}
.sp-h-auto {
  height: auto !important;
}

/* ── Texto ───────────────────────────────────────────────────────────────── */

.sp-text-left {
  text-align: left !important;
}
.sp-text-center {
  text-align: center !important;
}
.sp-text-right {
  text-align: right !important;
}
.sp-text-upper {
  text-transform: uppercase !important;
}
.sp-text-lower {
  text-transform: lowercase !important;
}
.sp-text-bold {
  font-weight: bold !important;
}
.sp-text-600 {
  font-weight: 600 !important;
}
.sp-text-normal {
  font-weight: normal !important;
}

/* ── Cursor ──────────────────────────────────────────────────────────────── */

.sp-cursor-pointer {
  cursor: pointer !important;
}
.sp-cursor-default {
  cursor: default !important;
}
.sp-cursor-not-allowed {
  cursor: not-allowed !important;
}

/* ── Overflow ────────────────────────────────────────────────────────────── */

.sp-overflow-hidden {
  overflow: hidden !important;
}
.sp-overflow-auto {
  overflow: auto !important;
}
.sp-overflow-y-scroll {
  overflow-y: scroll !important;
}
.sp-overflow-x-hidden {
  overflow-x: hidden !important;
}

/* ── Border-radius ───────────────────────────────────────────────────────── */

.sp-rounded-sm {
  border-radius: 0.5rem !important;
}
.sp-rounded {
  border-radius: 1rem !important;
}
.sp-rounded-lg {
  border-radius: 1.5rem !important;
}
.sp-rounded-xl {
  border-radius: 2rem !important;
}
.sp-rounded-0 {
  border-radius: 0 !important;
}

/* ── Formulários ─────────────────────────────────────────────────────────── */

/* Desabilita redimensionamento de textarea */
.sp-no-resize {
  resize: none !important;
}
.sp-no-padding {
  padding: 0 !important;
}

/* iframe de visualização de PDF */
.sp-iframe-pdf {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* ── Responsivo (Bootstrap 3 usa hidden-xs / visible-xs, não d-*-none) ───── */

@media (max-width: 767px) {
  .sp-d-xs-none {
    display: none !important;
  }
  .sp-d-xs-block {
    display: block !important;
  }
  .sp-d-xs-flex {
    display: flex !important;
  }
  .sp-flex-xs-col {
    flex-direction: column !important;
  }
  .sp-mt-xs-0 {
    margin-top: 0 !important;
  }
  .sp-mt-xs-10 {
    margin-top: 10px !important;
  }
  .sp-mb-xs-10 {
    margin-bottom: 10px !important;
  }
  .sp-p-xs-0 {
    padding: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .sp-d-sm-none {
    display: none !important;
  }
  .sp-d-sm-block {
    display: block !important;
  }
  .sp-d-sm-flex {
    display: flex !important;
  }
}

@media (min-width: 992px) {
  .sp-d-md-block {
    display: block !important;
  }
  .sp-d-md-flex {
    display: flex !important;
  }
  .sp-d-md-none {
    display: none !important;
  }
}
