/* ==================== Reset & Variables ==================== */
:root {
  --verde: #16a34a;
  --amarelo: #facc15;
  --azul: #1e3a8a;
  --cinza: #f3f4f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cinza);
  color: #111;
  line-height: 1.6;
}

/* ==================== Header ==================== */
header {
  background: linear-gradient(90deg, #047857, #1e3a8a);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

header p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ==================== Subheader ==================== */
.subheader {
  background: var(--amarelo);
  text-align: center;
  padding: 1.5rem 1rem;
}

.subheader h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #111;
}

.subheader p {
  margin: 0 auto;
  max-width: 700px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==================== VSL Container ==================== */
.vsl {
  max-width: 420px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  aspect-ratio: 9 / 16;
}

.vsl video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  pointer-events: none;
}

.sound-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 280px;
  height: 160px;
  background: var(--verde);
  color: #fff;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  z-index: 5;
}

.sound-btn .sound-top {
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.sound-btn .sound-bottom {
  font-size: 14px;
}

.sound-btn svg {
  width: 48px;
  height: 48px;
}

@media (max-width: 720px) {
  .sound-btn {
    width: 240px;
    height: 120px;
  }
}

/* ==================== Stats Cards ==================== */
.stats {
  max-width: 1000px;
  margin: 1rem auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0 1rem;
}

.stat-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.stat-card .dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #7ae28f 55%, #16a34a);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
  flex-shrink: 0;
}

.stat-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #555;
}

.stat-card .number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--azul);
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* ==================== Progress Bar ==================== */
.progress {
  max-width: 1000px;
  margin: 0 auto 1.5rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #16a34a);
  width: 26%;
  transition: width 1s ease-out;
}

/* ==================== Donate Section ==================== */
section.donate {
  background: var(--verde);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

section.donate h2 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
}

section.donate p {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  font-size: 0.9rem;
  opacity: 0.95;
}

/* ==================== Donation Buttons ==================== */
.donation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.donation-buttons button {
  background: var(--amarelo);
  color: #111;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.donation-buttons button:hover:enabled {
  transform: translateY(-4px);
  filter: brightness(0.95);
}

.donation-buttons.loading button:not(.loading-btn) {
  opacity: 0.7;
  pointer-events: none;
}

/* ==================== Donation Info ==================== */
.donation-info {
  display: grid;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.donation-info h3 {
  font-size: 1.2rem;
  font-weight: 800;
}

.donation-info p {
  font-size: 0.9rem;
  color: #e8f5e8;
}

/* ==================== Footer ==================== */
footer {
  background: var(--azul);
  color: #fff;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.9rem;
}

/* ==================== Modal ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  padding: 0;
  position: relative;
  overflow: hidden;
  text-align: center;
  z-index: 10000;
}

.modal-header {
  background: var(--verde);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  padding: 12px;
  position: relative;
}

.modal-header button.close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 18px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

#pixQr {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}

#pixQr svg {
  max-width: 150px;
  height: auto;
}

#pixQr canvas {
  border: 2px solid #ddd;
  border-radius: 10px;
  display: block;
  margin: 10px auto;
}

.pix-code-box {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  text-align: left;
  word-break: break-all;
  margin-top: 8px;
}

.copy-btn {
  background: var(--verde);
  color: #fff;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  margin: 10px 0;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.copy-btn:hover {
  background: #15803d;
}

.copy-btn svg {
  margin-right: 5px;
}

/* ==================== Spinner ==================== */
.spinner {
  border: 2px solid rgba(0,0,0,0.2);
  border-top: 2px solid #111;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-block;
  animation: spin 1s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ==================== Copy Alert ==================== */
#copyAlert {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--verde);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  display: none;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  align-items: center;
  gap: 8px;
  z-index: 99999;
  animation: fadeInOut 3s forwards;
}

#copyAlert svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* ==================== Breathing Animation ==================== */
#pixStatus.breath {
  animation: breath 2s ease-in-out infinite;
}

@keyframes breath {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}
