/* Antislop crafted design system: Warm romantic palette, readable, purposeful */
:root {
  --bg-gradient-start: #fff1f2;
  --bg-gradient-end: #ffe4e6;
  --surface-white: #ffffff;
  --surface-cream: #fffaf8;
  --primary-rose: #e11d48;
  --primary-rose-hover: #be123c;
  --primary-rose-active: #9f1239;
  --text-primary: #4c0519;
  --text-secondary: #831843;
  --text-muted: #9f1239;
  --border-soft: #fecdd3;
  --border-focus: #e11d48;
  --envelope-body: #fb7185;
  --envelope-dark: #f43f5e;
  --envelope-flap: #e11d48;
  --shadow-elevation: 0 10px 30px rgba(159, 18, 57, 0.08);
  --shadow-button: 0 4px 14px rgba(225, 29, 72, 0.25);
  --radius-card: 24px;
  --radius-button: 16px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 20%, var(--bg-gradient-start), var(--bg-gradient-end));
  min-height: 100vh;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Background Canvas for Hearts & Confetti */
#heartCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Audio Control Top Floating Pill */
.audio-control-wrapper {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}

.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-white);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(159, 18, 57, 0.08);
  min-height: 44px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.music-btn:hover {
  background: #fff5f7;
  transform: translateY(-1px);
}

.music-btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

/* Layout Container */
.app-container {
  width: 100%;
  max-width: 580px;
  padding: 80px 20px 40px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Generic Step Card */
.step-card {
  width: 100%;
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.step-card.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 1;
  transform: translateY(0);
}

.card-inner {
  background: var(--surface-white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  padding: 36px 28px;
  box-shadow: var(--shadow-elevation);
  width: 100%;
  text-align: center;
  position: relative;
}

/* =========================================
   STEP 1: ENVELOPE DESIGN
   ========================================= */
.envelope-wrapper {
  position: relative;
  width: 220px;
  height: 160px;
  margin: 20px auto 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.envelope {
  width: 220px;
  height: 150px;
  background: var(--envelope-body);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 12px 28px rgba(159, 18, 57, 0.15);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.envelope:hover {
  transform: translateY(-4px) scale(1.02);
}

.envelope:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 4px;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 110px solid transparent;
  border-right: 110px solid transparent;
  border-top: 85px solid var(--envelope-flap);
  transform-origin: top;
  transition: transform 0.5s ease;
  z-index: 4;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 110px solid var(--envelope-dark);
  border-right: 110px solid var(--envelope-dark);
  border-bottom: 75px solid var(--envelope-body);
  border-radius: 0 0 12px 12px;
  z-index: 3;
}

.envelope-letter-preview {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  height: 100px;
  background: #ffffff;
  border-radius: 6px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.5s ease 0.2s;
}

.envelope.open .envelope-letter-preview {
  transform: translateY(-60px);
}

.envelope-seal {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  background: #be123c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(190, 18, 60, 0.3);
  transition: opacity 0.3s ease;
}

.envelope.open .envelope-seal {
  opacity: 0;
  pointer-events: none;
}

.seal-heart {
  font-size: 1.25rem;
}

.envelope-text-wrapper {
  text-align: center;
}

.script-title {
  font-family: 'Sacramento', cursive;
  font-size: 3.5rem;
  color: var(--primary-rose);
  line-height: 1.1;
  margin-bottom: 8px;
}

.envelope-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 24px;
  font-weight: 500;
}

/* =========================================
   BUTTON STYLES & INTERACTION
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  min-height: 50px;
  padding: 12px 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
  user-select: none;
}

.btn:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary-rose);
  color: #ffffff;
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background: var(--primary-rose-hover);
  transform: translateY(-2px);
}

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

.pulse-btn {
  animation: pulseScale 2s infinite ease-in-out;
}

@keyframes pulseScale {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* =========================================
   STEP 2: CONFESSION & DODGING NO BUTTON
   ========================================= */
.sticker-badge {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: floatEmoji 3s ease-in-out infinite;
}

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

.question-title {
  font-family: 'Caveat', cursive;
  font-size: 2.6rem;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.letter-body {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.highlight-question {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-rose);
  margin-top: 18px;
  padding: 12px;
  background: #fff1f2;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-soft);
}

.actions-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 140px;
  margin-bottom: 12px;
  padding: 16px 12px;
  border-radius: 18px;
  background: #fff8f9;
  border: 1px dashed var(--border-soft);
  overflow: hidden;
}

.btn-yes {
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
  z-index: 10;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), font-size 0.25s ease;
}

.btn-yes:hover {
  background: #be123c;
  transform: scale(1.06);
}

.btn-no {
  background: #fff;
  color: #be123c;
  border: 2px solid #fecdd3;
  box-shadow: 0 2px 8px rgba(190, 18, 60, 0.1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9;
}

.no-hint-text {
  min-height: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-rose);
}

/* =========================================
   STEP 3: CELEBRATION CONTENT
   ========================================= */
.celebration-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffe4e6;
  color: var(--primary-rose-hover);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.celebration-title {
  font-family: 'Caveat', cursive;
  font-size: 2.8rem;
  color: var(--primary-rose);
  margin-bottom: 8px;
  line-height: 1.2;
}

.celebration-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
}

