:root {
  --proposal-warm: #f5b56a;
  --proposal-warm-deep: #da7a28;
  --proposal-text: #fff8ea;
  --proposal-muted: #f5d9ba;
  --proposal-border: rgba(255, 208, 155, 0.35);
  --proposal-success: #7fe1a2;
}

.proposal-body {
  color: var(--proposal-text);
}

.flow-guard-hint {
  margin: 0.8rem auto 0;
  width: fit-content;
  max-width: 40rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 130, 0.45);
  background: rgba(255, 220, 166, 0.12);
  color: #ffe7c6;
  font-weight: 600;
}

.proposal-page-shell {
  position: relative;
  display: grid;
  gap: 1.2rem;
}

.hero-aura {
  position: absolute;
  inset: -1rem 8% auto;
  height: 240px;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 178, 82, 0.33), transparent 55%),
    radial-gradient(circle at 80% 25%, rgba(255, 126, 139, 0.3), transparent 58%);
  filter: blur(10px);
}

.proposal-hero-card,
.memory-section,
.puzzle-section,
.proposal-reveal {
  border: 1px solid var(--proposal-border);
  border-radius: 20px;
  padding: 1.2rem;
}

.proposal-step-header,
.proposal-hero-card {
  text-align: center;
}

.proposal-kicker {
  margin-bottom: 0.35rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--proposal-warm);
  font-weight: 700;
}

.proposal-title {
  margin-bottom: 0.45rem;
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.6rem);
  font-weight: 800;
}

.proposal-subtitle {
  max-width: 52rem;
  margin: 0 auto;
  color: var(--proposal-muted);
}

.step-progress {
  margin-top: 0.9rem;
  color: #ffd18d;
  font-weight: 700;
}

.dob-gate-form {
  max-width: 26rem;
  margin: 1rem auto 0;
  text-align: left;
}

.dob-gate-form .form-label {
  margin-bottom: 0.3rem;
}

.dob-input.form-control {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--proposal-border);
  color: #fff;
}

.dob-input.form-control:focus {
  border-color: rgba(255, 176, 77, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(255, 176, 77, 0.2);
}

.dob-hint {
  display: block;
  margin-top: 0.3rem;
  color: #d5b78e;
}

.dob-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dob-feedback {
  margin-top: 0.55rem;
  min-height: 1.2rem;
  font-weight: 600;
}

.dob-feedback.is-error {
  color: #ff9191;
}

.dob-feedback.is-success {
  color: var(--proposal-success);
}

.dob-gate-form.is-error {
  animation: errorShake 0.42s ease;
}

.dob-gate-form.is-success {
  animation: successPulse 0.5s ease;
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  50% {
    transform: translateX(6px);
  }
  75% {
    transform: translateX(-4px);
  }
}

@keyframes successPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: scale(1);
  }
}

.top-garland {
  width: min(52rem, 100%);
  margin: 1rem auto 0;
  transform-origin: top center;
}

.top-garland-grand {
  filter: drop-shadow(0 10px 20px rgba(255, 170, 79, 0.25));
}

.garland-rope {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f4931 0%, #8f623e 50%, #6f4931 100%);
}

.thoranam-leaves,
.garland-flowers {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.garland-flowers {
  display: none;
}

.leaf {
  width: 18px;
  height: 28px;
  border-radius: 2px 14px 14px 14px;
  transform: rotate(24deg);
  background: linear-gradient(180deg, #4dc46b 0%, #257c42 100%);
}

.leaf:nth-child(even) {
  transform: rotate(-24deg);
}

.flower {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff9d2, #ffbf6f 62%, #ff7f4e 100%);
}

.kalasam-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.8rem;
}

.kalasam-card {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  min-height: 5.8rem;
  border: 1px solid var(--proposal-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 175, 94, 0.16));
  color: #fff4df;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kalasam-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.25);
}

.kalasam-card.is-opened {
  border-color: rgba(127, 225, 162, 0.8);
  background: linear-gradient(180deg, rgba(127, 225, 162, 0.25), rgba(255, 175, 94, 0.2));
}

.kalasam-card:focus-visible,
.puzzle-input:focus-visible {
  outline: 3px solid rgba(255, 177, 92, 0.28);
  outline-offset: 2px;
}

.kalasam-illustration {
  width: 34px;
  height: 26px;
  background: linear-gradient(180deg, #f9ce87 0%, #c0782d 100%);
  border-radius: 50% 50% 46% 46%;
  position: relative;
}

.kalasam-illustration::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -8px;
  width: 18px;
  height: 8px;
  border-radius: 6px;
  background: #a96521;
}

.kalasam-label {
  font-weight: 700;
}

.memory-panel {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px dashed rgba(255, 204, 139, 0.6);
  background: rgba(255, 247, 233, 0.09);
}

.memory-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.memory-title {
  margin: 0;
  font-size: 1.1rem;
}

