/* ===== Variables ===== */
:root {
  --brand: #0f4c8a;
  --brand-dark: #0a3460;
  --brand-light: #1a6bc9;
  --accent: #f97316;
  --accent-dark: #ea6c0a;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.12);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 780px; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); font-size: .875rem; }
.text-green { color: var(--success); }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2rem; }
.mb-md { margin-bottom: 1.5rem; }
.mb-lg { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.hidden { display: none !important; }

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(15,76,138,.3);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.5rem;
}
.logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1.3rem; color: var(--white);
  text-decoration: none; letter-spacing: -.02em;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--white); }
.nav { display: flex; gap: 1.5rem; }
.nav a {
  color: rgba(255,255,255,.75); font-size: .88rem;
  font-weight: 500; transition: color .15s;
}
.nav a:hover { color: var(--white); text-decoration: none; }

/* ===== Footer ===== */
.footer {
  background: var(--gray-900); color: var(--gray-500);
  padding: 1.75rem 0; margin-top: 4rem;
}
.footer-inner {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--gray-500); font-size: .85rem; transition: color .15s; }
.footer-links a:hover { color: var(--white); }

/* ===== Main ===== */
.main { min-height: calc(100vh - 130px); padding: 2rem 0; }
.page-section { padding: 2rem 0; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.875rem; font-weight: 800; color: var(--gray-900); }
.page-header p { color: var(--gray-500); margin-top: .25rem; }

/* ===== Card ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200); margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--brand);
  margin-bottom: 1.25rem; padding-bottom: .75rem;
  border-bottom: 2px solid var(--gray-100);
  display: flex; align-items: center; gap: .5rem;
}
.card-info { background: #fffbeb; border-color: #fde68a; }
.card-info p { color: #92400e; font-size: .9rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .6rem 1.25rem; border-radius: 8px;
  font-size: .9rem; font-weight: 600; border: none; cursor: pointer;
  transition: all .18s; text-decoration: none; letter-spacing: .01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(15,76,138,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 4px 16px rgba(15,76,138,.4);
}
.btn-secondary {
  background: var(--white); color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-500); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--white); box-shadow: 0 2px 8px rgba(249,115,22,.3);
}
.btn-lg { padding: .9rem 2.25rem; font-size: 1rem; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-group { display: flex; gap: 1rem; justify-content: flex-end; flex-wrap: wrap; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.form-group label { font-size: .83rem; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: .04em; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem 1rem; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: .9rem; font-family: inherit;
  background: var(--white); transition: border-color .15s, box-shadow .15s;
  color: var(--gray-900);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(26,107,201,.12);
}
.form-group input::placeholder { color: var(--gray-300); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.hint { font-size: .78rem; color: var(--gray-500); margin-top: .2rem; }
.hint-text { font-size: .78rem; color: var(--gray-500); margin-top: .25rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; font-size: .875rem; }
.checkbox-group { gap: .25rem; }
.checkbox-label input[type=checkbox] { margin-top: 2px; accent-color: var(--brand); width: 16px; height: 16px; }

/* ===== Hero (index) ===== */
.hero { padding: 0; }

.hero-top {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 60%, var(--brand-light) 100%);
  padding: 3.5rem 0 6rem;
  position: relative; overflow: hidden;
}
.hero-top::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-top .container { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.9);
  font-size: .78rem; font-weight: 700; padding: .35rem .9rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 1.25rem; border: 1px solid rgba(255,255,255,.2);
}
.hero-top h1 { font-size: 2.75rem; font-weight: 900; color: var(--white); line-height: 1.15; margin-bottom: .75rem; }
.hero-top p { color: rgba(255,255,255,.8); font-size: 1.1rem; max-width: 520px; }

.hero-card-float {
  background: var(--white); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.25rem;
  margin: -3.5rem auto 0;
  position: relative; z-index: 10;
}

.instrucoes { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; margin-bottom: 2rem; }
.instrucao-item {
  display: flex; gap: .875rem; align-items: flex-start;
  background: var(--gray-50); border-radius: 10px; padding: 1rem;
  border: 1px solid var(--gray-200);
  transition: border-color .15s, box-shadow .15s;
}
.instrucao-item:hover { border-color: var(--brand-light); box-shadow: 0 2px 8px rgba(26,107,201,.1); }
.instrucao-icon { font-size: 1.5rem; }
.instrucao-item strong { display: block; font-size: .875rem; color: var(--gray-900); }
.instrucao-item p { font-size: .8rem; color: var(--gray-500); margin: 0; }

