/* ══════════════════════════════════════════════════
   TEMA — altere apenas estas variáveis para rebrandear
   ══════════════════════════════════════════════════ */
:root {
  /* ✏️ COR PRIMÁRIA (fundo de header, hero, botões navy) — Cinza Lancers */
  --navy:       #58585A;
  --navy-dark:  #444444;
  --navy-light: #6B6B6B;

  /* ✏️ COR DE DESTAQUE (botões primários, foco, ícones) — Laranja Lancers */
  --teal:       #EE7D22;
  --teal-light: #FFA45B;
  --teal-pale:  #FEF0E3;

  /* — neutros (não costuma precisar alterar) — */
  --white:    #fff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;

  /* — semânticas — */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;

  /* — geometria — */
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(88,88,90,0.12);
  --shadow-sm: 0 2px 8px rgba(88,88,90,0.08);
  --t:         all 0.22s cubic-bezier(0.4,0,0.2,1);
}

html, body { overflow-x: hidden; max-width: 100vw; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--gray-50);
  color: var(--gray-700);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* ── HEADER ── */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.app-header img { height: 38px; }
.header-step-label {
  font-size: 12px; font-weight: 600; color: var(--teal);
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* ── BARRA DE PROGRESSO ── */
.progress-wrap {
  background: var(--white);
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--gray-100);
  position: sticky; top: 63px; z-index: 99;
}
.progress-track { height: 4px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.progress-steps { display: flex; justify-content: space-between; margin-top: 8px; }
.progress-step-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--gray-400);
  transition: var(--t);
}
.progress-step-dot.active { background: var(--teal); color: white; box-shadow: 0 0 0 3px var(--teal-pale); }
.progress-step-dot.done   { background: var(--navy); color: white; font-size: 10px; }
.progress-step-dot.done::after { content: '✓'; }
.progress-step-dot.done span   { display: none; }

/* ── CONTAINER ── */
.container { max-width: 620px; margin: 0 auto; padding: 24px 20px; }

/* ── STEPS (wizard) ── */
.step { display: none; animation: fadeSlide 0.3s ease; }
.step.active { display: block; }
@keyframes fadeSlide { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}
.card-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.card-icon {
  width: 44px; height: 44px;
  background: var(--teal-pale); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.card-title   { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.card-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 3px; line-height: 1.5; }

/* ── HERO BOAS-VINDAS ── */
.welcome-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius);
  padding: 32px 24px; text-align: center; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.welcome-hero::before {
  content:''; position:absolute; top:-40px; right:-40px;
  width:160px; height:160px;
  background:radial-gradient(circle,rgba(238,125,34,0.25),transparent 70%);
  border-radius:50%;
}
.welcome-hero img { height: 44px; margin-bottom: 20px; filter: brightness(0) invert(1); }
.hero-logo-wrap {
  background: white; border-radius: 10px; padding: 10px 22px;
  display: inline-block; margin-bottom: 20px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.18);
}
.hero-logo-wrap img { height: 40px; display: block; filter: none; margin-bottom: 0; }
.welcome-hero h1 { font-size: 22px; font-weight: 700; color: white; margin-bottom: 8px; }
.welcome-hero p  { font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.6; }
.welcome-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(238,125,34,0.2); border: 1px solid rgba(238,125,34,0.5);
  border-radius: 99px; padding: 6px 14px;
  font-size: 12px; font-weight: 600; color: var(--teal-light); margin-top: 16px;
}

/* ── FORMULÁRIOS ── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--gray-600); margin-bottom: 6px;
  letter-spacing: 0.02em; text-transform: uppercase;
}
label .req { color: var(--danger); margin-left: 2px; }

input[type=text], input[type=email], input[type=tel],
input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif; font-size: 14px;
  color: var(--gray-700); background: var(--white);
  transition: var(--t); outline: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(238,125,34,0.14);
}
input.prefilled { background: var(--gray-50); color: var(--navy); font-weight: 600; }
input.error, select.error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
textarea { resize: vertical; min-height: 80px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}

/* ── DECLARAÇÃO DE SAÚDE ── */
.ds-question {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: start; padding: 14px 0; border-bottom: 1px solid var(--gray-100);
}
.ds-question:last-child { border-bottom: none; }
.ds-q-num  { font-size: 11px; font-weight: 700; color: var(--teal); margin-bottom: 4px; letter-spacing: 0.05em; }
.ds-q-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.ds-q-answer { display: flex; gap: 6px; flex-shrink: 0; }

