:root {
  --bg: #FFFFFF;
  --bg-soft: #F9FAFB;
  --surface: #FFFFFF;
  --surface2: #F3F4F6;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --accent: #6366F1;
  --accent-light: #EEF2FF;
  --fail: #EF4444;
  --fail-light: #FEF2F2;
  --warn: #F59E0B;
  --warn-light: #FFFBEB;
  --pass: #10B981;
  --pass-light: #ECFDF5;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}
.screen.active { display: flex; }

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.logo span {
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* URL form */
.url-form {
  max-width: 540px;
  margin: 0 auto;
}
.url-input-wrap {
  display: flex;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color .2s;
}
.url-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.url-input-wrap input {
  flex: 1;
  padding: 16px 18px;
  border: none;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  outline: none;
}
.url-input-wrap input::placeholder { color: #9CA3AF; }
.url-input-wrap .btn-primary {
  border-radius: 0;
  padding: 16px 28px;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.url-form .field-error {
  text-align: left;
  margin-top: 6px;
}
.url-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.btn-primary {
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.btn-primary:hover { background: #4F46E5; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.hero-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Features */
.features {
  padding: 48px 0 64px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}
.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  margin: 0 auto 14px;
}
.feature-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Scan screen */
.scan-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.scan-url-display {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
  word-break: break-all;
  background: var(--bg-soft);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.progress-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 32px;
}
.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress-ring__bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}
.progress-ring__fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 389.56;
  stroke-dashoffset: 389.56;
  transition: stroke-dashoffset .5s ease;
}
.progress-ring__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.check-list {
  list-style: none;
  width: 100%;
  max-width: 440px;
}
.check-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}
.check-list li .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.scanning {
  background: var(--accent);
  animation: pulse .8s ease-in-out infinite;
}
.dot.done-pass { background: var(--pass); }
.dot.done-fail { background: var(--fail); }
.dot.done-warn { background: var(--warn); }
.dot.done-info { background: var(--text-muted); }

.check-list li .mini-result {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ========== POPUP ========== */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.popup-overlay.active {
  display: flex;
  animation: fadeIn .3s ease;
}
.popup-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: slideUp .4s ease;
}
.popup-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}
.popup-score-ring svg { width: 100%; height: 100%; }
.popup-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: 800;
}
.popup-greeting {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.popup-segment {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: .5px;
}
.popup-segment.seg-red { background: var(--fail-light); color: var(--fail); }
.popup-segment.seg-yellow { background: var(--warn-light); color: #B45309; }
.popup-segment.seg-green { background: var(--pass-light); color: #047857; }
.popup-summary {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.popup-card .btn-primary { width: 100%; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== LEAD FORM ========== */
.lead-container {
  max-width: 580px;
  padding-top: 40px;
  padding-bottom: 60px;
}
.lead-header {
  text-align: center;
  margin-bottom: 28px;
}
.lead-lock-icon {
  margin-bottom: 12px;
}
.lead-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}
.lead-header p {
  font-size: 15px;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.field input.error,
.field select.error {
  border-color: var(--fail);
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--fail);
  margin-top: 3px;
  min-height: 16px;
}

#form-lead .btn-primary {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  margin-top: 6px;
}

.form-disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ========== RESULT ========== */
.score-card {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  margin: 32px 0;
}
.score-value {
  font-size: 72px;
  font-weight: 800;
  display: inline;
  line-height: 1;
}
.score-slash {
  font-size: 28px;
  color: var(--text-muted);
  display: inline;
  font-weight: 600;
}
.score-verdict {
  font-size: 17px;
  margin-top: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.check-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 10px;
}
.check-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check-card__icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.check-card__name {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.check-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
}
.check-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}
.check-card__impact {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}
.check-card__toggle {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  margin-top: 10px;
  background: none;
  border: none;
  font-family: var(--font);
  font-weight: 500;
  padding: 0;
}
.check-card__details {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
}
.check-card__details.open { display: block; }

/* Third party */
.third-party-section { margin-bottom: 24px; }
.third-party-section h2 { font-size: 18px; margin-bottom: 14px; }
.tp-category {
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.tp-category__name { font-weight: 500; }
.tp-category__count { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* CTA */
.cta-box {
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 32px;
  background: var(--accent-light);
}
.cta-box h2 { font-size: 20px; margin-bottom: 8px; }
.cta-box p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.btn-whatsapp {
  display: inline-block;
  padding: 14px 32px;
  background: #25d366;
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.btn-whatsapp:hover { background: #1EB954; }

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 24px;
}

/* Mobile */
@media (max-width: 640px) {
  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 15px; }
  .url-input-wrap { flex-direction: column; }
  .url-input-wrap .btn-primary { border-radius: 0; }
  .features-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .score-value { font-size: 56px; }
  .popup-card { padding: 28px 20px; }
  .hero-trust { flex-direction: column; align-items: center; gap: 10px; }
}
