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

:root {
  /* Paleta sofisticada e quente */
  --cream:      #fdf8f2;
  --ivory:      #f5ede0;
  --gold:       #c9a96e;
  --gold-dark:  #a07840;
  --blush:      #e8c9b0;
  --warm-brown: #3d2b1f;
  --mid-brown:  #6b4c3b;
  --text:       #2e1f14;
  --text-muted: #8a6e5c;
  --white:      #ffffff;
  --error:      #c0392b;
  --success:    #2d7d5a;
  --radius:     16px;
  --shadow:     0 8px 40px rgba(61, 43, 31, 0.12);
  --shadow-lg:  0 20px 60px rgba(61, 43, 31, 0.18);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ============================================================
   BACKGROUND PARTICLES
   ============================================================ */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-particles span {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  animation: float linear infinite;
  background: var(--gold);
}

.bg-particles span:nth-child(1)  { width: 180px; height: 180px; top: 5%;  left: -5%;  animation-duration: 22s; animation-delay: 0s; }
.bg-particles span:nth-child(2)  { width: 100px; height: 100px; top: 70%; left: 90%;  animation-duration: 18s; animation-delay: -4s; }
.bg-particles span:nth-child(3)  { width: 60px;  height: 60px;  top: 40%; left: 85%;  animation-duration: 14s; animation-delay: -8s; }
.bg-particles span:nth-child(4)  { width: 250px; height: 250px; top: 80%; left: -10%; animation-duration: 26s; animation-delay: -2s; }
.bg-particles span:nth-child(5)  { width: 80px;  height: 80px;  top: 20%; left: 75%;  animation-duration: 20s; animation-delay: -6s; }
.bg-particles span:nth-child(6)  { width: 40px;  height: 40px;  top: 55%; left: 10%;  animation-duration: 16s; animation-delay: -10s; }
.bg-particles span:nth-child(7)  { width: 120px; height: 120px; top: 10%; left: 50%;  animation-duration: 24s; animation-delay: -3s; }
.bg-particles span:nth-child(8)  { width: 90px;  height: 90px;  top: 90%; left: 60%;  animation-duration: 19s; animation-delay: -7s; }
.bg-particles span:nth-child(9)  { width: 50px;  height: 50px;  top: 35%; left: 25%;  animation-duration: 15s; animation-delay: -11s; }
.bg-particles span:nth-child(10) { width: 200px; height: 200px; top: 60%; left: 40%;  animation-duration: 28s; animation-delay: -1s; }

@keyframes float {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-40px) rotate(180deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.invite-wrapper {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.invite-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.invite-pre-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.invite-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--warm-brown);
  text-align: center;
}

.invite-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.ornament {
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  user-select: none;
}

.top-ornament { margin-bottom: 0.3rem; }

/* ============================================================
   INVITE CARD
   ============================================================ */
.invite-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  border: 1px solid var(--blush);
  position: relative;
  overflow: hidden;
}

.invite-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--blush), var(--gold));
}

.invite-emoji-accent {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.invite-event-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 400;
  text-align: center;
  color: var(--warm-brown);
  margin-bottom: 1rem;
}

.invite-event-title em {
  font-style: italic;
  color: var(--gold-dark);
}

.invite-message {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--mid-brown);
  text-align: center;
  font-weight: 300;
  margin-bottom: 2rem;
}

/* ============================================================
   EVENT DETAILS
   ============================================================ */
.event-details {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.event-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--cream);
  border-radius: 12px;
  border: 1px solid var(--ivory);
}

.event-detail-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.event-detail-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.event-detail-value {
  display: block;
  font-size: 0.95rem;
  color: var(--warm-brown);
  line-height: 1.5;
  font-weight: 400;
}

.event-detail-value strong {
  font-weight: 500;
}

/* ============================================================
   MAP LINK
   ============================================================ */
.map-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--gold-dark);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 0.5rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  margin-bottom: 1.5rem;
}

.map-link:hover, .map-link:focus {
  color: var(--warm-brown);
  background: var(--ivory);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blush), transparent);
  margin: 0.5rem 0 2rem;
}

/* ============================================================
   RSVP SECTION
   ============================================================ */
.rsvp-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.rsvp-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 400;
  color: var(--warm-brown);
}

.rsvp-desc {
  font-size: 0.9rem;
  color: var(--mid-brown);
  line-height: 1.7;
  font-weight: 300;
}

.rsvp-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 20px rgba(160, 120, 64, 0.35);
}

.rsvp-btn:hover, .rsvp-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(160, 120, 64, 0.45);
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

.rsvp-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.rsvp-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.65;
  font-style: italic;
  border-top: 1px solid var(--ivory);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.rsvp-notice em { color: var(--mid-brown); font-weight: 500; }

/* ============================================================
   FOOTER
   ============================================================ */
.invite-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 300;
}

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
  color: var(--gold-dark);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  align-self: flex-start;
}

.back-link:hover, .back-link:focus {
  color: var(--warm-brown);
  outline: none;
  text-decoration: underline;
}

/* ============================================================
   RSVP CARD (form page)
   ============================================================ */
.rsvp-card { padding: 2.5rem 2rem 2rem; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid-brown);
}

.required { color: var(--gold-dark); }

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--blush);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

.form-input.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.form-error {
  font-size: 0.78rem;
  color: var(--error);
  font-weight: 400;
  min-height: 1em;
}

/* ============================================================
   RADIO GROUP
   ============================================================ */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text);
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--blush);
  border-radius: 10px;
  background: var(--cream);
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.radio-label:hover {
  border-color: var(--gold);
  background: var(--ivory);
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-label input[type="radio"]:focus-visible + .radio-custom {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.radio-label input[type="radio"]:checked ~ * {
  /* visual handled below */
}

.radio-label:has(input:checked) {
  border-color: var(--gold);
  background: var(--ivory);
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--blush);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-label:has(input:checked) .radio-custom {
  border-color: var(--gold-dark);
  background: var(--gold-dark);
}

.radio-label:has(input:checked) .radio-custom::after {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.submit-btn {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 1rem;
  padding: 1rem 2rem;
}

/* ============================================================
   FEEDBACK STATES
   ============================================================ */
.loading-state,
.success-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem 1rem;
}

/* Spinner */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--blush);
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Success */
.success-emoji { font-size: 3.5rem; }

.success-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--warm-brown);
}

.success-message {
  font-size: 0.95rem;
  color: var(--mid-brown);
  line-height: 1.75;
}

/* Error */
.error-emoji { font-size: 3rem; }

.error-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--warm-brown);
}

.error-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .invite-wrapper { padding: 2rem 1rem 3rem; }
  .invite-card, .rsvp-card { padding: 2rem 1.2rem 1.5rem; }
  .event-detail-item { padding: 0.85rem 1rem; }
}
