
:root {
  --bg: #f6f7f9;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --soft: #f4f5f7;
  --line: #e6e9ee;
  --line-strong: #d9dee6;
  --text: #111318;
  --muted: #666d78;
  --red: #d90b13;
  --shadow: 0 22px 60px rgba(17, 19, 24, 0.07);
  --shadow-soft: 0 10px 28px rgba(17, 19, 24, 0.05);
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 11, 19, 0.045), transparent 30%),
    radial-gradient(circle at top right, rgba(17, 19, 24, 0.03), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}
button, input, select { font: inherit; }
.page {
  width: min(1140px, calc(100% - 28px));
  margin: 26px auto 40px;
}
.topbar {
  margin-bottom: 20px;
  padding: 10px 4px 4px;
}
.brand-row {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}
.brand-logo {
  width: min(100%, 510px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.06));
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(17, 19, 24, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-soft);
}
.topbar h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  max-width: 760px;
}
.subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: start;
}
.panel,
.info-strip {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel { padding: 24px; }
.form-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.9) 100%);
}
.result-panel {
  min-height: 100%;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(217, 11, 19, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(250,251,252,0.96) 100%);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  min-width: 0;
}
.field label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.field input,
.field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.field input::placeholder { color: #9aa2ad; }
.field input:focus,
.field select:focus {
  border-color: rgba(217, 11, 19, 0.25);
  box-shadow: 0 0 0 4px rgba(217, 11, 19, 0.08);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
}
.search-item {
  padding: 13px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f6;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #fafbfc; }
.search-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.segmented-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}
.segmented-btn:hover {
  border-color: rgba(17, 19, 24, 0.15);
  transform: translateY(-1px);
}
.segmented-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  box-shadow: 0 10px 20px rgba(17, 19, 24, 0.15);
}
.actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cta-actions {
  flex-direction: column;
}
.cta-actions .btn {
  width: 100%;
  padding: 16px 18px;
  font-size: 15px;
  border-radius: 18px;
}
.primary-actions { margin-top: 4px; }
.manual-actions { margin-top: 4px; }
.btn {
  appearance: none;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .14s ease, opacity .14s ease, box-shadow .14s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, #181b21 0%, #0f1116 100%);
  color: #fff;
}
.btn-secondary {
  background: rgba(255,255,255,0.88);
  color: var(--text);
  border: 1px solid var(--line);
}
.manual-box {
  margin-top: 12px;
  border-top: 1px solid rgba(17, 19, 24, 0.08);
  padding-top: 18px;
}
.manual-toggle {
  width: 100%;
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: .16s ease;
}
.manual-toggle:hover {
  background: #fbfbfc;
  color: var(--text);
  border-color: rgba(217, 11, 19, 0.2);
}

.manual-fields {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(247,248,250,0.98) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.manual-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17, 19, 24, 0.06);
}
.manual-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.manual-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(217, 11, 19, 0.08);
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.field label span {
  color: var(--muted);
  font-weight: 600;
}
.manual-grid-top {
  margin-bottom: 6px;
}
.manual-grid-bottom {
  margin-top: 6px;
  grid-template-columns: 1fr;
  gap: 18px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.choice-card {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  color: var(--text);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: .16s ease;
  min-height: 92px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.choice-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.choice-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#manualTypeGrid .choice-card {
  min-height: 108px;
}
.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 19, 24, 0.16);
  box-shadow: var(--shadow-soft);
}
.choice-card.active {
  border-color: rgba(217, 11, 19, 0.22);
  background: linear-gradient(180deg, rgba(217, 11, 19, 0.05) 0%, rgba(255,255,255,0.98) 100%);
  box-shadow: 0 10px 24px rgba(217, 11, 19, 0.08);
}
.empty-state {
  width: 100%;
  text-align: center;
  padding: 12px 8px;
}
.empty-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f7f8 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-weight: 900;
}
.empty-state h2,
.result-header h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.05em;
}
.empty-state p,
.result-header p,
.info-strip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}
.result-header {
  margin-bottom: 18px;
}
.fit-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #edf9f0;
  color: #1d7c41;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}
.fit-apertado {
  background: #fff6e8;
  color: #b06b00;
}
.fit-nao-cabe {
  background: #fff0f1;
  color: var(--red);
}
.total-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}
.meta-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.total-box strong {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.05em;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.84);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.metric span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 700;
}
.metric strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}
.metric-wide { grid-column: 1 / -1; }
.cta-box {
  border-radius: 24px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(17,19,24,0.035) 0%, rgba(17,19,24,0.02) 100%);
  border: 1px solid rgba(17, 19, 24, 0.08);
}
.cta-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.info-strip {
  margin-top: 18px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.72);
}
.hidden { display: none !important; }

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .brand-logo {
    width: min(100%, 420px);
  }
}

@media (max-width: 640px) {
  .manual-intro {
    flex-direction: column;
    align-items: flex-start;
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .page {
    width: min(100% - 18px, 100%);
    margin: 16px auto 28px;
  }
  .panel,
  .info-strip {
    border-radius: 24px;
  }
  .panel { padding: 18px; }
  .grid-2,
  .total-box,
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .topbar h1 {
    font-size: clamp(30px, 11vw, 46px);
  }
  .brand-logo {
    width: min(100%, 340px);
  }
  .cta-actions,
  .actions {
    flex-direction: column;
  }
  .btn,
  .btn-full {
    width: 100%;
  }
}

.choice-grid-minimal {
  gap: 12px;
}

.choice-card-minimal {
  min-height: 58px;
  padding: 0 16px;
  border-radius: 18px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.choice-card-minimal strong {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.choice-card-minimal span {
  display: none;
}

.choice-helper {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#manualTypeGrid .choice-card-minimal,
#manualUsageGrid .choice-card-minimal {
  min-height: 58px;
}

@media (max-width: 740px) {
  .choice-grid-minimal {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-card-minimal {
    min-height: 54px;
    padding: 0 10px;
    border-radius: 16px;
  }

  .choice-card-minimal strong {
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}


.choice-card-minimal strong {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

#manualUsageGrid,
#manualTypeGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#manualTypeGrid .choice-card {
  min-height: 72px;
}
