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

:root {
  --bg-primary: #F8F6FF;
  --bg-white: #FFFFFF;
  --purple-900: #3B0764;
  --purple-800: #4C1D95;
  --purple-700: #5B21B6;
  --purple-600: #7C3AED;
  --purple-500: #8B5CF6;
  --purple-400: #A78BFA;
  --purple-300: #C4B5FD;
  --purple-200: #DDD6FE;
  --purple-100: #EDE9FE;
  --purple-50: #F5F3FF;
  --text-dark: #1E1B4B;
  --text-medium: #3B3663;
  --text-light: #6B6394;
  --text-muted: #9B95B5;
  --border: #E8E4F3;
  --green: #10B981;
  --green-light: #D1FAE5;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --shadow-sm: 0 1px 3px rgba(91, 33, 182, 0.06);
  --shadow-md: 0 4px 12px rgba(91, 33, 182, 0.08);
  --shadow-lg: 0 8px 30px rgba(91, 33, 182, 0.12);
  --shadow-xl: 0 12px 40px rgba(91, 33, 182, 0.16);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ===== SCREEN SYSTEM ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
}

/* ===== TELA 1: LOADING ===== */
.screen--loading {
  background: var(--bg-primary);
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
}

.loading-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--purple-300);
  animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.loading-text {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

/* ===== TELA 2: INPUT ===== */
.screen--input {
  background: var(--bg-primary);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.bg-decoration {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
}

.bg-circle--1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--purple-200), transparent);
  top: -80px;
  right: -80px;
}

.bg-circle--2 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--purple-100), transparent);
  bottom: 10%;
  left: -60px;
}

.bg-circle--3 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--purple-200), transparent);
  bottom: -40px;
  right: 20%;
}

.input-screen-content {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

/* Brand */
.brand {
  text-align: center;
  margin-bottom: 40px;
}

.brand-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.brand-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-title span {
  color: var(--purple-600);
}

.brand-subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin-top: 10px;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Section */
.search-section {
  margin-bottom: 36px;
}

.search-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-dark);
  padding: 14px 12px;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Suggestions Dropdown */
.suggestions-dropdown {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-top: 6px;
  overflow: hidden;
  display: none;
  border: 1px solid var(--border);
}

.suggestions-dropdown.visible {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background: var(--purple-50);
}

.suggestion-pin {
  font-size: 16px;
  flex-shrink: 0;
}

.suggestion-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.suggestion-uf {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Primary Button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--border);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-icon {
  font-size: 14px;
}

/* ===== TELA 3: ANALYZING ===== */
.screen--analyzing {
  background: var(--bg-primary);
  align-items: center;
  justify-content: center;
}

.analyzing-content {
  text-align: center;
  padding: 24px;
  max-width: 340px;
}

.analyzing-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--purple-100);
  border-top-color: var(--purple-600);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analyzing-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.analyzing-city {
  font-size: 15px;
  color: var(--purple-600);
  font-weight: 600;
  margin-bottom: 32px;
}

.analyzing-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.3s ease;
}

.step.active {
  color: var(--text-dark);
}

.step.done {
  color: var(--green);
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--purple-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.step.active .step-dot {
  background: var(--purple-600);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.step.active .step-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
  animation: pulse 1s ease-in-out infinite;
}

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

.step.done .step-dot {
  background: var(--green);
}

.step.done .step-dot::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* ===== TELA 4: RESULTADO ===== */
.screen--result {
  background: var(--bg-primary);
  flex-direction: column;
}

.result-content {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* Result Header */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
}

.btn-back:hover {
  color: var(--purple-600);
}

.result-city-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-100);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-700);
}

.city-pin {
  font-size: 14px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-900));
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,0.05), transparent);
  border-radius: 50%;
}

.hero-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.hero-numbers {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-amount {
  font-size: 32px;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
}

.hero-separator {
  font-size: 18px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.hero-sublabel {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Data Cards */
.data-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.data-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  font-size: 24px;
}

.card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  display: block;
}

.card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
  display: block;
}

/* Wounds Section */
.wounds-section {
  margin-bottom: 20px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.wound-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wound-tag {
  padding: 6px 14px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-700);
}

/* Revenue Section */
.revenue-section {
  margin-bottom: 20px;
}

.revenue-calc {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.revenue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.revenue-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.revenue-value {
  font-size: 14px;
  color: var(--text-dark);
  font-weight: 700;
}

.revenue-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.revenue-row--total {
  padding-top: 12px;
}

.revenue-row--total .revenue-label {
  color: var(--text-dark);
  font-weight: 700;
  font-size: 15px;
}

.revenue-row--total .revenue-value {
  color: var(--purple-600);
  font-size: 17px;
  font-weight: 800;
}

/* Motivation */
.motivation-section {
  margin-bottom: 24px;
}

.motivation-card {
  background: linear-gradient(135deg, var(--purple-50), var(--purple-100));
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--purple-200);
}

.motivation-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.motivation-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-medium);
  font-weight: 500;
}

/* CTA */
.cta-section {
  margin-bottom: 24px;
}

.btn-cta {
  padding: 14px 24px;
}

/* Result Footer */
.result-footer {
  text-align: center;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.result-footer p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.5s ease both;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease both;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; }
.fade-in-up-delay-4 { animation-delay: 0.4s; }
.fade-in-up-delay-5 { animation-delay: 0.5s; }
.fade-in-up-delay-6 { animation-delay: 0.6s; }
.fade-in-up-delay-7 { animation-delay: 0.7s; }
.fade-in-up-delay-8 { animation-delay: 0.8s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Counter animation class */
.counting {
  display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 360px) {
  .hero-amount {
    font-size: 24px;
  }

  .brand-title {
    font-size: 22px;
  }
}

@media (min-width: 501px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .screen--input,
  .screen--analyzing {
    border-radius: var(--radius-xl);
    max-width: 500px;
    max-height: 90vh;
    margin: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
  }

  .screen--result {
    max-width: 500px;
    max-height: 90vh;
    margin: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    position: relative;
  }
}
