:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --secondary: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --error: #ef4444;
  --whatsapp: #25d366;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 35%),
    radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.18), transparent 34%),
    linear-gradient(135deg, #f0f9ff 0%, #dbeafe 52%, #eff6ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#root {
  flex: 1;
  display: flex;
}

.app-stage {
  width: 100%;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 20px;
}

.app-container {
  width: 100%;
  max-width: 448px;
}

.app-card {
  position: relative;
  overflow: hidden;
  padding: 40px 32px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: card-enter 0.7s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 22px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
  animation: float 3s ease-in-out infinite;
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.app-subtitle {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.55;
}

.feature-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.feature-card {
  flex: 1;
  padding: 16px 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.07);
}

.feature-card i {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 22px;
}

.feature-card span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #dbe5f1;
  transition: all 0.3s ease;
}

.step-dot.active {
  width: 36px;
  background: var(--primary);
}

.panel {
  min-height: 280px;
}

.is-hidden {
  display: none;
}

.input-wrap {
  margin-bottom: 24px;
}

.code-input {
  width: 100%;
  padding: 17px 20px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text-primary);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  transform: scale(1.01);
}

.code-input.is-valid {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.code-input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-hint,
.error-message {
  margin-top: 10px;
  font-size: 14px;
}

.input-hint {
  color: var(--text-muted);
}

.error-message {
  display: none;
  color: var(--error);
}

.primary-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.34);
}

.primary-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.primary-btn.whatsapp {
  background: linear-gradient(135deg, var(--whatsapp), #128c7e);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.28);
}

.primary-btn.whatsapp:hover {
  box-shadow: 0 18px 34px rgba(37, 211, 102, 0.35);
}

.trust-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.trust-pill i {
  color: var(--success);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  margin: 12px auto 24px;
  border: 4px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.success-mark {
  width: 84px;
  height: 84px;
  margin: 8px auto 24px;
}

.success-mark svg {
  width: 100%;
  height: 100%;
}

.success-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-check {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.55s forwards;
}

.result-message {
  margin: 18px 0 14px;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
}

.code-display {
  display: inline-block;
  margin: 0 4px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid rgba(37, 99, 235, 0.15);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.disclaimer {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.site-footer {
  padding: 8px 20px 24px;
}

.page-navigation {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.nav-link {
  color: rgba(15, 23, 42, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--primary);
}

.fade-in {
  animation: fade-in 0.35s ease;
}

.slide-up {
  animation: slide-up 0.45s ease;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes stroke {
  to {
    stroke-dashoffset: 0;
  }
}

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

@media (max-width: 520px) {
  .app-stage {
    padding-top: 18px;
  }

  .app-card {
    padding: 32px 20px 24px;
    border-radius: 22px;
  }

  .feature-grid {
    gap: 10px;
  }

  .feature-card {
    padding: 14px 8px;
  }

  .feature-card span {
    font-size: 12px;
  }

  .trust-row {
    gap: 14px;
  }
}

@media (max-width: 380px) {
  .feature-grid {
    flex-direction: column;
  }

  .panel {
    min-height: 316px;
  }
}