/* Wholesome Couple GIFs */
.gif-wrapper {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.couple-gif {
  width: 130px;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(159, 18, 57, 0.08);
}

.celebration-gif-wrapper {
  margin: 16px auto 14px;
  display: flex;
  justify-content: center;
}

.celebration-gif {
  width: 170px;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(159, 18, 57, 0.12);
  transition: transform 0.3s ease;
}

.celebration-gif:hover {
  transform: scale(1.04);
}

.gentle-decline-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 12px;
  margin-top: 10px;
  font-weight: 500;
  transition: color 0.2s;
  min-height: 44px;
}

.gentle-decline-link:hover {
  color: var(--text-primary);
}

.gentle-decline-link:focus-visible {
  outline: 2px solid var(--border-focus);
  border-radius: 6px;
}

/* Reason & Confession Form */
.reason-form-box {
  background: var(--surface-cream);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 22px 18px;
  margin-top: 18px;
  text-align: left;
}

.choice-group {
  margin-bottom: 16px;
}

.choice-label, .form-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.choice-options {
  display: flex;
  gap: 10px;
}

.choice-pill {
  flex: 1;
  cursor: pointer;
  position: relative;
}

.choice-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-ui {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 44px;
  text-align: center;
  transition: all 0.2s ease;
  user-select: none;
}

.choice-pill input[type="radio"]:checked + .pill-ui {
  background: #ffe4e6;
  border-color: var(--primary-rose);
  color: var(--primary-rose-hover);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
  font-weight: 700;
}

.choice-pill:focus-within .pill-ui {
  outline: 3px solid var(--border-focus);
}

.form-group {
  margin-bottom: 14px;
}

.reason-textarea {
  width: 100%;
  border: 1.5px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: #ffffff;
  resize: vertical;
  min-height: 110px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reason-textarea:focus-visible {
  outline: none;
  border-color: var(--primary-rose);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

.btn-submit {
  width: 100%;
  margin-top: 10px;
  min-height: 50px;
}

.btn-whatsapp {
  background: #059669;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-whatsapp:hover {
  background: #047857;
  transform: translateY(-2px);
}

.btn-whatsapp:active {
  background: #065f46;
  transform: translateY(0);
}

.btn-whatsapp:focus-visible {
  outline: 3px solid #059669;
  outline-offset: 3px;
}

.retry-wa-btn {
  font-size: 0.95rem;
  padding: 10px 20px;
  min-height: 44px;
}

.wa-icon {
  margin-right: 2px;
}

/* Feedback States */
.feedback-box {
  text-align: center;
  padding: 24px 16px;
  border-radius: 14px;
}

.success-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}

.success-box h3 {
  font-family: 'Caveat', cursive;
  font-size: 2.2rem;
  color: #15803d;
  margin: 8px 0 6px;
}

.success-box p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #166534;
}

.feedback-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Site Footer */
.site-footer {
  width: 100%;
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .app-container {
    padding-top: 65px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .audio-control-wrapper {
    top: 12px;
    right: 12px;
  }
  .music-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 40px;
  }
  .card-inner {
    padding: 24px 16px;
  }
  .script-title {
    font-size: 2.6rem;
  }
  .question-title {
    font-size: 2.1rem;
  }
  .celebration-title {
    font-size: 2.2rem;
  }
  .letter-body {
    font-size: 0.98rem;
  }
  .highlight-question {
    font-size: 1.15rem;
    padding: 10px;
  }
  .envelope-wrapper {
    width: 200px;
    height: 140px;
    margin: 15px auto 25px;
  }
  .envelope {
    width: 200px;
    height: 135px;
  }
  .envelope-flap {
    border-left-width: 100px;
    border-right-width: 100px;
    border-top-width: 75px;
  }
  .envelope-pocket {
    border-left-width: 100px;
    border-right-width: 100px;
    border-bottom-width: 65px;
  }
  .envelope-letter-preview {
    height: 85px;
  }
  .envelope.open .envelope-letter-preview {
    transform: translateY(-50px);
  }
  .btn {
    touch-action: manipulation;
  }
  .date-options {
    grid-template-columns: 1fr;
  }
  .celebration-gif {
    width: 150px;
  }
  .couple-gif {
    width: 110px;
  }
}

@media (max-width: 360px) {
  .app-container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .card-inner {
    padding: 20px 12px;
  }
  .celebration-gif {
    width: 130px;
  }
  .couple-gif {
    width: 95px;
  }
  .btn {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
}

