*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #0c2340;
  --navy-light: #163a5f;
  --accent: #0077c8;
  --accent-hover: #005fa3;
  --accent-soft: #e8f4fc;
  --accent-glow: rgba(0, 119, 200, 0.12);
  --bg: #f4f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #059669;
  --success-soft: #ecfdf5;
  --error: #dc2626;
  --error-soft: #fef2f2;
  --shadow-sm: 0 1px 3px rgba(12, 35, 64, 0.06);
  --shadow-md: 0 4px 24px rgba(12, 35, 64, 0.08);
  --shadow-lg: 0 12px 48px rgba(12, 35, 64, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, #dce9f5 0%, var(--bg) 120px),
    var(--bg);
}

/* ── Topbar ── */
.topbar {
  background: var(--navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(12, 35, 64, 0.2);
}

.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}

.brand-mark {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7ec8f0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.85);
}

/* ── Layout ── */
.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 40px;
}

/* ── Hero ── */
.hero {
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  list-style: none;
}

.hero-trust li {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(30, 58, 95, 0.08);
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ── Progress ── */
.progress-section {
  margin-bottom: 10px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  gap: 12px;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.step-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.progress-wrap {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3aa0e0);
  border-radius: 99px;
  width: 14.28%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-dots {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  justify-content: center;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
}

.step-dot.done {
  background: var(--accent);
}

.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-md);
}

.step {
  display: none;
  animation: fadeIn 0.35s ease;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.step h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.field-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* ── Options ── */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-list .option-card {
  width: 100%;
  text-align: center;
  align-items: center;
  padding: 14px 12px;
  gap: 2px;
}

.option-list .option-icon {
  margin-bottom: 4px;
}

.option-list .option-title,
.option-list .option-desc {
  display: block;
  width: 100%;
  text-align: center;
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  text-align: center;
}

.option-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.option-icon {
  color: var(--accent);
  margin-bottom: 2px;
}

.option-icon svg {
  width: 24px;
  height: 24px;
}

.option-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
}

.option-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ── Inputs ── */
.input-field {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-field::placeholder {
  color: var(--text-light);
}

.input-with-suffix {
  position: relative;
}

.input-with-suffix .input-field {
  padding-right: 44px;
}

.input-with-suffix.suffix-left .input-field {
  padding-right: 16px;
  padding-left: 16px;
}

.input-with-suffix.suffix-left .input-suffix {
  left: auto;
  right: 16px;
}

.input-suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
}

/* ── Upload ── */
.upload-area {
  margin-top: 4px;
}

.upload-area.has-file .upload-empty {
  display: none;
}

.upload-area:not(.has-file) .upload-filled {
  display: none !important;
}

.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 20px 16px 18px;
  text-align: center;
}

.upload-zone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.upload-zone-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 2px;
}

.upload-zone-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.upload-zone-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.upload-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--navy);
}

.upload-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.upload-action-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.upload-action-btn:not(.upload-action-primary):hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-doc {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-sm);
}

.upload-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--success-soft);
  border-bottom: 1px solid rgba(5, 150, 105, 0.15);
}

.upload-doc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
}

.upload-doc-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 45%;
}

.upload-doc-frame {
  background: #eef2f6;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: 220px;
}

.upload-doc-frame img {
  max-width: 100%;
  max-height: 196px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(12, 35, 64, 0.12);
}

.upload-doc-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.upload-change-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.upload-change-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Summary ── */
.summary {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.summary dt {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px 2px;
  background: var(--bg);
}

.summary dd {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
  padding: 0 14px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.summary dd:last-of-type {
  border-bottom: none;
}

.summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

.summary-image img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ── Success ── */
.success-screen {
  text-align: center;
  padding: 16px 0 8px;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--success-soft);
  color: var(--success);
  border: 2px solid rgba(5, 150, 105, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
}

.success-screen h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.success-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 360px;
  margin: 0 auto;
}

.result-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(5, 150, 105, 0.2);
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.price-card {
  margin: 24px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.price-main {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: white;
  padding: 22px 20px;
  text-align: center;
}

.price-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.8;
  margin-bottom: 6px;
}

.price-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.price-breakdown {
  background: var(--bg);
  padding: 4px 0;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.price-row:last-child {
  border-bottom: none;
}

.price-row span:last-child {
  font-weight: 600;
  color: var(--text);
}

.price-row-total {
  background: var(--accent-soft);
  font-weight: 600;
}

.price-row-total span {
  color: var(--navy) !important;
  font-size: 0.95rem;
}

.price-positive {
  color: var(--success) !important;
}

.price-disclaimer {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

.success-followup {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ── Analyse ── */
.analyse-screen {
  text-align: center;
  padding: 24px 0 16px;
}

.analyse-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 22px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analyse-screen h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.analyse-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.analyse-steps {
  list-style: none;
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.analyse-steps li {
  position: relative;
  padding: 10px 0 10px 28px;
  font-size: 0.85rem;
  color: var(--text-light);
  transition: color 0.3s;
}

.analyse-steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  transition: border-color 0.3s, background 0.3s;
}

.analyse-steps li.active {
  color: var(--accent);
  font-weight: 600;
}

.analyse-steps li.active::before {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.analyse-steps li.done {
  color: var(--success);
  font-weight: 500;
}

.analyse-steps li.done::before {
  border-color: var(--success);
  background: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  animation: none;
}

/* ── Error ── */
.error-msg {
  color: var(--error);
  background: var(--error-soft);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  margin-top: 16px;
  padding: 12px 16px;
  text-align: center;
}

/* ── Buttons ── */
.nav-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.nav-buttons[hidden],
.nav-buttons.is-hidden {
  display: none !important;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 119, 200, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: white;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  flex: 0 0 auto;
  padding-inline: 18px;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg);
}

/* ── Footer ── */
.footer {
  margin-top: 32px;
  text-align: center;
}

.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-bottom: 14px;
}

.trust-row span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.trust-row svg {
  color: var(--accent);
  flex-shrink: 0;
}

.share-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: white;
  background: #25d366;
  border-radius: var(--radius-xs);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-whatsapp:hover {
  background: #1fb855;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.footer-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #128c7e;
  text-decoration: none;
}

.footer-whatsapp:hover {
  color: #075e54;
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .option-grid {
    grid-template-columns: 1fr;
  }

  .upload-zone-actions {
    flex-direction: column;
  }

  .upload-action-btn {
    width: 100%;
    justify-content: center;
  }

  .app {
    padding-top: 10px;
  }

  .card {
    padding: 14px 12px 12px;
  }

  .step-header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .step-num {
    width: 30px;
    height: 30px;
    font-size: 0.68rem;
  }

  .step-dots {
    display: none;
  }

  .option-list .option-card {
    padding: 12px 10px;
  }

  .topbar-badge {
    display: none;
  }
}

@media (min-width: 768px) {
  .camera-btn {
    display: none;
  }
}
