/* ========== DESIGN SYSTEM – APP PREMIUM ========== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #ec4899;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --bg: #f8fafc;
  --bg-deep: #0f172a;
  --text: #334155;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #6366f1;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
              radial-gradient(ellipse 60% 40% at 100% 100%, rgba(236, 72, 153, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%);
  animation: bgFloat 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes bgFloat {
  0%, 100% { opacity: 1; transform: scale(1) translate(0, 0); }
  33% { opacity: 0.9; transform: scale(1.02) translate(2%, -1%); }
  66% { opacity: 1; transform: scale(0.98) translate(-1%, 2%); }
}
body > .app-bar { position: relative; z-index: 1; }
body > .screen { position: relative; z-index: 1; }
body > .modal-overlay { z-index: 1000; }

/* ========== APP BAR ========== */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 1rem 0 0.75rem;
  padding-top: env(safe-area-inset-top, 0);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.app-bar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--bg-deep);
  letter-spacing: -0.02em;
}
.app-bar .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}
.app-bar .back-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background 0.2s var(--ease);
}
.app-bar .back-btn:hover { background: var(--border); }
.app-bar .back-btn:active { transform: scale(0.96); }
.app-bar .title {
  display: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}
.app-bar.has-back .brand { display: none; }
.app-bar.has-back .title { display: block !important; }

/* ========== TELAS (mobile first) ========== */
.screen {
  display: none;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  padding: 1.5rem 1.25rem 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
  animation: screenIn 0.35s var(--ease);
}
.screen.active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 420px;
  margin: 0 auto;
}

/* ========== TELA 1 – INTRODUÇÃO ========== */
#screen-intro {
  position: relative;
  overflow: hidden;
}

