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

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

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  color: #3d3d3d;
  background-color: #faf9f7;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Sections ===== */
.section {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.section.active {
  display: flex;
}

.container {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* ===== Landing Page ===== */
#landing {
  background: linear-gradient(135deg, #faf9f7 0%, #f0ebe3 100%);
}

#landing .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 1px;
  color: #a38b6e;
  margin-bottom: 1.25rem;
}

#landing .couple-names {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 5.5rem);
  color: #2c2c2c;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

#landing .wedding-date {
  font-size: 1.1rem;
  font-weight: 400;
  color: #5a5a5a;
  margin-bottom: 0.5rem;
}

#landing .wedding-venue {
  font-size: 0.95rem;
  color: #8a8a8a;
  margin-bottom: 3rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.875rem 2.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #a38b6e;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #8b7359;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(163, 139, 110, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: #a38b6e;
  border: 1px solid #a38b6e;
}

.btn-secondary:hover {
  background-color: #a38b6e;
  color: #ffffff;
}

/* ===== Form Styling ===== */
.form-container {
  text-align: left;
  background: #ffffff;
  padding: 3rem 2.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.form-container h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: #2c2c2c;
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-subtitle {
  text-align: center;
  color: #8a8a8a;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5a5a5a;
  margin-bottom: 0.5rem;
}

.form-group .required {
  color: #c0392b;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 300;
  color: #3d3d3d;
  background: #faf9f7;
  border: 1px solid #e0dcd7;
  border-radius: 2px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #a38b6e;
  box-shadow: 0 0 0 3px rgba(163, 139, 110, 0.1);
}

.form-group input.invalid {
  border-color: #c0392b;
}

.error-msg {
  display: block;
  font-size: 0.78rem;
  color: #c0392b;
  margin-top: 0.35rem;
  min-height: 1rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

/* ===== Guest Name Fields ===== */
.guest-field {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f0ebe3;
}

.guest-field:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guest-field .guest-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #a38b6e;
  margin-bottom: 0.75rem;
}

.guest-field .name-row {
  display: flex;
  gap: 1rem;
}

.guest-field .name-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* ===== Confirmation ===== */
#confirmation {
  background: linear-gradient(135deg, #faf9f7 0%, #f0ebe3 100%);
}

.confirmation-content {
  padding: 3rem 2rem;
}

.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #a38b6e;
  color: #ffffff;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.confirmation-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #2c2c2c;
  margin-bottom: 1rem;
}

.confirmation-msg {
  font-size: 1rem;
  color: #5a5a5a;
  margin-bottom: 1.5rem;
}

.confirmation-details {
  font-size: 0.85rem;
  color: #8a8a8a;
  font-style: italic;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 249, 247, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0dcd7;
  border-top-color: #a38b6e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.loading-overlay p {
  font-size: 0.9rem;
  color: #5a5a5a;
}

/* ===== Guest Picker ===== */
.guest-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 0;
}

.picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #a38b6e;
  background: transparent;
  color: #a38b6e;
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.picker-btn:hover {
  background: #a38b6e;
  color: #ffffff;
}

.picker-btn:active {
  transform: scale(0.92);
}

.picker-btn:disabled {
  border-color: #ddd;
  color: #ddd;
  cursor: not-allowed;
  background: transparent;
}

.picker-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #2c2c2c;
  min-width: 3rem;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .section {
    padding: 1.5rem 1rem;
  }

  .form-container {
    padding: 2rem 1.25rem;
    box-shadow: none;
    border: 1px solid #eae6e0;
  }

  .form-container h2 {
    font-size: 1.75rem;
  }

  .form-group input {
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }

  .btn {
    padding: 1rem 2rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
  }

  #rsvp-btn {
    width: auto;
  }

  .guest-field .name-row {
    flex-direction: column;
    gap: 0;
  }

  .guest-field .name-row .form-group {
    margin-bottom: 1rem;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  #landing .couple-names {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  #landing .subtitle {
    font-size: 0.9rem;
    padding: 0 1rem;
  }

  .wedding-date,
  .wedding-venue {
    font-size: 0.9rem;
  }
}
