:root {
  --ink: #2a1308;
  --muted: #7d6b5f;
  --line: #eadfce;
  --surface: #fffaf2;
  --cream: #faf6ee;
  --soft: #f4eadb;
  --accent: #5a2a0e;
  --accent-dark: #3d1a08;
  --gold: #f5c518;
  --danger: #a3321f;
  --success: #2f7a4b;
  --shadow: 0 24px 70px rgba(90, 42, 14, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(245, 197, 24, 0.2), transparent 34%),
    var(--cream);
}

button,
input {
  font: inherit;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--cream);
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.mobile-shell {
  width: min(100%, 440px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 246, 238, 0.96);
  backdrop-filter: blur(14px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 46px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
  font-weight: 900;
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 16px;
}

.step-indicator span {
  height: 4px;
  border-radius: 999px;
  background: #d7dee6;
}

.step-indicator span.active {
  background: var(--accent);
}

.screen {
  display: none;
  padding: 22px 18px 28px;
}

.screen.active {
  display: block;
}

.screen-copy {
  margin-bottom: 22px;
}

.screen-copy h2 {
  margin: 0 0 10px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

.screen-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label,
.choice-field legend,
.range-head label,
.control-title,
.signature-box label {
  color: #344054;
  font-size: 0.88rem;
  font-weight: 800;
}

.stack-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  outline: none;
}

.stack-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 109, 119, 0.12);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.choice-field {
  display: grid;
  gap: 10px;
  margin: 8px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-field label {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
}

.choice-field input,
.consent-row input {
  width: 18px;
  min-height: 18px;
}

.offer-card {
  padding: 20px;
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(90, 42, 14, 0.94), rgba(61, 26, 8, 0.82)),
    url("assets/loan-hero.png") center / cover;
  color: var(--cream);
}

.offer-card strong {
  display: block;
  margin: 6px 0 12px;
  font-size: 2.8rem;
  line-height: 0.95;
}

.offer-card span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(245, 197, 24, 0.18);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.metric-row div,
.simulator-panel,
.camera-panel,
.signature-box,
.done-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric-row div {
  padding: 14px;
}

.metric-row span,
.installment-card span,
.installment-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-row strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.simulator-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
}

.range-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.range-head output {
  font-weight: 900;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.control-title {
  margin: 2px 0 -4px;
}

.term-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.term-options button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
}

.term-options button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--cream);
}

.installment-card {
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.installment-card strong {
  display: block;
  margin: 5px 0;
  font-size: 1.65rem;
}

.camera-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
}

#selfie-video,
#selfie-preview {
  display: none;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: #101820;
  object-fit: cover;
}

#selfie-video.active,
#selfie-preview.active {
  display: block;
}

#selfie-canvas {
  display: none;
}

.signature-box {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
}

.signature-box div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#clear-signature {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

#signature-pad {
  width: 100%;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.done-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px;
  text-align: center;
}

.done-icon {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(245, 197, 24, 0.22);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 900;
}

.done-card h2 {
  margin: 0;
  font-size: 1.7rem;
}

.done-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  background: #25d366;
  color: #102a1d;
  font-weight: 900;
  text-decoration: none;
}

@media (min-width: 760px) {
  body {
    padding: 24px;
  }

  .mobile-shell {
    min-height: calc(100vh - 48px);
    border-radius: 8px;
    overflow: hidden;
  }
}