.form-inicio { border-top: 1px solid var(--gray-200); padding-top: 1.75rem; }
.form-inicio h2 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; }

/* ===== Progress bar (cotação steps) ===== */
.steps-bar {
  display: flex; justify-content: center; gap: 0; margin-bottom: 2rem;
  background: var(--white); border-radius: 10px; padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200);
}
.step { display: flex; align-items: center; gap: .5rem; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-500);
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step.active .step-num { background: var(--brand); color: var(--white); }
.step.done .step-num { background: var(--success); color: var(--white); }
.step-label { font-size: .8rem; font-weight: 600; color: var(--gray-500); }
.step.active .step-label { color: var(--brand); }
.step-sep { width: 40px; height: 2px; background: var(--gray-200); margin: 0 .5rem; }

/* ===== Cotação ===== */
.cotacao-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

/* ===== Resultado ===== */
.resultado-hero {
  text-align: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-light));
  color: var(--white); padding: 2.5rem;
  border: none;
}
.resultado-label { font-size: .78rem; font-weight: 700; opacity: .8; text-transform: uppercase; letter-spacing: .1em; }
.resultado-valor { font-size: 3.25rem; font-weight: 900; line-height: 1.1; margin: .5rem 0; }
.resultado-sub { font-size: .9rem; opacity: .9; }
.pagamento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pagamento-item {
  border: 2px solid var(--gray-200); border-radius: 10px;
  padding: 1.25rem; text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.pagamento-destaque { border-color: var(--brand); background: #eff6ff; }
.pagamento-label { font-size: .75rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.pagamento-valor { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); }
.pagamento-hint { font-size: .75rem; color: var(--gray-500); margin-top: .25rem; }
.coberturas-list { list-style: none; }
.cobertura-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 0; border-bottom: 1px solid var(--gray-100);
  font-size: .9rem;
}
.cobertura-item span { color: var(--gray-700); }
.cobertura-item strong { color: var(--brand); font-weight: 700; }
.coberturas-extra { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* ===== Pagamento opcoes ===== */
.pagamento-opcoes { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.pagamento-opcao {
  display: flex; align-items: center; gap: .875rem;
  padding: 1rem 1.25rem; border: 2px solid var(--gray-200);
  border-radius: 10px; cursor: pointer; font-size: .9rem;
  transition: border-color .15s, background .15s;
}
.pagamento-opcao:has(input:checked) { border-color: var(--brand); background: #eff6ff; }
.pagamento-opcao input { accent-color: var(--brand); }
.termos-wrap { margin: 1.25rem 0; padding: 1rem 1.25rem; background: var(--gray-50); border-radius: 8px; border: 1px solid var(--gray-200); }

/* ===== Confirmacao ===== */
.confirmacao-card { padding: 3rem 2rem; text-align: center; }
.confirmacao-icon { font-size: 4.5rem; margin-bottom: 1rem; }
.confirmacao-card h1 { font-size: 1.875rem; font-weight: 800; margin-bottom: .5rem; }
.protocolo-box {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 1.25rem 2.5rem;
  display: inline-flex; flex-direction: column; align-items: center;
  gap: .25rem; margin: 1.75rem auto;
}
.protocolo-label { font-size: .7rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .08em; }
.protocolo-num { font-size: 1.375rem; font-weight: 800; color: var(--brand); }
.confirmacao-detalhes { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; margin-top: 1rem; }
.detalhe-item { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.detalhe-item span { font-size: .75rem; color: var(--gray-500); }
.detalhe-item strong { font-size: .9rem; color: var(--gray-900); }
.finalizar-card {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0; text-align: center;
}
.finalizar-card h3 { font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; }
.finalizar-card p { color: var(--gray-500); font-size: .9rem; margin-bottom: 1rem; }
.resultado-final-box { background: var(--white); border-radius: 10px; padding: 1.5rem; margin-top: 1.25rem; }
.resultado-final-box h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.stats-grid { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-val { font-size: 2.25rem; font-weight: 900; color: var(--brand); }
.stat-label { font-size: .75rem; color: var(--gray-500); margin-top: .15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; padding: .2rem .65rem;
  border-radius: 20px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-orange { background: #fff7ed; color: #c2410c; }
.badge-sev-baixa { background: #dcfce7; color: #15803d; }
.badge-sev-media { background: #fef9c3; color: #a16207; }
.badge-sev-alta { background: #fed7aa; color: #c2410c; }
.badge-sev-critica { background: #fee2e2; color: #dc2626; }
.score-pill {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: var(--white); padding: .25rem .75rem;
  border-radius: 20px; font-size: .78rem; font-weight: 700;
}

/* ===== Alerts ===== */
.alert { padding: 1rem 1.25rem; border-radius: 8px; margin-top: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ===== Spinner ===== */
.spinner-wrap { text-align: center; padding: 2.5rem; }
.spinner {
  width: 44px; height: 44px; border: 4px solid var(--gray-200);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Bug report float ===== */
.btn-bug-float {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: var(--white); border: none; border-radius: 50px;
  padding: .8rem 1.375rem; font-size: .88rem; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 20px rgba(220,38,38,.45);
  z-index: 999; transition: all .18s; letter-spacing: .01em;
}
.btn-bug-float:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(220,38,38,.5); }
.score-badge {
  position: fixed; bottom: 5rem; right: 1.5rem;
  background: var(--gray-900); color: var(--white);
  padding: .45rem .875rem; border-radius: 20px;
  font-size: .78rem; font-weight: 700; z-index: 998;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 1000; display: none; align-items: center;
  justify-content: center; padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white); border-radius: 16px; width: 100%;
  max-width: 540px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gray-200);
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  border-radius: 16px 16px 0 0;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--white); }
.btn-close {
  background: rgba(255,255,255,.2); border: none; font-size: 1rem;
  cursor: pointer; color: var(--white); padding: .3rem .6rem;
  border-radius: 6px; transition: background .15s;
}
.btn-close:hover { background: rgba(255,255,255,.35); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: .75rem;
  background: var(--gray-50); border-radius: 0 0 16px 16px;
}
.bug-feedback { margin-top: .75rem; padding: .75rem 1rem; border-radius: 8px; font-size: .875rem; }
.bug-feedback.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.bug-feedback.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ===== Admin ===== */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.admin-login-card { max-width: 380px; width: 100%; }
.admin-login-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.admin-login-card p { color: var(--gray-500); margin-bottom: 1.5rem; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.75rem; font-weight: 800; }
.admin-header p { color: var(--gray-500); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { background: var(--gray-50); padding: .65rem .875rem; text-align: left; font-weight: 700; color: var(--gray-700); border-bottom: 2px solid var(--gray-200); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.table td { padding: .8rem .875rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tr:hover td { background: var(--gray-50); }
.row-top td { background: #fffbeb; }
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: 10px; padding: 1.25rem; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.stat-card .stat-val { display: block; font-size: 1.625rem; font-weight: 800; color: var(--brand); }
.stat-card .stat-label { display: block; font-size: .72rem; color: var(--gray-500); margin-top: .2rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.cobertura-grid { display: flex; flex-direction: column; gap: .5rem; }
.cobertura-item { display: flex; gap: .75rem; align-items: center; padding: .65rem .875rem; border-radius: 8px; font-size: .875rem; }
.encontrado { background: #f0fdf4; border: 1px solid #bbf7d0; }
.nao-encontrado { background: #fef2f2; border: 1px solid #fecaca; }
.bug-id { font-weight: 800; min-width: 58px; font-size: .8rem; }
.bug-desc { flex: 1; color: var(--gray-700); }
.bug-pts { min-width: 50px; text-align: right; font-weight: 700; color: var(--gray-500); }
.bug-status { min-width: 120px; text-align: right; font-size: .78rem; font-weight: 700; }
.bug-status-miss { color: var(--danger); }
.bug-card { border: 1px solid var(--gray-200); border-radius: 10px; margin-bottom: 1rem; overflow: hidden; }
.bug-card-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .8rem 1rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.bug-num { font-weight: 800; color: var(--gray-500); font-size: .78rem; }
.bug-card-body { padding: 1rem; font-size: .875rem; }
.bug-card-body p { margin-bottom: .5rem; color: var(--gray-700); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .cotacao-grid, .form-row, .form-grid { grid-template-columns: 1fr; }
  .instrucoes { grid-template-columns: 1fr; }
  .pagamento-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero-top h1 { font-size: 1.875rem; }
  .hero-card-float { margin: -2rem 1rem 0; padding: 1.5rem; }
}
