:root {
  --green: #0d7d6b;
  --green-dark: #0a6355;
  --green-soft: #e6f2ef;
  --ink: #172723;
  --muted: #6b7c78;
  --line: #e2e8e5;
  --bg: #f6f9f8;
  --white: #ffffff;
  --warn-bg: #fff4e0;
  --warn-ink: #8a5a00;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(13, 125, 107, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

/* Topbar --------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
  color: var(--green);
}
.lang {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-item {
  border: none;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.lang-item:active, .lang-item.active { background: var(--green-soft); color: var(--green); }

/* Progress ------------------------------------------------------------- */
.progress { padding: 14px 20px 0; }
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Screen --------------------------------------------------------------- */
.screen {
  flex: 1;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 21px; margin: 0; letter-spacing: -0.01em; }
p.sub { color: var(--muted); margin: 0; }

/* Forms ---------------------------------------------------------------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select {
  font: inherit;
  color: var(--ink);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  width: 100%;
  appearance: none;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7c78' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }

/* Buttons -------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 600;
  padding: 15px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow); }
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; }
.btn-ghost { background: var(--white); color: var(--green); border: 1px solid var(--line); }

.spacer { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* Stepper -------------------------------------------------------------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 20px; }
.step-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--white);
  font-size: 28px; color: var(--green); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.step-btn:disabled { opacity: 0.3; }
.step-value { font-size: 48px; font-weight: 700; min-width: 72px; text-align: center; }

/* Choice cards --------------------------------------------------------- */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
}
.choice:active, .choice.selected { border-color: var(--green); background: var(--green-soft); }
.choice .chev { color: var(--muted); }

/* Photo capture -------------------------------------------------------- */
.photo-slot {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.photo-slot.filled { border-style: solid; border-color: var(--green); padding: 8px; }
.photo-slot img { max-width: 100%; border-radius: 8px; display: block; }
.photo-slot .cam { font-size: 30px; }
.photo-hint { font-size: 13px; color: var(--muted); }

/* Banners -------------------------------------------------------------- */
.banner { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner.warn > div + div { margin-top: 4px; }
.banner.info { background: var(--green-soft); color: var(--green-dark); }

/* Campo determinado pelo documento (não editável) --------------------- */
select:disabled, input:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}
.hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.banner.err { background: #fdecec; color: #a12626; }

/* Campo essencial por preencher (extração parcial / validação) ---------- */
label.field.missing > input,
label.field.missing > select {
  border-color: #d64545;
  background: #fdf3f3;
}
label.field.missing > input:focus,
label.field.missing > select:focus {
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}

/* Loading -------------------------------------------------------------- */
.loader { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 40px; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--green-soft); border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.big-emoji { font-size: 56px; text-align: center; }
.center { text-align: center; }
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