.btn-sn {
  width: 40px; height: 36px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: white; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--t); font-family: 'Poppins', sans-serif;
}
.btn-sn.s-btn:hover  { border-color: var(--danger); color: var(--danger); }
.btn-sn.n-btn:hover  { border-color: var(--success); color: var(--success); }
.btn-sn.s-btn.active { background: var(--danger);  border-color: var(--danger);  color: white; }
.btn-sn.n-btn.active { background: var(--success); border-color: var(--success); color: white; }

.ds-clarification { grid-column: 1 / -1; display: none; margin-top: 8px; }
.ds-clarification.visible { display: block; }
.ds-clarification textarea { border-color: var(--warning); font-size: 13px; }
.ds-clarification label { color: var(--warning); text-transform: none; font-size: 12px; letter-spacing: 0; font-weight: 500; margin-bottom: 4px; }

/* ── TÍTULO DE SEÇÃO ── */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 20px 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.section-badge {
  display: inline-block; padding: 2px 8px;
  background: var(--teal-pale); color: var(--teal);
  border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
}

/* ── CARD DE DEPENDENTE ── */
.dep-card {
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.dep-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dep-card-title { font-size: 14px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.dep-badge { font-size: 10px; padding: 3px 8px; border-radius: 99px; font-weight: 700; }
.dep-badge.adulto   { background: var(--navy); color: white; }
.dep-badge.infantil { background: var(--teal); color: white; }
.btn-remove-dep {
  width: 28px; height: 28px; border: none;
  background: rgba(239,68,68,0.1); color: var(--danger);
  border-radius: 50%; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ── UPLOAD ── */
.upload-zone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; cursor: pointer;
  transition: var(--t); background: var(--gray-50); position: relative;
}
.upload-zone:hover { border-color: var(--teal); background: var(--teal-pale); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon  { font-size: 28px; margin-bottom: 8px; }
.upload-label { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.upload-hint  { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.upload-files { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.upload-file-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: white;
  padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.upload-file-tag button { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 12px; padding: 0; line-height: 1; }

/* ── ACEITE / CHECKBOX ── */
.aceite-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  background: var(--teal-pale); border: 1.5px solid rgba(238,125,34,0.3);
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 10px;
}
.aceite-row input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); cursor: pointer; flex-shrink: 0; }
.aceite-text { font-size: 13px; color: var(--navy); font-weight: 500; line-height: 1.5; }

/* ── BOTÃO ABRIR TERMO ── */
.btn-ler-termo {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 14px 18px; background: var(--gray-50);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--t);
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; color: var(--navy);
  margin-bottom: 14px; text-align: left;
}
.btn-ler-termo:hover { border-color: var(--teal); background: var(--teal-pale); color: var(--teal); }
.btn-ler-termo .termo-icon  { font-size: 20px; flex-shrink: 0; }
.btn-ler-termo .termo-info  { flex: 1; }
.btn-ler-termo .termo-title { font-size: 13px; font-weight: 700; }
.btn-ler-termo .termo-sub   { font-size: 11px; color: var(--gray-400); font-weight: 400; margin-top: 2px; }
.btn-ler-termo .termo-arrow { color: var(--teal); font-size: 16px; }

/* ── MODAL (bottom sheet) ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(50,50,50,0.78); z-index: 999;
  align-items: flex-end; justify-content: center; padding: 0;
}
.modal-overlay.open { display: flex; animation: fadeBg 0.2s ease; }
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: white; width: 100%; max-width: 620px;
  border-radius: 20px 20px 0 0; max-height: 88vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 40px; height: 4px; background: var(--gray-300); border-radius: 99px; margin: 12px auto 0; flex-shrink: 0; }
.modal-head   { padding: 16px 24px; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.modal-head-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-close  { width: 32px; height: 32px; border: none; background: var(--gray-100); border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--gray-500); }
.modal-scroll { flex: 1; overflow-y: auto; padding: 20px 24px; font-size: 13.5px; color: var(--gray-700); line-height: 1.75; }
.modal-scroll h3  { font-size: 15px; font-weight: 700; color: var(--navy); margin: 16px 0 8px; }
.modal-scroll h4  { font-size: 13px; font-weight: 700; color: var(--navy); margin: 14px 0 6px; }
.modal-scroll p   { margin-bottom: 12px; }
.modal-scroll ul  { padding-left: 20px; margin-bottom: 12px; }
.modal-scroll li  { margin-bottom: 6px; }
.modal-scroll strong { color: var(--navy); }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--gray-100); flex-shrink: 0; }

/* ── REVISÃO ── */
.revisao-item { display: flex; justify-content: space-between; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--gray-100); gap: 12px; }
.revisao-item:last-child { border-bottom: none; }
.revisao-label { font-size: 12px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0; }
.revisao-value { font-size: 13px; color: var(--navy); font-weight: 600; text-align: right; }

/* ── ASSINATURA ── */
.assinatura-info { background: var(--navy); border-radius: var(--radius-sm); padding: 16px; color: white; }
.assinatura-info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 12.5px; }
.assinatura-info-row:last-child { border-bottom: none; }
.assinatura-info-row span:first-child { color: rgba(255,255,255,0.6); font-weight: 500; }
.assinatura-info-row span:last-child  { color: white; font-weight: 600; }