/* Camada de fundo tecnológico (sem bolinhas – só R$) */
.tech-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* R$ flutuando – cifrões de dinheiro em verde */
.money-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.money-effect span {
  position: absolute;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(22, 163, 74, 0.65);
  animation: moneyFloat 12s ease-in-out infinite;
  white-space: nowrap;
}
.money-effect span.note {
  font-weight: normal;
  opacity: 0.7;
}
.money-effect span.coin {
  font-weight: normal;
  opacity: 0.8;
}
/* Tamanhos variados (0.7rem a 1.5rem) para efeito aleatório */
.money-effect span:nth-child(1) { left: 5%; top: 10%; font-size: 0.85rem; animation-delay: 0s; animation-duration: 14s; }
.money-effect span:nth-child(2) { left: 18%; top: 25%; font-size: 1.35rem; animation-delay: -2s; animation-duration: 11s; }
.money-effect span:nth-child(3) { left: 32%; top: 8%; font-size: 1.1rem; animation-delay: -4s; animation-duration: 16s; }
.money-effect span:nth-child(4) { left: 45%; top: 35%; font-size: 0.75rem; animation-delay: -1s; animation-duration: 13s; }
.money-effect span:nth-child(5) { left: 58%; top: 15%; font-size: 1.5rem; animation-delay: -3s; animation-duration: 15s; }
.money-effect span:nth-child(6) { left: 72%; top: 40%; font-size: 0.9rem; animation-delay: -5s; animation-duration: 10s; }
.money-effect span:nth-child(7) { left: 85%; top: 12%; font-size: 1.25rem; animation-delay: -2.5s; animation-duration: 12s; }
.money-effect span:nth-child(8) { left: 12%; top: 55%; font-size: 0.8rem; animation-delay: -6s; animation-duration: 14s; }
.money-effect span:nth-child(9) { left: 28%; top: 70%; font-size: 1.4rem; animation-delay: -1.5s; animation-duration: 11s; }
.money-effect span:nth-child(10) { left: 55%; top: 60%; font-size: 0.95rem; animation-delay: -4.5s; animation-duration: 15s; }
.money-effect span:nth-child(11) { left: 78%; top: 75%; font-size: 1.2rem; animation-delay: -3.5s; animation-duration: 13s; }
.money-effect span:nth-child(12) { left: 8%; top: 85%; font-size: 0.7rem; animation-delay: -5.5s; animation-duration: 10s; }
.money-effect span:nth-child(13) { left: 38%; top: 48%; font-size: 1.45rem; animation-delay: -7s; animation-duration: 16s; }
.money-effect span:nth-child(14) { left: 62%; top: 28%; font-size: 0.88rem; animation-delay: -2s; animation-duration: 12s; }
.money-effect span:nth-child(15) { left: 92%; top: 55%; font-size: 1.15rem; animation-delay: -4s; animation-duration: 14s; }
.money-effect span:nth-child(16) { left: 22%; top: 42%; font-size: 1.05rem; animation-delay: -6.5s; animation-duration: 11s; }
.money-effect span:nth-child(17) { left: 48%; top: 78%; font-size: 0.78rem; animation-delay: -1s; animation-duration: 15s; }
.money-effect span:nth-child(18) { left: 68%; top: 5%; font-size: 1.3rem; animation-delay: -3s; animation-duration: 13s; }
.money-effect span:nth-child(19) { left: 15%; top: 32%; font-size: 0.92rem; animation-delay: -5s; animation-duration: 10s; }
.money-effect span:nth-child(20) { left: 88%; top: 68%; font-size: 1.38rem; animation-delay: -2.5s; animation-duration: 14s; }
.money-effect span:nth-child(21) { left: 42%; top: 18%; font-size: 0.82rem; animation-delay: -6s; animation-duration: 12s; }
.money-effect span:nth-child(22) { left: 5%; top: 62%; font-size: 1.22rem; animation-delay: -4.5s; animation-duration: 11s; }
.money-effect span:nth-child(23) { left: 75%; top: 22%; font-size: 0.72rem; animation-delay: -1.5s; animation-duration: 16s; }
.money-effect span:nth-child(24) { left: 35%; top: 88%; font-size: 1.42rem; animation-delay: -7s; animation-duration: 10s; }
.money-effect span:nth-child(25) { left: 52%; top: 45%; font-size: 0.98rem; animation-delay: -3.5s; animation-duration: 14s; }
.money-effect span:nth-child(26) { left: 95%; top: 35%; font-size: 1.28rem; animation-delay: -5.5s; animation-duration: 13s; }
.money-effect span:nth-child(27) { left: 10%; top: 48%; font-size: 0.86rem; animation-delay: -2s; animation-duration: 11s; }
.money-effect span:nth-child(28) { left: 58%; top: 85%; font-size: 1.18rem; animation-delay: -6.5s; animation-duration: 15s; }
.money-effect span:nth-child(29) { left: 82%; top: 48%; font-size: 0.76rem; animation-delay: -1s; animation-duration: 12s; }
.money-effect span:nth-child(30) { left: 25%; top: 15%; font-size: 1.48rem; animation-delay: -4s; animation-duration: 14s; }
.money-effect span:nth-child(31) { left: 7%; top: 38%; font-size: 1.08rem; animation-delay: -3s; animation-duration: 12s; }
.money-effect span:nth-child(32) { left: 50%; top: 8%; font-size: 0.74rem; animation-delay: -5s; animation-duration: 15s; }
.money-effect span:nth-child(33) { left: 90%; top: 72%; font-size: 1.32rem; animation-delay: -1s; animation-duration: 11s; }
.money-effect span:nth-child(34) { left: 35%; top: 58%; font-size: 0.9rem; animation-delay: -6s; animation-duration: 14s; }
.money-effect span:nth-child(35) { left: 65%; top: 52%; font-size: 1.26rem; animation-delay: -2.5s; animation-duration: 10s; }
.money-effect span:nth-child(36) { left: 15%; top: 78%; font-size: 0.8rem; animation-delay: -4.5s; animation-duration: 13s; }
.money-effect span:nth-child(37) { left: 78%; top: 35%; font-size: 1.4rem; animation-delay: -7s; animation-duration: 16s; }
.money-effect span:nth-child(38) { left: 42%; top: 22%; font-size: 0.96rem; animation-delay: -1.5s; animation-duration: 11s; }
.money-effect span:nth-child(39) { left: 3%; top: 52%; font-size: 1.12rem; animation-delay: -5.5s; animation-duration: 12s; }
.money-effect span:nth-child(40) { left: 58%; top: 72%; font-size: 0.84rem; animation-delay: -3.5s; animation-duration: 14s; }
.money-effect span:nth-child(41) { left: 28%; top: 12%; font-size: 1.36rem; animation-delay: -6.5s; animation-duration: 10s; }
.money-effect span:nth-child(42) { left: 72%; top: 65%; font-size: 0.88rem; animation-delay: -2s; animation-duration: 15s; }
.money-effect span:nth-child(43) { left: 12%; top: 92%; font-size: 1.44rem; animation-delay: -4s; animation-duration: 13s; }
.money-effect span:nth-child(44) { left: 88%; top: 28%; font-size: 0.7rem; animation-delay: -1s; animation-duration: 11s; }
.money-effect span:nth-child(45) { left: 48%; top: 82%; font-size: 1.2rem; animation-delay: -5s; animation-duration: 14s; }
@keyframes moneyFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.2; }
  25% { transform: translate(15px, -20px) rotate(5deg); opacity: 0.35; }
  50% { transform: translate(-10px, -35px) rotate(-3deg); opacity: 0.25; }
  75% { transform: translate(20px, -15px) rotate(4deg); opacity: 0.3; }
}

