/* Reset Básico de Estilos */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #4b32b9 0%, #e05297 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  color: #333333;
}

.app-container {
  width: 100%;
  max-width: 900px;
  /* Sem isso, a tabela larga estica a página inteira no celular em vez de rolar dentro do quadro */
  min-width: 0;
  margin: 0 auto;
}

/* Cabeçalho Topo */
.header-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 16px 24px;
  /* Logo à esquerda e título no centro do cartão (as colunas laterais têm a mesma largura) */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
}

.logo-placeholder {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.logo-img {
  height: 56px;
  display: block;
}

.title-box {
  text-align: center;
}

.title-box h1 {
  font-size: 22px;
  color: #d81b60;
  font-weight: 700;
}

.title-box p {
  font-size: 13px;
  color: #777777;
}

/* Navegação por Passos (Tabs) */
.steps-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.step-tab {
  flex: 1;
  background-color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.step-tab .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #555555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step-tab.active {
  background: linear-gradient(135deg, #d81b60 0%, #ad1457 100%);
  color: #ffffff;
}

.step-tab.active .step-num {
  background-color: #ffffff;
  color: #ad1457;
}

/* Cards dos Passos */
.card-step {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.hidden {
  display: none !important;
}

.card-title {
  font-size: 22px;
  color: #d81b60;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 14px;
  color: #666666;
  margin-bottom: 24px;
}

.section-subtitle {
  font-size: 16px;
  color: #333333;
  margin: 24px 0 12px 0;
  font-weight: 700;
}

/* Formulários e Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #444444;
}

input[type="text"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  color: #333333;
  outline: none;
  background-color: #fcfcfc;
  transition: border-color 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #d81b60;
  background-color: #ffffff;
}

/* Banner Magenta do Preço da Piscina */
.price-banner {
  background: linear-gradient(135deg, #ab47bc 0%, #d81b60 100%);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: #ffffff;
  margin: 20px 0;
}

.price-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}

.price-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 4px;
}

/* Grid de Opcionais */
.grid-opcionais {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Ações e Botões */
.actions-row {
  display: flex;
  margin-top: 28px;
  gap: 12px;
}

.actions-row.right {
  justify-content: flex-end;
}

.actions-row.space-between {
  justify-content: space-between;
}

.right-buttons {
  display: flex;
  gap: 10px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-gradient {
  background: linear-gradient(135deg, #d81b60 0%, #ad1457 100%);
  color: #ffffff;
}

.btn-outline {
  background-color: #f0f0f0;
  color: #555555;
}

.btn-danger {
  background-color: #e53935;
  color: #ffffff;
}

.btn-success {
  background-color: #2e7d32;
  color: #ffffff;
}

/* Tela 3 - Proposta Comercial */
.proposal-card-header {
  background-color: #f9f8fc;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  color: #d81b60;
  font-size: 14px;
}

.proposal-info-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  background-color: #fcfcfc;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  margin-bottom: 20px;
}

.info-item label {
  font-size: 11px;
  color: #888888;
  display: block;
}

.info-item div {
  font-size: 13px;
  font-weight: 600;
  color: #333333;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
}

.proposal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.proposal-table th {
  background: linear-gradient(135deg, #ab47bc, #d81b60);
  color: #ffffff;
  padding: 10px;
  text-align: left;
}

.proposal-table td {
  padding: 10px;
  border-bottom: 1px solid #eeeeee;
}

/* Campo de desconto em R$ dentro da tabela da proposta */
.proposal-table .input-desconto {
  width: 100px;
  padding: 6px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  text-align: right;
  outline: none;
}

.proposal-table .input-desconto:focus {
  border-color: #d81b60;
}

/* Uma opção de piscina na tela 3 */
.opcao-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.opcao-cabecalho .section-subtitle {
  margin: 0;
}

.btn-pequeno {
  padding: 6px 14px;
  font-size: 12px;
}

.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.summary-box {
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #e0e0e0;
  text-align: center;
}

.summary-box.highlight {
  border-color: #d81b60;
  background-color: #fff8fa;
}

.summary-box label {
  font-size: 11px;
  color: #666666;
  display: block;
}

.summary-box span {
  font-size: 18px;
  font-weight: 700;
  color: #333333;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.margin-top {
  margin-top: 16px;
}

/* Aviso de gravação do orçamento na planilha */
.status-registro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.status-aviso {
  background-color: #fff8e1;
  color: #8a6d00;
}

.status-ok {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-erro {
  background-color: #ffebee;
  color: #c62828;
}

/* PDF da Proposta (montado pelo JavaScript em gerarPDF) */
/* Sem largura fixa: ocupa a largura da folha que o html2pdf monta (evita cortar a lateral direita) */
.pdf-proposta {
  width: 100%;
  background-color: #ffffff;
  color: #333333;
  font-size: 12px;
}

.pdf-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #d81b60;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.pdf-logo {
  height: 70px;
}

.pdf-cabecalho-info {
  text-align: right;
  font-size: 12px;
  color: #555555;
}

.pdf-cabecalho-info h1 {
  font-size: 20px;
  color: #d81b60;
  margin-bottom: 4px;
}

.pdf-bloco {
  margin-bottom: 16px;
}

.pdf-bloco h2 {
  font-size: 13px;
  color: #ad1457;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #f0d0de;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.pdf-grade {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pdf-campo label {
  display: block;
  font-size: 10px;
  color: #888888;
}

.pdf-campo div {
  font-weight: 600;
}

.pdf-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.pdf-tabela th {
  background-color: #d81b60;
  color: #ffffff;
  padding: 7px 6px;
  text-align: left;
}

.pdf-tabela td {
  padding: 7px 6px;
  border-bottom: 1px solid #eeeeee;
  vertical-align: top;
}

.pdf-tabela .pdf-num {
  text-align: right;
  white-space: nowrap;
}

.pdf-texto-livre {
  white-space: pre-line;
}

.pdf-totais {
  width: 260px;
  margin: 10px 0 0 auto;
}

.pdf-total-linha {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.pdf-desconto {
  color: #2e7d32;
}

.pdf-total-final {
  border-top: 2px solid #d81b60;
  margin-top: 4px;
  padding-top: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #d81b60;
}

.pdf-destaque {
  margin-top: 10px;
  background-color: #fff0f6;
  border-left: 4px solid #d81b60;
  padding: 8px 10px;
  font-weight: 600;
}

.pdf-obs-opcao {
  margin-top: 8px;
}

.pdf-lista-inclusos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 16px;
  margin: 6px 0 0 18px;
  font-weight: 400;
}

.pdf-assinaturas {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 40px;
  text-align: center;
}

.pdf-assinaturas > div {
  flex: 1;
}

.pdf-linha-assinatura {
  border-top: 1px solid #555555;
  margin-bottom: 4px;
}

.pdf-rodape {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
  text-align: center;
  font-size: 10px;
  color: #777777;
}

/* Responsividade Mobile */
@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .proposal-info-grid,
  .summary-cards-grid,
  .payment-grid {
    grid-template-columns: 1fr;
  }

  /* Cabeçalho: logo em cima e título embaixo, sem a coluna vazia da direita */
  .header-card {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    padding: 14px;
  }

  .title-box h1 {
    font-size: 18px;
  }

  .steps-nav {
    gap: 6px;
  }

  .step-tab {
    padding: 10px 4px;
    font-size: 13px;
    gap: 4px;
  }

  .card-step {
    padding: 18px 14px;
  }

  /* Botões quebram linha em vez de sair da tela */
  .actions-row,
  .right-buttons {
    flex-wrap: wrap;
  }

  .actions-row.space-between > .right-buttons {
    width: 100%;
  }

  .right-buttons > button {
    flex: 1;
  }

  .proposal-card-header {
    flex-wrap: wrap;
    gap: 4px;
  }
}