/* ── BOTÕES ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 24px; border: none; border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--t); letter-spacing: 0.02em;
}
.btn-primary   { background: linear-gradient(135deg, var(--teal), var(--teal-light)); color: white; box-shadow: 0 4px 12px rgba(238,125,34,0.38); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(238,125,34,0.50); }
.btn-secondary { background: var(--gray-100); color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-navy { background: var(--navy); color: white; box-shadow: 0 4px 12px rgba(88,88,90,0.32); }
.btn-navy:hover { background: var(--navy-dark); }
.btn-group { display: flex; gap: 10px; }
.btn-group .btn { flex: 1; }
.btn-add-dep {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px;
  border: 2px dashed var(--teal); border-radius: var(--radius-sm);
  background: var(--teal-pale); color: var(--teal);
  font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--t);
}

/* ── ALERTAS ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; display: flex; align-items: start; gap: 10px; margin-bottom: 14px; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── TELA DE SUCESSO ── */
.success-screen { text-align: center; padding: 40px 20px; }
.success-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--success), #34d399);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(16,185,129,0.35);
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-title    { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.success-subtitle { font-size: 14px; color: var(--gray-500); line-height: 1.6; }
.protocol-box { background: var(--navy); border-radius: var(--radius); padding: 16px 24px; margin: 24px 0; color: white; font-size: 13px; }
.protocol-num { font-size: 22px; font-weight: 700; color: var(--teal-light); letter-spacing: 0.06em; margin-top: 6px; }

/* ── LOADING OVERLAY ── */
.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(68,68,68,0.78); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.loading-overlay.active { display: flex; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--teal-light); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: white; font-size: 14px; font-weight: 600; }

/* ── CAMPOS FÍSICOS ── */
.physical-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

/* ── SCROLLBAR FINA (modal) ── */
.modal-scroll::-webkit-scrollbar { width: 4px; }
.modal-scroll::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ── STATUS DS ── */
.ds-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
}
.ds-status-badge.pendente  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.ds-status-badge.concluida { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── STATUS PROPOSTA ── */
.status-card { text-align: center; padding: 32px 20px; }
.status-icon { font-size: 48px; margin-bottom: 16px; }
.status-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.status-msg { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

@media (max-width: 480px) {
  .form-row.cols-2 { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
  .container { padding: 16px 14px; }
  .card { padding: 18px 16px; }
}