/* Aura/brilho central */
#screen-intro::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 140%;
  height: 120%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, rgba(99, 102, 241, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 60%);
  animation: pageGlow 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes pageGlow {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.05); }
}
.intro {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
  position: relative;
  z-index: 1;
}
.intro .author-photo-wrap {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.25rem;
  position: relative;
  animation: introFadeUp 0.7s var(--ease) both;
}
.intro .author-photo-wrap::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0.2;
  filter: blur(12px);
  animation: photoGlow 4s ease-in-out infinite;
}
@keyframes photoGlow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.05); }
}
.intro .author-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.intro .hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1.75rem;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 20px 40px -12px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  animation: introFadeUp 0.7s var(--ease) 0.1s both, iconGlow 3s ease-in-out infinite;
}
@keyframes iconGlow {
  0%, 100% { box-shadow: 0 20px 40px -12px var(--primary-glow); }
  50% { box-shadow: 0 24px 48px -8px rgba(99, 102, 241, 0.45); }
}
@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.intro h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bg-deep);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  animation: introFadeUp 0.7s var(--ease) 0.2s both;
  line-height: 1.2;
}
.intro .tagline {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 500;
  animation: introFadeUp 0.7s var(--ease) 0.3s both;
}
.intro .desc {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  animation: introFadeUp 0.7s var(--ease) 0.4s both;
}
.intro .btn {
  animation: introFadeUp 0.7s var(--ease) 0.5s both;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  padding: 1rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover, .btn-primary:focus {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* ========== TELA 2 – FORMULÁRIO ========== */
.form-screen .app-bar .title { margin: 0 auto; }
.form-header {
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
}
.form-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--bg-deep);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.form-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.form-header .form-intro {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.55;
}
.field-help {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.5;
}
.field-help strong { color: var(--bg-deep); }
.fixed-costs-group {
  margin-bottom: 1.25rem;
}
.fixed-costs-row {
  display: block;
}
.fixed-costs-main .field,
.fixed-costs-others-col .field { margin-bottom: 1rem; }
.fixed-costs-group > .field { margin-bottom: 1rem; }
.fixed-costs-group .group-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bg-deep);
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}
.fixed-costs-other-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.fixed-costs-other-row .other-label { flex: 1; min-width: 0; }
.fixed-costs-other-row .other-value { width: 110px; flex-shrink: 0; }
.fixed-costs-other-row .btn-remove {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.fixed-costs-other-row .btn-remove:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.btn-add-other {
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.9375rem;
  background: var(--bg);
  color: var(--primary);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.btn-add-other:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.06); }

