:root {
  --carvao-950: #0d0d0e;
  --carvao-900: #141416;
  --carvao-800: #1c1c1f;
  --carvao-700: #27282c;
  --carvao-600: #3a3c41;
  --teal-800: #106b58;
  --teal-700: #158a72;
  --teal-600: #1ea587;
  --teal-500: #2fbc9c;
  --teal-400: #66c9af;
  --teal-100: #e6f7f1;
  --areia: #d9a24b;
  --areia-light: #f3c877;
  --tinta: #1b1d22;
  --cinza-600: #5c6270;
  --cinza-300: #dde0e6;
  --cinza-200: #eceef2;
  --cinza-100: #f5f6f8;
  --branco: #ffffff;
  --raio: 20px;
  --raio-sm: 12px;
  --sombra: 0 10px 30px -14px rgba(10, 10, 12, 0.20);
  --sombra-hover: 0 22px 48px -16px rgba(10, 10, 12, 0.28);
  --fonte: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fonte-titulo: "Outfit", var(--fonte);
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  color: var(--tinta);
  font-family: var(--fonte);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(47, 188, 156, 0.14), transparent 60%),
    radial-gradient(900px 460px at 100% 0%, rgba(20, 20, 22, 0.08), transparent 55%),
    linear-gradient(180deg, #f2f4f5 0%, #f6f7f8 420px, #f6f7f8 100%);
}

/* ---------- Blobs decorativos de fundo ---------- */
.bg-decor { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.30;
  animation: flutuar 16s ease-in-out infinite;
}

.bg-blob-1 {
  width: 480px; height: 480px; top: -180px; right: -120px;
  background: radial-gradient(circle, var(--teal-400), transparent 70%);
}

.bg-blob-2 {
  width: 420px; height: 420px; bottom: -160px; left: -140px;
  background: radial-gradient(circle, var(--carvao-600), transparent 72%);
  opacity: 0.12;
  animation-delay: -8s;
}

@keyframes flutuar {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -18px) scale(1.06); }
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 1px;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ---------- Cabeçalho (banner) ---------- */
.header {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(60% 140% at 88% -10%, rgba(102, 201, 175, 0.30), transparent 60%),
    radial-gradient(40% 100% at 10% 120%, rgba(47, 188, 156, 0.16), transparent 65%),
    linear-gradient(120deg, var(--carvao-950) 0%, var(--carvao-900) 55%, var(--carvao-800) 100%);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.55);
}

.header-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.header-shapes .shape {
  position: absolute;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
}

.shape-1 { width: 130px; height: 340px; right: 12%; top: -60px; background: linear-gradient(180deg, rgba(102, 201, 175, 0.14), transparent); }
.shape-2 { width: 70px; height: 340px; right: 22%; top: -60px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent); }
.shape-3 { width: 40px; height: 340px; right: 8%; top: -60px; background: linear-gradient(180deg, rgba(102, 201, 175, 0.08), transparent); }

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 1.5px, transparent 1.5px 34px);
  animation: deslizar 26s linear infinite;
  pointer-events: none;
}

@keyframes deslizar {
  from { background-position: 0 0; }
  to { background-position: 600px 0; }
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 24px;
}

.logo-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 40px;
}

.logo { height: 62px; width: auto; display: block; }

.header-content { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-left: auto; margin-right: 50px; text-align: right; }

.title {
  margin: 0;
  font-family: var(--fonte-titulo);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--branco);
}

.subtitle {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--teal-400);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.subtitle svg { flex-shrink: 0; color: var(--teal-400); }

.header-wave {
  display: block;
  width: 100%;
  height: 26px;
  margin: 18px 0 26px;
  color: rgba(47, 188, 156, 0.25);
  fill: currentColor;
}

/* ---------- Botão "piscina em L" ---------- */
.btn-toggle-l {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--teal-700);
  background: var(--teal-100);
  border: 1.5px dashed var(--teal-500);
  border-radius: var(--raio-sm);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-toggle-l svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-toggle-l:hover { background: #d7f2ea; }
.btn-toggle-l:active { transform: scale(0.98); }

.btn-toggle-l[hidden] { display: none; }

.btn-remover-l {
  color: #9a3a3a;
  background: #fbeaea;
  border-color: #e3a3a3;
}

.btn-remover-l:hover { background: #f6dada; }

/* ---------- Layout principal ---------- */
.main-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.left-column, .right-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right-column { position: sticky; top: 24px; }

/* ---------- Cards ---------- */
.card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  animation: subir 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.left-column .card:nth-child(1) { animation-delay: 0.02s; }
.left-column .card:nth-child(2) { animation-delay: 0.07s; }
.left-column .card:nth-child(3) { animation-delay: 0.12s; }
.left-column .card:nth-child(4) { animation-delay: 0.17s; }
.left-column .card:nth-child(5) { animation-delay: 0.22s; }
.left-column .card:nth-child(6) { animation-delay: 0.27s; }
.left-column .card:nth-child(7) { animation-delay: 0.32s; }

.card:hover { box-shadow: var(--sombra-hover); transform: translateY(-2px); }

.card-title {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  font-family: var(--fonte-titulo);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--branco);
  background: linear-gradient(100deg, var(--carvao-950) 0%, var(--carvao-800) 65%, var(--carvao-700) 100%);
  overflow: hidden;
}

.card-title::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1.5px, transparent 1.5px 28px);
  pointer-events: none;
}

