/* The Modal (background) */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

/* Modal Content Box */
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 50%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Close Button */
.close {
  position: absolute!important;
  top: 10px;
  right: 95vw!important;
  color: #aaa;
  font-size: 28px;
  cursor: pointer;
}
.close:hover {
  color: #000;
}

/* ==========================================================================
   Formulário de inscrição em eventos (GetDadosInscricao / form_Inscrever2Eventos)
   Componentes genéricos (.bat-campo, .bat-painel) estão em BATComponentes.css.
   Breakpoint do projeto: 768px.
   ========================================================================== */

/* ===== DUAS COLUNAS: custos | preçário+hotel ===== */
.bat-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.bat-cols > * {
  min-width: 0; /* impede que conteúdo largo estique a coluna */
}

/* ===== DADOS DO CASAL ===== */
.bat-casal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.bat-casal-coluna {
  min-width: 0;
}

.bat-casal-cab {
  text-align: center;
  font-weight: bold;
  padding: 4px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.bat-casal-cab--ela {
  background-color: pink;
  color: black;
}

.bat-casal-cab--ele {
  background-color: blue;
  color: white;
}

.bat-casal-acoes {
  margin-top: 8px;
  text-align: right;
}

/* ===== PARÂMETROS / CUSTOS ===== */
.bat-custos {
  display: grid;
  gap: 2px;
}

.bat-custos-cab,
.bat-custos-linha {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 24px 90px 110px 110px;
  gap: 6px;
  align-items: center;
}

.bat-custos-cab {
  background-color: black;
  color: white;
  font-weight: bold;
  text-align: center;
  padding: 4px 0;
}

.bat-custos-cab .bat-custos-incl {
  color: red;
}

.bat-custos-qtd,
.bat-custos-unit,
.bat-custos-tot,
.bat-custos-incl {
  text-align: center;
}

.bat-custos-nome {
  text-align: right;
}

.bat-custos-qtd input[type="number"] {
  width: 100%;
  max-width: 70px;
  box-sizing: border-box;
}

.bat-custos-linha--total {
  font-weight: bold;
  border-top: 1px solid #008ab7;
  padding-top: 4px;
}

/* Etiquetas que só aparecem quando as linhas empilham em mobile */
.bat-custos-etiq {
  display: none;
}

.bat-custos-nota {
  color: red;
  font-weight: bold;
  margin: 6px 0 0;
}

/* ===== PREÇÁRIO / HOTEL ===== */
.bat-lateral {
  display: grid;
  gap: 10px;
  align-content: start;
}

.bat-subtitulo {
  text-align: center;
  font-weight: bold;
  padding: 4px;
  border-radius: 6px;
}

.bat-subtitulo--precario {
  color: blue;
}

.bat-subtitulo--hotel {
  background-color: lightgray;
  color: black;
}

/* ===== COMPROVATIVO / FATURAÇÃO ===== */
.bat-pagamento {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.bat-pagamento-cab {
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  color: white;
}

.bat-pagamento-cab--iban {
  background-color: black;
}

.bat-pagamento-cab--fatura {
  background-color: blue;
}

.bat-pagamento-campos {
  min-width: 0;
}

/* O IBAN tem de poder quebrar em vez de estourar a largura */
.bat-iban {
  display: inline-block;
  font-weight: bold;
  word-break: break-word;
}

.bat-nota {
  color: blue;
  margin: 6px 0 0;
}

/* Checkbox + texto na mesma linha */
.bat-campo--inline .bat-controlo input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

/* ===== BOTÕES / AVISOS ===== */
.bat-botoes {
  text-align: center;
}

.bat-botoes button img {
  vertical-align: middle;
  margin-right: 6px;
}

.bat-acoes {
  margin-top: 6px;
}

.bat-aviso {
  color: red;
  margin: 8px 0 0;
}

/* ==========================================================================
   MOBILE
   ========================================================================== */
@media (max-width: 768px) {
  .bat-cols,
  .bat-casal,
  .bat-pagamento {
    grid-template-columns: 1fr;
  }

  .bat-casal-coluna + .bat-casal-coluna {
    margin-top: 14px;
  }

  /* Cada parâmetro passa a bloco: nome por cima, valores em linha etiquetada */
  .bat-custos-cab {
    display: none;
  }

  .bat-custos-linha {
    grid-template-columns: 1fr;
    gap: 2px;
    border: 1px solid #d6e9f0;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
  }

  .bat-custos-nome {
    text-align: left;
    font-weight: bold;
  }

  .bat-custos-qtd,
  .bat-custos-unit,
  .bat-custos-tot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    gap: 8px;
  }

  .bat-custos-etiq {
    display: inline;
    color: #555;
    font-weight: normal;
  }

  /* Checkbox "inclui inscrição": sem coluna própria, alinha à esquerda */
  .bat-custos-incl {
    text-align: left;
  }

  .bat-custos-qtd input[type="number"] {
    max-width: 90px;
    min-height: 44px;
  }

  .bat-botoes button {
    width: 100%;
    min-height: 44px;
    margin-bottom: 6px;
  }

  /*
   Tabela de seleção (Diocese/Centro/Encontro/Casais/Noivos) injetada em
   #Inscrever por post_SelectedEvento2Inscrever. Tratamento só por CSS, sem
   mexer no markup. Filho direto: não apanha as tabelas do preçário, que
   ficam dentro de .bat-scroll-x e devem continuar a deslizar na horizontal.
  */
  #Inscrever > table,
  #Inscrever > table > tbody,
  #Inscrever > table > tbody > tr,
  #Inscrever > table > tbody > tr > td {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
  }

  #Inscrever > table select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 44px;
  }
}