/* Bateria de testes */
.battery-section { margin-bottom: 1.25rem; }
.battery-section .group-title { font-size: 0.9375rem; font-weight: 600; color: var(--bg-deep); margin-bottom: 0.5rem; }
.battery-add-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; }

/* Botão escolher testes */
.btn-choose-tests { flex: 1; min-width: 200px; }

/* Modal de escolha de testes */
.modal-box-lg {
  display: flex;
  flex-direction: column;
}
.modal-box-lg .modal-subtitle { margin-bottom: 1rem; }
.modal-battery-tests-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.modal-battery-search {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.9375rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.modal-battery-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }
.modal-battery-filter { font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.modal-battery-tests-list {
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
  padding: 0.25rem 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.modal-battery-group { margin-bottom: 0.25rem; }
.modal-battery-group-header {
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-battery-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.modal-battery-item:last-child { border-bottom: none; }
.modal-battery-item:hover:not([data-disabled]) { background: rgba(99, 102, 241, 0.06); }
.modal-battery-item[data-disabled] { cursor: default; opacity: 0.75; background: var(--bg); }
.modal-battery-checkbox { flex-shrink: 0; margin-top: 0.25rem; cursor: pointer; }
.modal-battery-already {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-top: 0.2rem;
}
.modal-battery-item-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.modal-battery-item-name { font-size: 0.875rem; font-weight: 600; color: var(--bg-deep); line-height: 1.3; }
.modal-battery-item-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.modal-battery-item-meta { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.3; }
.modal-battery-empty { padding: 1.5rem; font-size: 0.9375rem; color: var(--text-muted); text-align: center; }
.modal-battery-tests-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-battery-selected-count { font-size: 0.875rem; color: var(--text-secondary); }
.modal-battery-tests-footer .btn { flex: 1; min-width: 180px; }

/* Badges de instrumento */
.instrument-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-favoravel { background: rgba(16, 185, 129, 0.15); color: #047857; }
.badge-desfavoravel { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.badge-em-avaliacao { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-editora { background: rgba(99, 102, 241, 0.12); color: var(--primary-dark); }
.badge-construto { background: rgba(100, 116, 139, 0.12); color: var(--text-secondary); }

.battery-add-row .btn-add-test { padding: 0.6rem 1rem; font-size: 0.875rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; white-space: nowrap; }
.battery-add-row .btn-add-avulso { background: transparent; border: 1.5px dashed var(--border); color: var(--text-secondary); }
.battery-add-row .btn-add-avulso:hover { border-color: var(--primary); color: var(--primary); }
.battery-selected-list { margin-top: 1rem; }
/* ── Linha de teste selecionado na bateria ───────────────────────────── */
.battery-selected-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.battery-selected-row:hover { border-color: var(--primary-light, #7dd3fc); }

/* Cabeçalho: nome + badges + botão buscar + botão remover */
.battery-row-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.battery-row-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.battery-row-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep, #1e293b);
  line-height: 1.35;
}
.battery-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* Inputs lado a lado */
.battery-row-inputs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.battery-selected-row .battery-row-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}
.battery-selected-row .battery-row-price { width: 110px; }
.battery-selected-row .battery-row-price input { width: 100%; padding: 0.5rem; font-size: 0.875rem; border-radius: 6px; border: 1px solid var(--border); }
.battery-selected-row .battery-row-apps { width: 90px; }
.battery-selected-row .battery-row-apps input { width: 100%; padding: 0.5rem; font-size: 0.875rem; border-radius: 6px; border: 1px solid var(--border); }

/* Botão buscar preço */
.btn-fetch-price {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid var(--primary, #2563eb);
  border-radius: 20px;
  background: transparent;
  color: var(--primary, #2563eb);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
  flex-shrink: 0;
}
.btn-fetch-price:hover:not(:disabled) { background: var(--primary, #2563eb); color: #fff; }
.btn-fetch-price:disabled { opacity: 0.55; cursor: not-allowed; }

/* Badge de fonte / IA */
.price-source-badge {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.65rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}
.ia-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  margin-right: 0.3rem;
}
.ia-badge-error {
  background: #fff1f2;
  color: #dc2626;
}
.source-links { font-size: 0.73rem; color: var(--text-secondary); overflow-wrap: break-word; word-break: break-word; }
.source-links a { color: var(--primary, #2563eb); text-decoration: underline; }
.source-links a:hover { color: var(--primary-dark, #1d4ed8); }
.form-layout { display: block; }
.form-col-left .card { margin-bottom: 1.25rem; }
.form-step-next { display: none; }
.form-step-back { display: none; }
.form-step-next-2 { display: none; }
.form-step-back-2 { display: none; }
.battery-selected-row .btn-remove-battery { width: 36px; height: 36px; padding: 0; border: none; background: var(--bg); color: var(--text-secondary); border-radius: 6px; cursor: pointer; font-size: 1.25rem; line-height: 1; }
.battery-selected-row .btn-remove-battery:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.battery-total-hint { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.5rem; }
/* Hint de custo dos testes – visível em todas as etapas do formulário */
.form-step-hint {
  margin-top: 0;
  margin-bottom: 1.25rem;
}
.battery-cost-highlight {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.battery-cost-highlight strong {
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s var(--ease), border-color 0.2s var(--ease);
}
.card:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.2);
}

.field {
  margin-bottom: 1.25rem;
}
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep);
  margin-bottom: 0.5rem;
}
.field input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--bg-deep);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.field input::placeholder { color: var(--text-muted); }
.field .hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}
.field.error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.field .error-msg {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.375rem;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ========== TELA 3 – RESULTADO ========== */
.result-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
}
.result-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.result-hero {
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, transparent 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(99, 102, 241, 0.12);
}
.result-hero .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.result-hero .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.result-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-row .label { font-size: 0.9375rem; color: var(--text); }
.result-row .value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bg-deep);
}

.indicator {
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 2px solid transparent;
}
.indicator.low {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.5);
}
.indicator.medium {
  background: rgba(245, 158, 11, 0.25);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.5);
}
.indicator.high {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.5);
}

/* ========== EXPLICAÇÃO DO CÁLCULO ========== */
.calc-explanation-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
}
.calc-explanation-card:empty { display: none; }
.calc-explanation-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bg-deep);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.calc-step {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.calc-step:last-child { border-bottom: none; padding-bottom: 0; }
.calc-step-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg-deep);
  margin-bottom: 0.25rem;
}
.calc-step-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  line-height: 1.5;
}
.calc-step-value {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}
.calc-step-value strong {
  color: var(--bg-deep);
  font-weight: 700;
}
.calc-step-highlight {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  background: var(--bg);
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}
.calc-step-highlight.primary {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.cta-block {
  margin-top: 1.5rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #0f2027 0%, #1a3a2a 50%, #0f2027 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(37, 211, 102, 0.25);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.12);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(37, 211, 102, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.cta-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.cta-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 0.875rem;
  letter-spacing: -0.01em;
}
.cta-block p {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.cta-sub {
  font-size: 0.8125rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-bottom: 0 !important;
  margin-top: 1rem !important;
}
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  max-width: none;
  padding: 1.125rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  background: linear-gradient(135deg, #25d366, #128c3e);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  letter-spacing: 0.01em;
  position: relative;
  animation: waPulse 2.5s ease-in-out infinite;
}
@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45); }
  50%       { box-shadow: 0 6px 32px rgba(37, 211, 102, 0.75), 0 0 0 6px rgba(37, 211, 102, 0.12); }
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
  background: linear-gradient(135deg, #2de070, #15a348);
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.6);
  transform: translateY(-2px);
  animation: none;
}