.card-title-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-title-underline {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--teal-400);
}

.card-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.card-icon svg { width: 17px; height: 17px; color: var(--teal-400); }

.card-body { padding: 22px 24px 26px; }

/* ---------- Formulário ---------- */
.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-row:last-child { margin-bottom: 0; }
.form-row[hidden] { display: none; }

.foto-revestimento-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--cinza-300);
  border-radius: var(--raio-sm);
  background: var(--cinza-100);
}

.foto-revestimento-preview img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--cinza-300);
  flex-shrink: 0;
  background: var(--branco);
}

.foto-revestimento-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foto-revestimento-titulo { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cinza-600); }
.foto-revestimento-nome { font-size: 13.5px; font-weight: 600; color: var(--tinta); }

.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group.full-width { grid-column: 1 / -1; }

label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cinza-600);
}

.form-control {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--tinta);
  background: var(--cinza-100);
  border: 1.5px solid var(--cinza-200);
  border-radius: var(--raio-sm);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.form-control::placeholder { color: #9a9fa8; }

.form-control:hover { background: #eef0f2; border-color: #cfd3da; }

.form-control:focus {
  background: var(--branco);
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(47, 188, 156, 0.16);
  transform: translateY(-1px);
}

.form-control[readonly], .form-control:disabled {
  background: var(--cinza-100);
  border-color: var(--cinza-200);
  color: var(--cinza-600);
  cursor: not-allowed;
  transform: none;
}

select.form-control {
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Inputs com ícone à esquerda ---------- */
.input-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--cinza-600);
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 1;
}

.input-icon:focus-within svg { color: var(--teal-600); }

.form-control.has-icon { padding-left: 38px; }

select.form-control.has-icon {
  padding-left: 38px;
}

/* ---------- Checkbox (maquininha Itaú) ---------- */
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--cinza-100);
  border: 1.5px solid var(--cinza-200);
  border-radius: var(--raio-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-field:hover { background: #eef0f2; border-color: #cfd3da; }

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--teal-600);
  cursor: pointer;
}

.checkbox-field-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tinta);
}

.checkbox-field-text svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--teal-600); }
.checkbox-field-text strong { color: var(--teal-700); font-weight: 700; }

/* ---------- Pill de valor total ---------- */
.valor-total-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--teal-100);
  border: 1.5px solid var(--teal-500);
  border-radius: var(--raio-sm);
}

.valor-total-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--teal-700);
}

.valor-total-pill-icon svg { width: 14px; height: 14px; }

.valor-total-pill-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-800);
}

.valor-total-pill-valor {
  font-family: var(--fonte-titulo);
  font-weight: 800;
  font-size: 18px;
  color: var(--teal-800);
  white-space: nowrap;
}

.aviso-info {
  margin: 14px 0 0;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #7a5a12;
  background: linear-gradient(120deg, #fdf3d9, #fbeecb);
  border-left: 3px solid var(--areia);
  border-radius: 8px;
}

.aviso-info strong { color: #5c4409; }

.aviso-info-teal {
  color: #0b5c4c;
  background: linear-gradient(120deg, var(--teal-100), #d7f2ea);
  border-left: 3px solid var(--teal-500);
}
.aviso-info-teal strong { color: #073c31; }

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 0 4px;
  font-size: 12.5px;
  color: var(--cinza-600);
}

.footer strong { color: var(--teal-700); }

/* ---------- Faixa de destaques ---------- */
.feature-band {
  position: relative;
  margin-top: 40px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(50% 160% at 92% 50%, rgba(102, 201, 175, 0.16), transparent 60%),
    linear-gradient(100deg, var(--carvao-950) 0%, var(--carvao-900) 55%, var(--carvao-800) 100%);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.5);
}

.feature-band-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 220px;
  min-width: 0;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--teal-400);
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-text strong { color: var(--branco); font-size: 14.5px; font-weight: 700; }
.feature-text span { color: #a9adb5; font-size: 12.5px; }

.feature-band-decor {
  position: absolute;
  right: 3%;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 90px;
  color: rgba(102, 201, 175, 0.16);
  pointer-events: none;
}

@media (max-width: 860px) {
  .feature-band-decor { display: none; }
}

@media (max-width: 640px) {
  .feature-band { border-radius: 18px; margin-top: 28px; }
  .feature-band-inner { flex-direction: column; padding: 22px 20px; gap: 18px; }
}

/* remove setas do input number */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---------- Botões ---------- */
.action-buttons { display: flex; gap: 14px; margin-top: 4px; }

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
  color: var(--branco);
  background: linear-gradient(120deg, var(--carvao-900), var(--teal-600));
  box-shadow: 0 12px 26px -10px rgba(13, 13, 14, 0.5);
}

.btn-primary:hover { box-shadow: 0 16px 34px -10px rgba(13, 13, 14, 0.6); filter: brightness(1.08); }

.btn-secondary { color: var(--carvao-800); background: var(--cinza-100); border: 1.5px solid var(--cinza-200); }
.btn-secondary:hover { background: var(--cinza-200); }

/* ---------- Resumo ---------- */
.card-resumo .card-body { padding-top: 8px; }

.resumo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--cinza-300);
  font-size: 14.5px;
}

