/* =========================================
   CEREMONY RSVP - Main Styles
   Aesthetic: Elegant, refined gold & ivory
   ========================================= */

:root {
  --gold: #b08b5b;
  --gold-light: #d4aa70;
  --gold-dark: #7a5c2e;
  --ivory: #faf7f2;
  --cream: #f3ede3;
  --deep: #1a1209;
  --charcoal: #2c2416;
  --text: #3a2e1f;
  --text-muted: #8a7a65;
  --border: #ddd4c4;
  --white: #ffffff;
  --error: #c0392b;
  --error-bg: #fdf0ee;
  --success: #2e7d55;
  --radius: 2px;
  --shadow: 0 4px 30px rgba(26, 18, 9, 0.08);
  --shadow-lg: 0 20px 60px rgba(26, 18, 9, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  color: var(--text);
  background: var(--ivory);
  min-height: 100vh;
}

/* ---- Background ---- */
.rsvp-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.rsvp-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Background image layer */
.rsvp-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.6;
}

/* Light blue color overlay */
.rsvp-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #add8e6;
  opacity: 0.6;
}

.rsvp-bg__orb { display: none; }

/* ---- Container ---- */
.rsvp-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

/* ---- Header ---- */
.rsvp-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeUp 0.7s ease both;
}

.rsvp-header__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 4px;
  margin: 14px 0;
  font-weight: 600;
}

.rsvp-header__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#ceremony-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--charcoal);
}
.rsvp-header__title-top {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rsvp-header__title-main {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  color: var(--charcoal);
  letter-spacing: -1px;
}

.rsvp-header__subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.6;
  letter-spacing: 0.5px;
  max-width: 380px;
  margin: 0 auto;
}

/* ---- Alert ---- */
.alert {
  border-left: 3px solid;
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  animation: fadeUp 0.3s ease;
}

.alert--error {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error);
}

.alert ul { padding-left: 16px; }
.alert li { margin-bottom: 4px; font-size: 13px; }

/* ---- Form ---- */
.rsvp-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 40px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s ease 0.1s both;
}

.rsvp-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.rsvp-form__grid .form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-required {
  color: var(--gold);
  margin-left: 2px;
  font-size: 14px;
}

.form-optional {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: none;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--ivory);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: #bbb0a0; font-weight: 300; }

.form-input:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(176, 139, 91, 0.12);
}

/* ---- Submit Button ---- */
.rsvp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: var(--charcoal);
  color: var(--gold-light);
  border: none;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.rsvp-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 170, 112, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.rsvp-btn:hover::before { transform: translateX(100%); }

.rsvp-btn:hover {
  background: var(--deep);
  box-shadow: 0 8px 24px rgba(26, 18, 9, 0.25);
  transform: translateY(-1px);
}

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

.rsvp-btn__icon {
  font-size: 18px;
  transition: transform 0.2s;
}

.rsvp-btn:hover .rsvp-btn__icon { transform: translateX(4px); }

/* ---- Footer ---- */
.rsvp-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 1px;
  animation: fadeUp 0.8s ease 0.2s both;
}

/* =========================================
   SUCCESS MODAL
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 9, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: all;
  animation: modalBgIn 0.3s ease;
}

.modal {
  background: var(--white);
  border-radius: 6px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay[data-open="true"] .modal {
  transform: scale(1) translateY(0);
}

.modal__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  top: -20px;
  left: calc(var(--i) * 8.33%);
  opacity: 0;
  animation: confettiFall calc(1.5s + var(--i) * 0.1s) ease calc(var(--i) * 0.08s) forwards;
  border-radius: 50%;
}

.confetti-piece:nth-child(even) {
  background: var(--gold-light);
  width: 6px;
  height: 10px;
  border-radius: 0;
  transform: rotate(45deg);
}

.confetti-piece:nth-child(3n) {
  background: var(--charcoal);
  width: 5px;
  height: 5px;
}

@keyframes confettiFall {
  0% { top: -20px; opacity: 1; transform: rotate(0deg) translateX(0); }
  100% { top: 110%; opacity: 0; transform: rotate(720deg) translateX(calc(var(--i) * 5px - 30px)); }
}

.modal__icon {
  font-size: 32px;
  color: var(--gold);
  display: block;
  margin-bottom: 16px;
  animation: spinIn 0.5s ease 0.2s both;
}

.modal__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 14px;
}

.modal__message {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  font-weight: 300;
}

.modal__message strong {
  color: var(--charcoal);
  font-weight: 600;
}

.modal__btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--charcoal);
  color: var(--gold-light);
  border: none;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.15s;
}

.modal__btn:hover {
  background: var(--deep);
  transform: translateY(-1px);
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spinIn {
  from { opacity: 0; transform: rotate(-180deg) scale(0); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
  .rsvp-form { padding: 28px 22px; }
  .rsvp-form__grid { grid-template-columns: 1fr; }
  .rsvp-header__title-main { font-size: 48px; }
  .modal { padding: 36px 24px; }
}

p{
  font-weight: 600;
}