.result-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}
.result-actions .btn {
  width: 100%;
  max-width: none;
}
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover, .btn-outline:focus {
  border-color: var(--primary);
  color: var(--primary);
}

.summary-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
}
.summary-box:empty { display: none; }

/* ========== MODAL ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  animation: fadeIn 0.2s var(--ease);
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border);
  animation: modalIn 0.3s var(--ease);
}
.modal-box.modal-box-lg {
  max-width: min(1400px, 96vw);
  width: min(1400px, 96vw);
  max-height: 90vh;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bg-deep);
  margin-bottom: 0.25rem;
}
.modal-box .modal-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-box .field { margin-bottom: 1rem; }
.modal-box .field label { font-size: 0.875rem; }
.modal-box .field input {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}
.modal-box .field.required label::after { content: " *"; color: var(--danger); }
.modal-box .field-help { padding: 0.35rem 0; background: transparent; border: none; margin-top: 0.25rem; }
.modal-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.modal-error.active { display: block; }
.modal-box .btn {
  margin-top: 1rem;
  width: 100%;
  max-width: none;
}

/* ========== RESPONSIVIDADE – TABLET ========== */
@media (min-width: 480px) {
  .screen { padding: 2rem 1.5rem; }
  .intro h1 { font-size: 2rem; }
  .intro .hero-icon { width: 96px; height: 96px; font-size: 2.5rem; }
  .card { padding: 1.75rem; }
  .result-hero .value { font-size: 2.25rem; }
}
@media (max-width: 480px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ========== RESPONSIVIDADE – DESKTOP ========== */
@media (min-width: 768px) {
  .app-bar {
    padding: 0 2rem;
    height: 64px;
  }
  .app-bar .brand { font-size: 1.25rem; }
  .app-bar .brand-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .app-bar .back-btn { width: 44px; height: 44px; }
  .app-bar .title { font-size: 1.0625rem; }

  .screen {
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    padding: 2.5rem 2rem 3rem;
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0));
  }

  .container { max-width: 560px; }

  /* Intro – desktop */
  .intro {
    padding-top: 3.5rem;
    padding-bottom: 3rem;
  }
  .intro .author-photo-wrap { width: 220px; height: 220px; margin-bottom: 1.5rem; }
  .intro .author-photo-wrap .author-photo { width: 220px; height: 220px; }
  .intro h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
  .intro .tagline { font-size: 1.0625rem; margin-bottom: 2.25rem; }
  .intro .desc { font-size: 1.0625rem; max-width: 400px; margin-bottom: 3rem; }
  .intro .btn { max-width: 360px; padding: 1.125rem 1.5rem; font-size: 1.125rem; }

  /* Form – desktop: 1 coluna no passo 1, 2 colunas no passo 2 */
  .form-screen .container { max-width: 900px; }
  .form-screen .form-header { margin-bottom: 2rem; }
  .form-screen .form-header h2 { font-size: 1.5rem; }
  .form-screen .form-header p { font-size: 1rem; }
  .form-screen .form-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
  }
  .form-screen .form-layout .form-col-left { min-width: 0; }
  .form-screen .form-layout .form-col-right { min-width: 0; }
  /* Custos fixos: duas colunas — principais à esquerda, "Outros gastos fixos" à direita */
  .form-col-left .fixed-costs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
  }
  /* Passo 2: esconde a tela anterior (custos fixos) e mostra só Sua bateria de testes + restante do formulário */
  .form-screen .form-layout.form-step-2-visible {
    grid-template-columns: 1fr;
  }
  .form-screen .form-layout.form-step-2-visible .form-col-left {
    display: none !important;
  }
  .form-screen .form-layout.form-step-2-visible .form-col-right {
    display: block !important;
  }
  /* Passo 1: só esquerda (custos). Passo 2: só direita (bateria), esquerda some */
  .form-screen .form-layout .form-col-right { display: none; }
  .form-screen .form-layout.form-step-2-visible .form-col-right { display: block !important; }
  .form-screen .form-step-next { display: flex; justify-content: flex-end; margin-top: 1.25rem; }
  .form-screen .form-step-back { display: none; margin-bottom: 1rem; }
  .form-screen .form-layout.form-step-2-visible .form-step-next { display: none; }
  .form-screen .form-layout.form-step-2-visible .form-step-back { display: block; }
  .form-screen .form-step-back .btn { margin-bottom: 0; }
  /* Passo 2: só bateria. Passo 3: só dados (outros campos + Calcular) */
  .form-screen .form-layout .form-step-dados { display: none; }
  .form-screen .form-layout .form-step-back-2 { display: none; }
  .form-screen .form-layout.form-step-2-visible .form-step-battery { display: block; }
  .form-screen .form-layout.form-step-2-visible .form-step-next-2 { display: flex; justify-content: flex-end; margin-top: 1.25rem; }
  .form-screen .form-layout.form-step-2-visible .form-step-dados { display: none; }
  .form-screen .form-layout.form-step-3-visible .form-step-battery { display: none; }
  .form-screen .form-layout.form-step-3-visible .form-step-next-2 { display: none; }
  .form-screen .form-layout.form-step-3-visible .form-step-back { display: none; }
  .form-screen .form-layout.form-step-3-visible .form-step-dados { display: block; }
  .form-screen .form-layout.form-step-3-visible .form-step-back-2 { display: block; margin-bottom: 1rem; }
  .form-screen .card { margin-bottom: 1.5rem; padding: 1.75rem; }
  .form-screen .form-actions {
    margin-top: 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .form-screen .form-actions .btn { max-width: 220px; }

  /* Result – desktop */
  #screen-result .container { max-width: 560px; }
  #screen-result .result-header { margin-bottom: 2rem; }
  #screen-result .result-header h2 { font-size: 1.375rem; }
  #screen-result .result-hero {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
  #screen-result .result-hero .value { font-size: 2.5rem; }
  #screen-result .result-card { padding: 1.5rem 1.75rem; }
  #screen-result .result-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  #screen-result .result-actions .btn {
    width: auto;
    min-width: 180px;
    max-width: 260px;
    flex: 1;
  }

  /* Modal – desktop */
  .modal-overlay { padding: 2rem; }
  .modal-box {
    max-width: 440px;
    padding: 2rem;
    border-radius: var(--radius);
  }
  .modal-box h3 { font-size: 1.375rem; }
}