.memory-close-btn {
  border: 1px solid rgba(255, 209, 151, 0.6);
  border-radius: 10px;
  color: #ffe6c2;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.65rem;
}

.memory-description {
  margin-top: 0.55rem;
  margin-bottom: 0;
  color: #f7e4cc;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.8rem;
}

.puzzle-card {
  border: 1px solid var(--proposal-border);
  border-radius: 14px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease;
}

.puzzle-card:hover {
  transform: translateY(-2px);
}

.puzzle-title {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.puzzle-question {
  margin-bottom: 0.5rem;
  color: #f4dcc1;
}

.puzzle-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.puzzle-input {
  flex: 1;
  min-width: 170px;
  border: 1px solid rgba(255, 206, 143, 0.6);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.puzzle-feedback {
  min-height: 1.2rem;
  margin: 0.45rem 0 0;
  font-weight: 600;
}

.puzzle-card.is-solved {
  border-color: rgba(127, 225, 162, 0.7);
  background: rgba(127, 225, 162, 0.12);
}

.puzzle-card.is-solved-pop {
  animation: solvedPop 0.32s ease;
}

.puzzle-card.is-solved .puzzle-feedback {
  color: var(--proposal-success);
}

.puzzle-feedback.is-error {
  color: #ff9797;
}

.step-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.riddle-progress-track {
  width: min(32rem, 100%);
  margin: 0.25rem auto 0;
  height: 0.52rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.riddle-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd58b 0%, #f9b857 40%, #ff7f8f 100%);
  transition: width 0.3s ease;
}

.step-progress.is-error-pulse {
  animation: errorPulse 0.28s ease;
}

.proposal-reveal {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
  text-align: center;
}

.proposal-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.proposal-reveal-kicker {
  margin: 0;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--proposal-warm);
  font-size: 0.8rem;
  font-weight: 700;
}

.proposal-reveal-title {
  margin: 0.4rem 0 1rem;
  font-size: clamp(1.35rem, 1rem + 1.5vw, 2rem);
  font-weight: 800;
  color: #fff3dc;
}

.proposal-text {
  margin: 0 auto;
  max-width: 36rem;
  display: grid;
  gap: 0.45rem;
  color: #ffe6bf;
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.35rem);
  font-weight: 600;
  line-height: 1.5;
}

.proposal-text p {
  margin: 0;
}

.proposal-question {
  margin-top: 0.25rem;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-weight: 800;
  color: #ffd792;
}

.proposal-signoff {
  margin: 1rem 0 0;
  color: #fff2d6;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.proposal-reveal-actions {
  justify-content: center;
}

.final-page.state-garland .thoranam-leaves {
  display: none;
}

.final-page.state-garland .garland-flowers {
  display: flex;
}

.final-page.state-garland .top-garland {
  animation: garlandSwing 3.2s ease-in-out infinite;
}

.top-garland.is-jaimala-tease .leaf {
  filter: saturate(1.2) brightness(1.05);
}

.final-light-particles {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.final-light-particles .particle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 245, 210, 0.95), rgba(255, 166, 82, 0.1));
}

.final-light-particles .particle:nth-child(1) { top: 14%; left: 12%; }
.final-light-particles .particle:nth-child(2) { top: 20%; left: 84%; }
.final-light-particles .particle:nth-child(3) { top: 36%; left: 24%; }
.final-light-particles .particle:nth-child(4) { top: 48%; left: 74%; }
.final-light-particles .particle:nth-child(5) { top: 68%; left: 28%; }
.final-light-particles .particle:nth-child(6) { top: 76%; left: 84%; }

.final-page.state-transition .particle,
.final-page.state-garland .particle {
  animation: particlePulse 1.8s ease-in-out infinite;
}

.final-page.state-garland .particle:nth-child(2),
.final-page.state-garland .particle:nth-child(5) {
  animation-delay: 0.4s;
}

.final-page.state-garland .particle:nth-child(3),
.final-page.state-garland .particle:nth-child(6) {
  animation-delay: 0.8s;
}

@keyframes garlandSwing {
  0% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
  100% {
    transform: rotate(-2deg);
  }
}

@keyframes solvedPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

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

@keyframes particlePulse {
  0%,
  100% {
    transform: translateY(0) scale(0.8);
    opacity: 0.25;
  }
  50% {
    transform: translateY(-6px) scale(1);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .kalasam-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .puzzle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .puzzle-card:last-child {
    grid-column: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .proposal-reveal,
  .kalasam-card,
  .puzzle-card,
  .dob-gate-form {
    transition: none;
    animation: none;
  }

  .final-page.state-garland .top-garland {
    animation: none;
  }

  .riddle-progress-fill,
  .puzzle-card.is-solved-pop,
  .step-progress.is-error-pulse,
  .dob-gate-form.is-success,
  .final-page.state-garland .particle,
  .final-page.state-transition .particle {
    transition: none;
    animation: none;
  }
}
