/* Variables */
:root {
  --bg: #0a0a0a;
  --text: #e8e4e0;
  --text-muted: #9a9590;
  --accent: #c41e3a;
  --accent-soft: #e63950;
  --heart-pink: #ff6b9d;
  --heart-rose: #c41e3a;
  --card-bg: rgba(255, 255, 255, 0.06);
  --font-script: "Great Vibes", cursive;
  --font-serif: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: clamp(14px, 2.5vw, 18px);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 300;
  overflow-x: hidden;
  position: relative;
}

/* Fondo con corazones flotantes */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hearts-bg::before,
.hearts-bg::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, var(--heart-pink) 1px, transparent 1px),
    radial-gradient(circle at 60% 70%, var(--heart-rose) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, var(--heart-pink) 1.5px, transparent 1.5px),
    radial-gradient(circle at 10% 80%, var(--heart-rose) 1px, transparent 1px);
  background-size: 120px 120px, 180px 180px, 100px 100px, 160px 160px;
  background-position: 0 0, 40px 60px, 80px 0, 0 80px;
  opacity: 0.35;
  animation: floatBg 30s linear infinite;
}

.hearts-bg::after {
  animation-duration: 45s;
  animation-direction: reverse;
  opacity: 0.2;
}

@keyframes floatBg {
  from { transform: translate(0, 0); }
  to { transform: translate(-120px, -120px); }
}

/* Corazones SVG flotantes */
.heart {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0.15;
  animation: floatHeart linear infinite;
}

.heart svg {
  width: 100%;
  height: 100%;
  fill: var(--heart-pink);
}

.heart:nth-child(odd) svg { fill: var(--heart-rose); }

@keyframes floatHeart {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.12;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Contenedor principal */
.page {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Carrusel */
.carousel-section {
  width: 100%;
  margin-bottom: 1rem;
}

.carousel {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease-out;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  line-height: 0;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 50vh;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.carousel-btn-prev { left: 8px; }
.carousel-btn-next { right: 8px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot:hover {
  background: var(--text);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Título */
.title {
  font-family: var(--font-script);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  font-weight: 400;
  color: var(--accent);
  margin: 0.5rem 0 0.25rem;
  text-align: center;
  text-shadow: 0 0 30px rgba(196, 30, 58, 0.3);
}

.subtitle {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 400;
  color: var(--accent-soft);
  margin: 0 0 1rem;
  text-align: center;
}

/* Texto romántico */
.text-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.romantic-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Contador */
.countdown-section {
  width: 100%;
  text-align: center;
  margin-bottom: 1.5rem;
}

.countdown-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.heart-button {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 6px 24px rgba(196, 30, 58, 0.45);
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.countdown-item {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  min-width: 64px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.countdown-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.countdown-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* Música */
.music-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.music-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 0.5rem;
}

.music-embed {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.music-embed::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.music-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* QR */
.qr-section {
  width: 100%;
  text-align: center;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.qr-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.qr-wrap {
  display: inline-block;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

#qr-canvas {
  display: block;
}

.qr-url {
  font-size: 0.7rem;
  color: var(--text-muted);
  word-break: break-all;
  margin: 0;
}