/* Desktop grande – container um pouco mais largo no form */
@media (min-width: 1024px) {
  .form-screen .container { max-width: 960px; }
  .form-screen .form-layout { gap: 2.5rem; }
  #screen-result .container { max-width: 600px; }
}

/* ========== BOTÃO PDF ========== */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--surface);
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  font-weight: 600;
}
.btn-pdf:hover, .btn-pdf:focus {
  background: #fff1f2;
  border-color: #dc2626;
  color: #dc2626;
}

/* ========== PRÓ-LABORE ========== */
.pro-labore-field {
  margin-top: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
}
.pro-labore-field label { color: #15803d; font-weight: 600; }

/* ========== PRESETS DE IMPOSTO ========== */
.tax-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.tax-preset-btn {
  padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tax-preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.tax-preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== ALERTA VALOR/HORA ========== */
.hourly-rate-alert {
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.hourly-rate-alert.hourly-low {
  background: #fff1f2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
}
.hourly-rate-alert.hourly-ok {
  background: #fefce8;
  border: 1.5px solid #fde047;
  color: #92400e;
}
.hourly-rate-alert.hourly-great {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
}

/* ========== REFERÊNCIA DE MERCADO ========== */
.market-reference-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.market-reference-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem;
}
.mkt-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.mkt-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.4;
}
.mkt-source a {
  color: var(--primary);
  text-decoration: none;
}
.mkt-source a:hover {
  text-decoration: underline;
}
.mkt-chart { display: flex; flex-direction: column; gap: 0.85rem; }
.mkt-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s;
}
.mkt-row-active {
  background: #f0f9ff;
  border: 1.5px solid #7dd3fc;
}
.mkt-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.mkt-range {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}
.mkt-bar-wrap {
  position: relative;
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: visible;
}
.mkt-bar {
  position: absolute;
  height: 100%;
  border-radius: 5px;
  opacity: 0.75;
}
.mkt-marker {
  position: absolute;
  top: -18px;
  transform: translateX(-50%);
  font-size: 0.9rem;
  color: #0284c7;
  font-weight: 700;
}
.mkt-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}
.mkt-conclusion {
  font-size: 0.875rem;
  color: var(--text);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}
