:root {
  --ink: #102a43;
  --ink-soft: #334e68;
  --muted: #627d98;
  --line: #d9e2ec;
  --line-strong: #bcccdc;
  --surface: #ffffff;
  --surface-soft: #f5f8fb;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #dff7f3;
  --accent: #2563eb;
  --warning: #9a3412;
  --warning-bg: #fff7ed;
  --danger: #b42318;
  --success: #047857;
  --shadow: 0 18px 50px rgba(16, 42, 67, 0.10);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #eef5f7 0, #f7f9fb 420px, #eef3f7 100%); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code { padding: .13rem .35rem; border-radius: 6px; background: rgba(16, 42, 67, .08); }
.hidden { display: none !important; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 52px);
  color: white;
  background: rgba(9, 44, 52, .96);
  border-bottom: 1px solid rgba(255,255,255,.12);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-weight: 850; letter-spacing: -.05em; background: linear-gradient(135deg, #2dd4bf, #38bdf8); color: #07333b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.brand { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-subtitle { display: block; margin-top: 1px; color: #b9d8da; font-size: .76rem; }
.health { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; color: #cce4e5; }
.health span { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.health.ok span { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .16); }
.health.error span { background: #fb7185; box-shadow: 0 0 0 4px rgba(251, 113, 133, .16); }

.app-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto 72px; }
.tabs { display: flex; gap: 8px; padding: 18px 0; overflow-x: auto; }
.tab { border: 1px solid var(--line-strong); color: var(--ink-soft); background: rgba(255,255,255,.70); padding: 10px 16px; border-radius: 999px; font-weight: 750; white-space: nowrap; transition: .2s ease; }
.tab:hover { background: white; transform: translateY(-1px); }
.tab.active { color: white; border-color: var(--primary); background: var(--primary); box-shadow: 0 8px 22px rgba(15, 118, 110, .20); }
.view { display: none; }
.view.active { display: block; }

.hero { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; padding: 28px 0 24px; }
.compact-hero { padding-top: 18px; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--primary); font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.03; letter-spacing: -.045em; }
.compact-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.hero p { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.hero-actions, .result-actions { display: flex; gap: 10px; flex-shrink: 0; }

.button { border: 1px solid transparent; border-radius: 11px; padding: 11px 16px; font-weight: 800; line-height: 1; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.button.primary { color: white; background: var(--primary); box-shadow: 0 9px 22px rgba(15, 118, 110, .18); }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line-strong); }
.button.ghost { color: var(--ink-soft); background: transparent; border-color: transparent; }
.button.danger { color: var(--danger); background: #fff; border-color: #fecaca; }
.button.small { padding: 8px 10px; font-size: .75rem; border-radius: 8px; }

.notice { padding: 13px 16px; border-radius: 12px; font-size: .84rem; line-height: 1.5; margin-bottom: 18px; }
.warning-notice { color: #7c2d12; background: var(--warning-bg); border: 1px solid #fed7aa; }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 12px; padding: 0; }
.stepper li { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 8px 10px; color: var(--muted); border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .8rem; }
.stepper li span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #d9e2ec; color: var(--ink-soft); font-size: .72rem; }
.stepper li.active { color: var(--primary-dark); background: rgba(255,255,255,.62); border-color: var(--line); }
.stepper li.active span { color: white; background: var(--primary); }
.stepper li.completed span { color: white; background: #22a699; }

.wizard-card, .panel { background: var(--surface); border: 1px solid rgba(188, 204, 220, .82); border-radius: var(--radius); box-shadow: var(--shadow); }
.wizard-card { overflow: hidden; }
.wizard-step { display: none; min-height: 410px; padding: clamp(22px, 4vw, 38px); }
.wizard-step.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -.025em; }
.section-heading p { max-width: 470px; color: var(--muted); font-size: .86rem; line-height: 1.55; text-align: right; margin-bottom: 0; }
.step-kicker { display: block; margin-bottom: 5px; color: var(--primary); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.field > span { color: var(--ink-soft); font-size: .8rem; font-weight: 800; }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid var(--line-strong); background: white; border-radius: 10px; outline: none; transition: border .16s ease, box-shadow .16s ease; }
input, select { min-height: 44px; padding: 9px 11px; }
textarea { padding: 13px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #5eead4; box-shadow: 0 0 0 4px rgba(45, 212, 191, .15); }
input.invalid, select.invalid { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .12); }
.span-2 { grid-column: span 2; }
.check-card { min-height: 66px; display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); cursor: pointer; }
.check-card:hover { border-color: #9fb3c8; background: #fff; }
.check-card input { width: 19px; height: 19px; min-height: auto; margin: 2px 0 0; accent-color: var(--primary); }
.check-card span { display: block; }
.check-card strong { display: block; margin-bottom: 3px; font-size: .84rem; }
.check-card small { display: block; color: var(--muted); font-size: .73rem; line-height: 1.35; }
.compact-check { align-self: end; }
.subsection { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.subsection h3 { margin-bottom: 14px; font-size: 1rem; }

.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px clamp(22px, 4vw, 38px); background: #f8fafc; border-top: 1px solid var(--line); }
.wizard-actions-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.validation-message { max-width: 460px; color: var(--danger); font-size: .78rem; text-align: right; }

.results { margin-top: 32px; animation: fadeIn .28s ease; }
.result-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 17px; }
.result-heading h2 { margin-bottom: 5px; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.035em; }
.result-heading p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.range-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 15px; }
.range-card { padding: 20px; border-radius: 16px; background: white; border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(16, 42, 67, .07); }
.range-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 750; }
.range-card strong { display: block; margin: 8px 0 5px; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.03em; }
.range-card small { color: var(--muted); line-height: 1.35; }
.range-card.probable { color: white; border-color: transparent; background: linear-gradient(135deg, #0f766e, #0f4c5c); }
.range-card.probable span, .range-card.probable small { color: #ccfbf1; }
.metrics-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 15px; }
.metrics-grid article { padding: 14px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 12px; }
.metrics-grid span { display: block; color: var(--muted); font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.metrics-grid strong { display: block; margin-top: 6px; font-size: .96rem; }

.result-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px; margin-bottom: 15px; }
.panel { padding: 20px; margin-bottom: 15px; box-shadow: 0 12px 38px rgba(16, 42, 67, .07); }
.span-7 { grid-column: span 7; margin-bottom: 0; }
.span-5 { grid-column: span 5; margin-bottom: 0; }
.span-6 { grid-column: span 6; margin-bottom: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.panel-heading h3 { margin-bottom: 4px; font-size: 1rem; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.panel-heading > strong { font-size: .95rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { padding: 10px 9px; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 10px 9px; border-bottom: 1px solid #edf2f7; vertical-align: top; }
th:not(:first-child), td:not(:first-child) { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
.type-pill { display: inline-block; padding: 3px 7px; border-radius: 999px; color: var(--ink-soft); background: #edf2f7; font-size: .64rem; font-weight: 800; }

.impact-list { display: grid; gap: 12px; }
.impact-item { display: grid; gap: 5px; }
.impact-label { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: .75rem; }
.impact-label span { color: var(--ink-soft); font-weight: 700; }
.impact-label strong { white-space: nowrap; font-size: .72rem; }
.impact-track { height: 8px; overflow: hidden; background: #e8eef3; border-radius: 999px; }
.impact-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14b8a6, #0f766e); }
.impact-item.decrease .impact-bar { background: linear-gradient(90deg, #60a5fa, #2563eb); }

.message-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.message-list li { position: relative; padding: 10px 11px 10px 34px; border-radius: 10px; font-size: .78rem; line-height: 1.45; }
.message-list li::before { position: absolute; left: 12px; top: 10px; font-weight: 900; }
.message-list.warnings li { color: #7c2d12; background: #fff7ed; border: 1px solid #fed7aa; }
.message-list.warnings li::before { content: "!"; }
.message-list.recommendations li { color: #115e59; background: #ecfdf5; border: 1px solid #a7f3d0; }
.message-list.recommendations li::before { content: "✓"; }
.assumptions { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 13px; }
.assumptions summary { cursor: pointer; color: var(--ink-soft); font-size: .78rem; font-weight: 800; }
.assumptions ul { color: var(--muted); font-size: .76rem; line-height: 1.5; }

.empty-state { padding: 30px; color: var(--muted); text-align: center; }
.scenario-actions { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.compare-panel { margin-top: 18px; }
.comparison-summary { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.comparison-summary article { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.comparison-summary span { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; }
.comparison-summary strong { display: block; margin-top: 6px; }
.comparison-table { margin-top: 14px; }

.admin-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-key { width: min(360px, 100%); }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(420px, calc(100vw - 44px)); padding: 12px 15px; color: white; background: #102a43; border-radius: 11px; box-shadow: 0 20px 50px rgba(16,42,67,.28); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .22s ease; font-size: .8rem; line-height: 1.4; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #991b1b; }
.toast.success { background: #065f46; }
.loading-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 12px; color: white; background: rgba(7, 35, 42, .55); backdrop-filter: blur(3px); font-weight: 800; }
.spinner { width: 38px; height: 38px; border: 4px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .span-7, .span-5, .span-6 { grid-column: span 12; }
  .hero, .result-heading { align-items: flex-start; flex-direction: column; }
  .section-heading { flex-direction: column; gap: 8px; }
  .section-heading p { text-align: left; }
}

@media (max-width: 720px) {
  .topbar { height: 64px; padding: 0 15px; }
  .brand-subtitle { display: none; }
  .health { font-size: 0; }
  .app-shell { width: min(100% - 20px, 1240px); }
  .hero { padding-top: 15px; }
  .hero-actions, .result-actions { width: 100%; }
  .hero-actions .button, .result-actions .button { flex: 1; }
  .stepper { gap: 4px; }
  .stepper li { padding: 6px 3px; gap: 3px; flex-direction: column; }
  .stepper li small { font-size: .6rem; }
  .wizard-step { min-height: auto; padding: 21px 16px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .wizard-actions { padding: 13px 15px; }
  .wizard-actions-right { flex: 1; }
  .validation-message { display: none; }
  .wizard-actions .button { flex: 1; }
  .range-cards { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 15px; }
  .comparison-summary { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar > div { display: flex; gap: 8px; }
  .admin-toolbar .button { flex: 1; }
}

@media (max-width: 430px) {
  h1 { font-size: 2rem; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .tab { padding: 9px 12px; font-size: .75rem; }
}

/* Versão 3: quantitativos, histórico de preços e separação técnico-investimento */
.field-help { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.section-note { margin: 10px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.muted-inline { color: var(--muted); font-size: .7rem; font-weight: 600; }
.panel-footer { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.parameter-editor { margin-top: 16px; }
.admin-table { margin-top: 18px; }

.range-cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.range-card.technical { background: linear-gradient(145deg, #eff8ff, #ffffff); border-color: #b9d8f2; }
.range-card.technical strong { color: #0c4a6e; }
.metrics-grid.eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.status-pill, .confidence-pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--ink-soft);
  font-size: .64rem;
  font-weight: 850;
  white-space: nowrap;
}
.status-pill.active { color: #065f46; background: #d1fae5; }
.confidence-pill.alta { color: #065f46; background: #d1fae5; }
.confidence-pill.média { color: #92400e; background: #fef3c7; }
.confidence-pill.baixa { color: #991b1b; background: #fee2e2; }

#technicalBreakdownBody td:first-child,
#investmentBody td:first-child,
#quantitiesBody td:nth-child(1),
#quantitiesBody td:nth-child(2),
#quantitiesBody td:nth-child(5),
#priceBasesBody td:nth-child(1),
#priceBasesBody td:nth-child(3),
#priceBasesBody td:nth-child(6),
#parameterHistoryBody td:nth-child(1),
#parameterHistoryBody td:nth-child(4) { text-align: left; }

#quantitiesBody td:nth-child(5) { min-width: 290px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
#technicalBreakdownBody td:first-child { min-width: 210px; }
#investmentBody td:first-child { min-width: 190px; }
#investmentBody small, #scenariosBody small { color: var(--muted); line-height: 1.35; }

@media (max-width: 1100px) {
  .range-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .range-cards.four { grid-template-columns: 1fr; }
  .metrics-grid.eight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-footer .button { width: 100%; }
}

/* Versão 4: tela de abertura e compatibilidade automática entre área e programa */
body.opening-active { overflow: hidden; }
.application-root { min-height: 100vh; }
body.opening-active .application-root {
  height: 100vh;
  overflow: hidden;
  visibility: hidden;
}

.cp-opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  color: #eaf6f6;
  background: radial-gradient(120% 120% at 50% 0%, #0b3a44 0%, #072a33 45%, #051f26 100%);
  opacity: 1;
  transform: scale(1);
  transition: opacity .5s ease, transform .5s ease;
}
.cp-opening.is-leaving {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}
.cp-opening-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 234, 212, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 45%, transparent 100%);
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 45%, transparent 100%);
}
.cp-skip {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 3;
  padding: 8px 12px;
  border: 1px solid rgba(94, 234, 212, .24);
  border-radius: 999px;
  color: #b8d6d8;
  background: rgba(5, 31, 38, .52);
  backdrop-filter: blur(10px);
  font-size: .72rem;
  font-weight: 750;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.cp-skip:hover {
  color: #eaf6f6;
  border-color: rgba(94, 234, 212, .55);
  background: rgba(15, 118, 110, .3);
}
.cp-splash {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 24px 44px;
  text-align: center;
  transition: opacity .45s ease, transform .45s ease;
}
.cp-splash.is-exiting {
  opacity: 0;
  transform: translateY(-12px) scale(.985);
  pointer-events: none;
}
.cp-building {
  width: min(560px, 90vw);
  height: auto;
  max-height: 39vh;
  overflow: visible;
  filter: drop-shadow(0 30px 38px rgba(0, 0, 0, .18));
}
.cp-crane {
  stroke-dasharray: 760;
  stroke-dashoffset: 760;
  animation: cp-draw 1.35s .1s ease-out forwards;
}
.cp-el { opacity: 0; }
.cp-foundation { transform-origin: center; animation: cp-grow-x .45s .75s ease-out forwards; }
.cp-volume-main { transform-origin: bottom; animation: cp-grow-y .55s 1.12s cubic-bezier(.2,.85,.28,1) forwards; }
.cp-volume-side { transform-origin: bottom; animation: cp-grow-y .5s 1.42s cubic-bezier(.2,.85,.28,1) forwards; }
.cp-roof-main { animation: cp-drop .38s 1.76s ease-out forwards; }
.cp-roof-side { animation: cp-drop .38s 1.94s ease-out forwards; }
.cp-glass-main { animation: cp-pop .34s 2.18s ease-out forwards; }
.cp-glass-line { animation: cp-pop .25s 2.35s ease-out forwards; }
.cp-window-upper { animation: cp-pop .3s 2.45s ease-out forwards; }
.cp-window-side { animation: cp-pop .3s 2.58s ease-out forwards; }
.cp-door { animation: cp-pop .3s 2.7s ease-out forwards; }
.cp-dimension-horizontal { stroke-dashoffset: 330; animation: cp-draw .55s 2.85s ease-out forwards; }
.cp-dimension-vertical { stroke-dashoffset: 128; animation: cp-draw .45s 3s ease-out forwards; }
.cp-dimension-cap { animation: cp-fade .28s 3.2s ease-out forwards; }
.cp-dimension-label { animation: cp-up .4s 3.25s ease-out forwards; }
.cp-brand-reveal {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  margin-top: -4px;
  opacity: 0;
  animation: cp-up .55s 3.42s ease-out forwards;
}
.cp-brand-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(135deg, #2dd4bf, #38bdf8);
  box-shadow: 0 14px 34px rgba(45, 212, 191, .25), inset 0 0 0 1px rgba(255,255,255,.35);
}
.cp-brand-name {
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1;
  text-align: left;
}
.cp-brand-name span,
.cp-ready-logo span { color: #5eead4; }
.cp-brand-tagline {
  margin-top: 8px;
  color: #7fb8bd;
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .15em;
  text-align: left;
  text-transform: uppercase;
}
.cp-opening-title {
  margin: 14px 0 0;
  color: #cdeef0;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -.015em;
  opacity: 0;
  animation: cp-up .5s 3.76s ease-out forwards;
}
.cp-legal-card {
  width: min(680px, 94vw);
  margin-top: 24px;
  padding: 23px 25px;
  border: 1px solid rgba(94, 234, 212, .22);
  border-radius: 20px;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
  text-align: left;
  opacity: 0;
  animation: cp-card-up .58s 4.05s cubic-bezier(.2,.78,.22,1) forwards;
}
.cp-legal-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: #eaf6f6;
  font-size: .92rem;
}
.cp-legal-heading > span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #5eead4;
  background: rgba(94, 234, 212, .16);
  font-weight: 900;
}
.cp-legal-card p {
  margin: 0;
  color: #b8d6d8;
  font-size: .8rem;
  line-height: 1.62;
}
.cp-legal-card p strong { color: #eaf6f6; }
.cp-agreement {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 17px 0;
  color: #e2f3f4;
  cursor: pointer;
  font-size: .83rem;
  line-height: 1.5;
  user-select: none;
}
.cp-agreement input {
  width: 20px;
  height: 20px;
  min-height: auto;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: #2dd4bf;
}
.cp-agreement strong { color: #5eead4; }
.cp-primary {
  width: 100%;
  padding: 14px 23px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: #0f766e;
  box-shadow: 0 12px 28px rgba(15, 118, 110, .34);
  font-weight: 820;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.cp-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #0d8577;
  box-shadow: 0 16px 34px rgba(15, 118, 110, .4);
}
.cp-primary:disabled {
  cursor: not-allowed;
  color: #78999c;
  background: #17444a;
  box-shadow: none;
  opacity: .72;
}
.cp-ready {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100% - 36px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 20px;
  text-align: center;
  animation: cp-fade .55s ease-out both;
}
.cp-ready-logo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}
.cp-ready-logo .cp-brand-icon { width: 54px; height: 54px; border-radius: 15px; }
.cp-ready-logo strong { font-size: 1.5rem; letter-spacing: -.025em; }
.cp-ready h2 {
  margin: 0 0 14px;
  color: #eaf6f6;
  font-size: clamp(1.9rem, 6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.cp-ready p {
  max-width: 430px;
  margin: 0 auto 30px;
  color: #9fc6c9;
  font-size: .98rem;
  line-height: 1.65;
}
.cp-ready-button { width: auto; min-width: 240px; }

.cp-opening.is-reduced *,
.cp-opening.is-reduced *::before,
.cp-opening.is-reduced *::after {
  animation-delay: 0s !important;
  animation-duration: .01ms !important;
}

@keyframes cp-draw { to { stroke-dashoffset: 0; } }
@keyframes cp-grow-x { from { opacity: 0; transform: scaleX(.05); } to { opacity: 1; transform: scaleX(1); } }
@keyframes cp-grow-y { from { opacity: 0; transform: scaleY(.04); } to { opacity: 1; transform: scaleY(1); } }
@keyframes cp-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes cp-pop { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes cp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cp-card-up { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.intro-link {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  color: #d9eff0;
  background: rgba(255,255,255,.05);
  font-size: .72rem;
  font-weight: 750;
  transition: background .18s ease, border-color .18s ease;
}
.intro-link:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.32); }

.program-fit-card,
.program-compatibility-result {
  --fit-color: #64748b;
  --fit-soft: #f1f5f9;
  --fit-border: #cbd5e1;
}
.program-fit-card[data-status="incompatible"],
.program-compatibility-result[data-status="incompatible"] {
  --fit-color: #b42318;
  --fit-soft: #fff1f2;
  --fit-border: #fecaca;
}
.program-fit-card[data-status="tight"],
.program-compatibility-result[data-status="tight"] {
  --fit-color: #a15c00;
  --fit-soft: #fff8e6;
  --fit-border: #f4d38b;
}
.program-fit-card[data-status="balanced"],
.program-compatibility-result[data-status="balanced"] {
  --fit-color: #047857;
  --fit-soft: #ecfdf5;
  --fit-border: #a7f3d0;
}
.program-fit-card[data-status="generous"],
.program-compatibility-result[data-status="generous"] {
  --fit-color: #0369a1;
  --fit-soft: #eff6ff;
  --fit-border: #bfdbfe;
}
.program-fit-card[data-status="very_generous"],
.program-compatibility-result[data-status="very_generous"] {
  --fit-color: #6d28d9;
  --fit-soft: #f5f3ff;
  --fit-border: #ddd6fe;
}
.program-fit-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--fit-border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--fit-soft), #fff 70%);
  box-shadow: 0 13px 32px rgba(16, 42, 67, .07);
  transition: border-color .22s ease, background .22s ease, opacity .22s ease;
}
.program-fit-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--fit-color);
}
.program-fit-card.is-loading { opacity: .72; }
.program-fit-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.program-fit-heading h3 { margin: 3px 0 0; font-size: 1rem; letter-spacing: -.015em; }
.fit-eyebrow {
  display: block;
  color: var(--fit-color);
  font-size: .65rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.fit-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border: 1px solid var(--fit-border);
  border-radius: 999px;
  color: var(--fit-color);
  background: rgba(255,255,255,.72);
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
}
.fit-message {
  margin: 12px 0 15px;
  color: var(--ink-soft);
  font-size: .82rem;
  line-height: 1.5;
}
.fit-track-wrap { margin: 6px 0 13px; }
.fit-track {
  position: relative;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fee2e2 0 32%, #fef3c7 32% 48%, #d1fae5 48% 77%, #dbeafe 77% 100%);
  box-shadow: inset 0 0 0 1px rgba(16, 42, 67, .08);
}
.fit-range {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 48%;
  width: 29%;
  border: 1px solid rgba(4, 120, 87, .45);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  transition: left .25s ease, width .25s ease;
}
.fit-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--fit-color);
  box-shadow: 0 3px 11px rgba(16, 42, 67, .28);
  transform: translate(-50%, -50%);
  transition: left .25s ease, background .22s ease;
}
.fit-track-labels { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: .63rem; }
.fit-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.fit-metrics article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(188, 204, 220, .68);
  border-radius: 10px;
  background: rgba(255,255,255,.7);
}
.fit-metrics span { display: block; color: var(--muted); font-size: .61rem; font-weight: 750; text-transform: uppercase; letter-spacing: .035em; }
.fit-metrics strong { display: block; margin-top: 5px; color: var(--ink); font-size: .8rem; line-height: 1.25; }
.fit-suggestions {
  margin: 13px 0 0;
  padding-left: 19px;
  color: var(--ink-soft);
  font-size: .74rem;
  line-height: 1.48;
}
.fit-suggestions li + li { margin-top: 5px; }
.fit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(188, 204, 220, .7);
}
.fit-actions small { max-width: 620px; color: var(--muted); font-size: .67rem; line-height: 1.4; }
.fit-actions .button { flex: 0 0 auto; }

.program-compatibility-result {
  border-color: var(--fit-border);
  background: linear-gradient(145deg, var(--fit-soft), #fff 55%);
  transition: border-color .2s ease, background .2s ease;
}
.program-compatibility-result .panel-heading { align-items: center; }
.result-fit-grid {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(430px, 1.15fr);
  gap: 20px;
  align-items: start;
}
.result-fit-summary > p { margin-bottom: 14px; color: var(--ink-soft); font-size: .85rem; line-height: 1.55; }
.fit-metrics.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.program-fit-result-suggestions { margin-top: 13px; }
#resultProgramComponents td:first-child { text-align: left; min-width: 170px; font-weight: 750; }
#resultProgramComponents td:nth-child(2) { min-width: 105px; white-space: nowrap; }
#resultProgramComponents td:nth-child(3) { min-width: 260px; color: var(--muted); font-size: .73rem; line-height: 1.42; text-align: left; }

@media (max-width: 900px) {
  .result-fit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .cp-skip { top: 10px; right: 10px; }
  .cp-splash { justify-content: flex-start; min-height: auto; padding: 48px 16px 28px; }
  .cp-building { max-height: 31vh; width: min(470px, 100%); }
  .cp-brand-icon { width: 50px; height: 50px; border-radius: 14px; }
  .cp-brand-tagline { font-size: .62rem; }
  .cp-legal-card { padding: 19px 17px; margin-top: 18px; }
  .cp-legal-card p { font-size: .74rem; }
  .cp-agreement { font-size: .77rem; }
  .topbar-actions { gap: 8px; }
  .intro-link { padding: 7px 8px; font-size: 0; }
  .intro-link::before { content: "Início"; font-size: .68rem; }
  .program-fit-heading { gap: 10px; }
  .fit-status { min-width: auto; }
  .fit-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fit-actions { align-items: stretch; flex-direction: column; }
  .fit-actions .button { width: 100%; }
}

@media (max-width: 430px) {
  .cp-building { max-height: 27vh; }
  .cp-brand-reveal { gap: 11px; }
  .cp-brand-name { font-size: 1.48rem; }
  .cp-opening-title { font-size: 1.02rem; }
  .cp-ready-button { width: 100%; min-width: 0; }
  .program-fit-card { padding: 17px 14px 15px; }
  .program-fit-heading { align-items: stretch; flex-direction: column; }
  .fit-status { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .cp-opening *, .cp-opening *::before, .cp-opening *::after {
    animation-delay: 0s !important;
    animation-duration: .01ms !important;
  }
  .cp-opening, .cp-splash { transition-duration: .01ms !important; }
}
