@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #72107D;
  --primary-dark: #5d1e8c;
  --primary-hover: #6A23DB;
  --primary-light: #f3e5f5;
  --accent: #842dc7;
  --success: #00b090;
  --green-link: #569956;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --footer-bg: #00242e;
  --footer-text: #ffffff;
  --border: #e0e0e0;
  --danger: #e53935;
}

/* 1. Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

/* 2. Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 3. Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: #e0e0e0;
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width 0.6s ease;
  border-radius: 0 2px 2px 0;
}

/* 4. Page Container */
.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100vh;
  transition: opacity 0.3s ease;
}
.page-container.fade-out {
  opacity: 0;
}

/* 5. Logo Container */
.logo-container {
  text-align: center;
  margin: 24px 0 16px;
}

.logo-img {
  height: 48px;
  display: inline-block;
}

/* 6. Card */
.card {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

/* 7. Page Title */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  font-family: 'Poppins', sans-serif;
}

/* 8. Page Subtitle */
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.page-subtitle a {
  color: var(--green-link);
  text-decoration: underline;
}

/* 9. Page Text */
.page-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 16px;
  font-weight: 600;
}

/* 10. Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(114, 16, 125, 0.3);
}

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

/* 11. Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(114, 16, 125, 0.1);
}

.form-input.error {
  border-color: var(--danger);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.form-radio-option {
  flex: 1;
  min-width: calc(50% - 4px);
}

.form-radio-option input[type=radio] {
  display: none;
}

.form-radio-option label {
  display: block;
  padding: 10px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.form-radio-option input:checked + label {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* 12. PIX Payment Section */
.pix-container {
  text-align: center;
}

.qr-code-box {
  width: 200px;
  height: 200px;
  margin: 16px auto;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #ffffff;
}

.qr-code-box img, .qr-code-box canvas {
  max-width: 100%;
  max-height: 100%;
}

.pix-key-box {
  background-color: #f8f8f8;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
}

.pix-key-box span {
  flex: 1;
  font-size: 11px;
  word-break: break-all;
  color: var(--text-secondary);
  font-family: monospace;
}

.copy-btn {
  padding: 8px 16px;
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.2s;
}

.copy-btn:hover {
  background-color: var(--primary-dark);
}

.copy-btn.copied {
  background-color: var(--success);
}

.valor-display {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0;
}

.timer {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}

.timer.warning {
  color: var(--danger);
  animation: pulse 1s infinite;
}

/* 13. WhatsApp Button */
.whatsapp-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background-color: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.whatsapp-btn:hover {
  background-color: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

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

/* 14. Footer */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 20px;
}

.footer p {
  margin: 2px 0;
}

/* 15. Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

.fade-in-delay-1 {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 0.1s;
}

.fade-in-delay-2 {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 0.2s;
}

.fade-in-delay-3 {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 0.3s;
}

.stagger > *:nth-child(1) { animation-delay: 0.1s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > *:nth-child(2) { animation-delay: 0.2s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > *:nth-child(3) { animation-delay: 0.3s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > *:nth-child(4) { animation-delay: 0.4s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > *:nth-child(5) { animation-delay: 0.5s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stagger > *:nth-child(6) { animation-delay: 0.6s; opacity: 0; animation: fadeInUp 0.5s ease forwards; }

/* 16. Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333333;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background-color: var(--success);
}

.toast.error {
  background-color: var(--danger);
}

/* 18. Image styles */
.icon-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: block;
}

.icon-image-small {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: block;
}

/* 17. Desktop Responsive */
@media (min-width: 768px) {
  .page-container {
    padding: 40px 20px;
  }
  
  .card {
    padding: 40px 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  
  .page-title {
    font-size: 26px;
  }
  
  .page-subtitle {
    font-size: 16px;
  }
  
  .page-text {
    font-size: 16px;
  }
}
