/* CSS Variables from theme */
:root {
  --primary: #b3261e;
  --secondary: #1f5c38;
  --background: #f6f0e4;
  --surface: #fffdf8;
  --text: #1f3b2c;
  --subtext: #6b7a6d;
  --font-body: 'Gowun Batang', serif;
  --font-display: 'Great Vibes', cursive;
  --max-width: 480px;
  --section-padding: 2rem 1.5rem;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--background);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Cover Section */
.section-cover {
  position: relative;
  width: 100%;
  background-color: var(--background);
}

.cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Section Base */
.section {
  padding: var(--section-padding);
  background-color: var(--surface);
  margin: 0;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--primary);
  margin: 0.75rem auto 0;
}

/* Greeting Section */
.greeting-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.greeting-body {
  text-align: center;
  white-space: pre-line;
  color: var(--text);
  font-size: 1rem;
  line-height: 2;
}

/* Schedule Section */
.schedule-date {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.schedule-time {
  font-size: 1.125rem;
  text-align: center;
  color: var(--subtext);
  margin-bottom: 1.5rem;
}

.schedule-time.tbd {
  font-style: italic;
}

.calendar-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 2px solid var(--text);
}

/* Venue Section */
.venue-name {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.venue-address {
  text-align: center;
  color: var(--subtext);
  margin-bottom: 1rem;
}

.venue-detail {
  text-align: center;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--background);
  border-radius: 8px;
}

.venue-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto;
}

/* RSVP Section */
.rsvp-description {
  text-align: center;
  color: var(--subtext);
  margin-bottom: 1.5rem;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-weight: 700;
  font-size: 0.9375rem;
}

.form-label .required {
  color: var(--primary);
  margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.875rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: white;
  transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Attendance radio buttons */
.attendance-options {
  display: flex;
  gap: 0.5rem;
}

.attendance-option {
  flex: 1;
}

.attendance-option input {
  display: none;
}

.attendance-option label {
  display: block;
  padding: 0.75rem;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}

.attendance-option input:checked + label {
  border-color: var(--primary);
  background-color: var(--primary);
  color: white;
}

.attendance-option input[value="no"]:checked + label {
  border-color: var(--subtext);
  background-color: var(--subtext);
}

.attendance-option input[value="maybe"]:checked + label {
  border-color: var(--secondary);
  background-color: var(--secondary);
}

/* Guest count stepper */
.guest-count-stepper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stepper-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stepper-btn:hover:not(:disabled) {
  background-color: var(--text);
  color: white;
}

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper-value {
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
}

/* Consent checkbox */
.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.consent-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 0.25rem;
  accent-color: var(--primary);
}

.consent-label {
  font-size: 0.875rem;
  color: var(--subtext);
  line-height: 1.5;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Success message */
.form-success {
  text-align: center;
  padding: 2rem;
  background-color: var(--background);
  border-radius: 8px;
}

.form-success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.form-success-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.form-success-message {
  color: var(--subtext);
}

/* Guestbook Section */
.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.guestbook-entries {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guestbook-entry {
  padding: 1rem;
  background-color: var(--background);
  border-radius: 8px;
}

.guestbook-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.guestbook-author {
  font-weight: 700;
}

.guestbook-date {
  font-size: 0.8125rem;
  color: var(--subtext);
}

.guestbook-message {
  line-height: 1.6;
}

.guestbook-empty {
  text-align: center;
  color: var(--subtext);
  padding: 2rem;
}

/* Footer */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--subtext);
  font-size: 0.8125rem;
}

/* Snowfall Effect */
#snowfall {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: white;
  font-size: 1rem;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
  opacity: 0.8;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }
}

@keyframes sway {
  0%, 100% {
    margin-left: 0;
  }
  50% {
    margin-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #snowfall {
    display: none;
  }
  
  .snowflake {
    animation: none;
  }
}

/* Error state */
.form-error {
  color: var(--primary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-input.error,
.form-textarea.error {
  border-color: var(--primary);
}

/* Loading button state */
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
}

/* Responsive adjustments */
@media (min-width: 480px) {
  :root {
    --section-padding: 3rem 2rem;
  }
  
  .greeting-title {
    font-size: 2.5rem;
  }
  
  .schedule-date {
    font-size: 1.75rem;
  }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: calc(100% - 2rem);
}

.toast.show {
  opacity: 1;
}

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