.resumo-item[hidden] { display: none; }

.resumo-item:first-child { padding-top: 14px; }

.resumo-label { display: flex; align-items: center; gap: 10px; color: var(--cinza-600); font-weight: 600; }
.resumo-label-nota { font-weight: 500; color: var(--teal-600); font-size: 11.5px; cursor: help; }
.resumo-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--teal-600); }
.resumo-valor { font-weight: 700; color: var(--tinta); }

.resumo-subtotal .resumo-label,
.resumo-subtotal .resumo-valor { color: var(--cinza-600); font-weight: 600; }

.resumo-grupo-subtotal { border-bottom: 1px solid var(--cinza-300); }
.resumo-grupo-subtotal .resumo-label,
.resumo-grupo-subtotal .resumo-valor { color: var(--teal-700); font-weight: 800; }

.resumo-desconto .resumo-label { color: #c2410c; }
.resumo-desconto .resumo-icon { color: #c2410c; }
.resumo-valor-desconto { color: #c2410c; }

.resumo-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--carvao-900), var(--carvao-800) 55%, var(--teal-600));
  box-shadow: 0 14px 30px -14px rgba(10, 10, 12, 0.45);
}

.resumo-total .resumo-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.resumo-valor-total {
  font-family: var(--fonte-titulo);
  font-size: 26px;
  font-weight: 800;
  color: var(--branco);
}

/* ---------- Tabela ---------- */
.table-wrap { padding-top: 4px; }

.tabela-orcamento { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12.5px; }

.tabela-orcamento th,
.tabela-orcamento td {
  hyphens: auto;
  overflow-wrap: break-word;
}

.tabela-orcamento th {
  text-align: left;
  padding: 9px 6px;
  font-size: 10.8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cinza-600);
  border-bottom: 2px solid var(--cinza-300);
}

.tabela-orcamento td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--cinza-200);
  color: var(--tinta);
}

.tabela-orcamento tbody tr { transition: background 0.15s ease; }
.tabela-orcamento tbody tr:hover { background: var(--teal-100); }

.linha-desconto td { color: #c2410c; font-weight: 700; }

.linha-subtotal-grupo td { color: var(--teal-700); font-weight: 700; background: var(--teal-100); }

.linha-total td {
  font-weight: 800;
  color: var(--teal-700);
  border-bottom: none;
  padding-top: 14px;
}

/* ---------- Overlay de carregamento ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(1000px 600px at 50% 0%, var(--carvao-800), var(--carvao-950) 75%);
  color: var(--branco);
  z-index: 999;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--teal-400);
  animation: girar 0.8s linear infinite;
}

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Banner de erro ---------- */
.erro-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #b3261e;
  color: var(--branco);
  padding: 12px 22px;
  border-radius: var(--raio-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sombra);
}

.erro-banner.hidden { display: none; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .main-content { grid-template-columns: minmax(0, 1fr); }
  .right-column { position: static; }
}

@media (max-width: 640px) {
  .container { padding: 16px 14px 48px; }
  .header { border-radius: 0 0 22px 22px; }
  .header-inner { flex-wrap: wrap; padding: 22px 18px; gap: 14px; }
  .header-shapes { opacity: 0.5; }
  .logo-container { padding: 8px 10px; }
  .logo { height: 30px; }
  .title { font-size: 19px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
  .form-control { padding: 14px; font-size: 16px; }
  .action-buttons { flex-direction: column; }
  .btn { padding: 16px 20px; }
  .card-title { padding: 16px 18px; }
  .card-body { padding: 18px; }
  .bg-blob { filter: blur(50px); opacity: 0.22; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .spinner, .bg-blob { animation: none; }
  .btn, .card, .form-control { transition: none; }
  .header::after { animation: none; }
}
