:root {
  --color-bg: #FFF8ED;      /* Uniform cream background throughout the entire viewport */
  --color-text: #78716C;    /* Stone-500 text color */
  --color-border-input: #B5D38A;
  
  --font-body: 'Manrope', sans-serif;
}

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

html, body {
  font-family: var(--font-body);
  background-color: var(--color-bg); /* Completely uniform background */
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  overflow-x: hidden;
}

/* Page Wrapper - Locked to Mobile Aspect Ratio for exact Figma replication */
.page-wrapper {
  width: 100%;
  max-width: 390px; /* Lock width exactly to Figma mockup size */
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--color-bg); /* Match body background */
  position: relative;
  overflow-x: hidden;
  box-shadow: none !important;
  border: none !important;
}

/* Main invitation container */
.invitation-card {
  padding: 45px 22px;
  display: flex;
  flex-direction: column;
  gap: 55px;
}

/* Section Common Styling */
section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  width: 100%;
}

.title-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.title-wrap img {
  height: auto;
  display: block;
}

.z-index-content {
  position: relative;
  z-index: 2;
}

/* Title image scaling to fit the mobile width */
.title-names-img {
  width: 290px;
}

.title-wedding-img {
  width: 240px;
  margin: 10px 0;
}

.title-august-img {
  width: 160px;
}

.title-place-img {
  width: 130px;
}

.title-gathering-img {
  width: 220px;
}

.title-dresscode-img {
  width: 190px;
}

.title-rsvp-img {
  width: 230px;
}

.confirm-title-img {
  width: 280px;
  height: auto;
  display: block;
  margin-bottom: 25px;
}

.confirm-date-img {
  width: 250px;
  height: auto;
  display: block;
  margin-bottom: 30px;
}

/* Decorative Background Icon Layers */
.section-decor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.place-decor-left {
  position: absolute;
  left: 4px;
  top: -15px;
  width: 78px;
  height: auto;
  transform: rotate(-6.5deg);
}

.place-decor-right {
  position: absolute;
  right: 35px;
  top: -20px;
  width: 62px;
  height: auto;
  transform: rotate(-48deg);
}

.time-decor-left {
  position: absolute;
  left: -4px;
  top: 15px;
  width: 82px;
  height: auto;
  transform: rotate(10deg);
}

.time-decor-right {
  position: absolute;
  right: 75px;
  top: 25px;
  width: 68px;
  height: auto;
  transform: rotate(-12deg);
}

.textarea-decor-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3; /* Render on top of inputs/textareas for exact Figma mockup overlap */
}

/* Specific styling for Allergies field decorators */
.allergies-field .textarea-decor-left {
  position: absolute;
  left: -22px;
  bottom: 8px;
  width: 68px;
  height: auto;
  transform: rotate(11deg);
}

.allergies-field .textarea-decor-right {
  position: absolute;
  right: -22px;
  bottom: 8px;
  width: 68px;
  height: auto;
  transform: rotate(10deg);
}

/* Specific styling for Surprise field decorators */
.surprise-field .textarea-decor-left {
  position: absolute;
  left: -22px;
  bottom: 8px;
  width: 68px;
  height: auto;
  transform: rotate(-5deg);
}

.surprise-field .textarea-decor-right {
  position: absolute;
  right: -22px;
  bottom: 8px;
  width: 68px;
  height: auto;
  transform: rotate(8deg);
}

/* Hero Section */
.hero-section {
  gap: 12px;
}

.hero-names-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
  padding: 0 30px;
}

.hero-star {
  width: 22px;
  height: 22px;
  position: absolute;
  top: 0px;
}

.star-left {
  left: 6px;
  transform: rotate(12deg);
}

.star-right {
  right: 6px;
  transform: rotate(-19deg);
}

.couple-illustration-wrap {
  width: 100%;
  max-width: 320px;
  margin: 10px 0;
  display: flex;
  justify-content: center;
}

.couple-img {
  width: 100%;
  max-width: 310px;
  height: auto;
}

.hero-invite-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 300px;
}

.invite-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FF7986;
}

.invite-message {
  font-size: 0.95rem;
  font-weight: 500;
  color: #FF7986;
  line-height: 1.45;
}

/* Calendar Section */
.calendar-section {
  gap: 8px;
}

.decor-icon-top {
  width: 44px;
  height: auto;
  transform: rotate(-10deg);
}

.calendar-wrap {
  width: 100%;
  max-width: 282px;
  display: flex;
  justify-content: center;
}

.calendar-img {
  width: 100%;
  height: auto;
}

/* Place Section */
.place-section {
  gap: 12px;
}

.place-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #FF8D99;
  line-height: 1.4;
  margin-bottom: 5px;
}

.place-address {
  margin-top: 4px;
}

.place-name {
  font-weight: 700;
}

/* Map Wireframe Placeholder */
.map-placeholder {
  width: 100%;
  height: 200px;
  background-color: #F1EFEA;
  border: 3px solid #E4DFD5;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  margin: 5px 0 10px;
}

.cross-line {
  position: absolute;
  background-color: #E4DFD5;
  height: 1.5px;
  width: 150%;
  top: 50%;
  left: -25%;
}

.cross-diagonal-1 {
  transform: rotate(23deg);
}

.cross-diagonal-2 {
  transform: rotate(-23deg);
}

.route-button-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.route-link-btn {
  display: block;
  width: 224px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.route-link-btn img {
  width: 100%;
  height: auto;
}

.route-link-btn:hover {
  transform: scale(1.03);
}

.route-link-btn:active {
  transform: scale(0.97);
}

/* Time Section */
.time-section {
  gap: 8px;
}

.time-display {
  display: flex;
  justify-content: center;
  margin: 5px 0;
}

.time-15-30-img {
  width: 250px;
  height: auto;
}

.time-location-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FF8D99;
  max-width: 260px;
}

/* Dresscode Section */
.dresscode-section {
  gap: 15px;
}

.dresscode-desc {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FF8D99;
  max-width: 320px;
  line-height: 1.45;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
  width: 100%;
  max-width: 320px;
  justify-items: center;
}

.palette-item {
  width: 58px;
  height: 58px;
  display: block;
  transition: transform 0.2s ease;
}

.palette-item:hover {
  transform: scale(1.08);
}

.gentlemen-box-container {
  width: 100%;
  max-width: 340px;
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.gentlemen-box-img {
  width: 100%;
  height: auto;
  display: block;
}

/* RSVP Form Section */
.rsvp-section {
  gap: 20px;
}

.rsvp-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FF8D99;
  max-width: 320px;
  line-height: 1.45;
  margin-bottom: 5px;
}

.rsvp-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: center;
  position: relative;
}

.field-label-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.field-label-wrap img {
  height: auto;
  display: block;
}

.label-name-img {
  width: 250px;
}

.label-attendance-img {
  width: 180px;
}

.label-alcohol-img {
  width: 280px;
}

.label-allergies-img {
  width: 240px;
}

.label-surprise-img {
  width: 260px;
}

.label-partner-img {
  width: 280px;
}

.field-hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  margin-top: -6px;
  margin-bottom: 4px;
}

/* Premium Hand-Drawn Custom Inputs & Textareas */
.input-wrapper, .textarea-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-bg-svg, .textarea-bg-svg {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.input-wrapper input {
  position: absolute;
  left: 6%;
  top: 8%;
  width: 88%;
  height: 84%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  outline: none;
}

.textarea-wrapper textarea {
  position: absolute;
  left: 6%;
  top: 10%;
  width: 88%;
  height: 80%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  outline: none;
  resize: none; /* Lock resize to maintain exact Figma vector border boundaries */
}

/* Toggle Buttons (Attendance & Partner) */
.button-toggle-group {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  justify-content: center;
}

.rsvp-toggle-btn, .partner-toggle-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rsvp-toggle-btn img, .partner-toggle-btn img {
  width: 100%;
  height: auto;
  transition: all 0.25s ease;
}

.button-toggle-group.has-selection .rsvp-toggle-btn:not(.selected) img,
.button-toggle-group.has-selection .partner-toggle-btn:not(.selected) img {
  opacity: 0.45;
  filter: grayscale(15%);
  transform: scale(0.94);
}

.rsvp-toggle-btn.selected, .partner-toggle-btn.selected {
  transform: scale(1.04);
}

/* Alcohol Grid */
.alcohol-buttons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 360px;
}

.alcohol-select-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alcohol-select-btn img {
  width: 100%;
  height: auto;
  transition: all 0.25s ease;
}

.alcohol-buttons-grid.has-selection .alcohol-select-btn:not(.selected) img {
  opacity: 0.45;
  filter: grayscale(15%);
  transform: scale(0.94);
}

.alcohol-select-btn.selected {
  transform: scale(1.05);
}

/* Text Decor Field padding for absolute side icons */
.text-decor-field {
  padding: 0 35px;
}

/* Submit Button */
.form-submit-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.submit-btn {
  width: 100%;
  max-width: 340px;
  background-color: #FF7986;
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 16px 20px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 121, 134, 0.2);
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.submit-btn:hover {
  background-color: #FF5C6B;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 121, 134, 0.3);
}

.submit-btn:active {
  transform: translateY(0) scale(0.97);
}

.submit-btn:disabled {
  background-color: #C1BCB6;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Errors & Validations */
.field-error {
  font-size: 0.8rem;
  font-weight: 600;
  color: #FF7986;
  display: none;
  margin-top: -2px;
}

.form-field.has-error .field-error {
  display: block;
}

.form-field.has-error .input-wrapper,
.form-field.has-error .textarea-wrapper,
.form-field.has-error .button-toggle-group {
  filter: drop-shadow(0 0 5px rgba(255, 121, 134, 0.7));
  transition: filter 0.25s ease;
}

/* Success/Decline Messaging */
.form-success-message, .form-decline-message {
  border: 2px solid #FF8D99; /* Uniform pink border matching Figma */
  border-radius: 20px;
  padding: 30px 20px;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background-color: #FFFFFF;
  box-shadow: none; /* No shadow as requested */
  animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-heart-icon, .decline-heart-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.form-success-message h3, .form-decline-message h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FF7986; /* Uniform title color matching the image */
}

.form-success-message p, .form-decline-message p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #78716C;
  line-height: 1.5;
}


/* Confirmation Section */
.confirm-section {
  margin-bottom: 10px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candelabra-decor-wrap {
  width: 68px;
  display: flex;
  justify-content: center;
  margin-top: 25px;
}

.candelabra-img {
  width: 100%;
  height: auto;
}

/* Animations */
@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Remove desktop wrapper styling for seamless uniform background */
@media (min-width: 600px) {
  body {
    padding: 30px 10px;
  }
}

/* Map Footnote */
.map-footnote {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: #928B86;
  margin-top: -4px;
  margin-bottom: 12px;
  text-align: center;
  font-style: italic;
  display: block;
}

/* Blinking border/glowing drop shadow for inputs and textareas */
.input-wrapper input, .textarea-wrapper textarea {
  caret-color: #FF7986;
}

.input-wrapper:hover .input-bg-svg,
.textarea-wrapper:hover .textarea-bg-svg,
.input-wrapper input:focus ~ .input-bg-svg,
.textarea-wrapper textarea:focus ~ .textarea-bg-svg {
  filter: drop-shadow(0 0 4px rgba(255, 121, 134, 0.45));
  transition: filter 0.3s ease;
}

/* Animated Pulse for placeholders (invites writing) */
input::placeholder, textarea::placeholder {
  animation: placeholder-pulse 2s infinite ease-in-out;
}

@keyframes placeholder-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* Comic Jitter/Wiggle Animation (approved constant wiggle for unselected choice buttons) */
@keyframes wiggle {
  0%, 82%, 100% { transform: rotate(0deg) translate(0, 0); }
  85% { transform: rotate(-1.5deg) translate(-1px, 0.5px); }
  89% { transform: rotate(1.5deg) translate(1px, -0.5px); }
  93% { transform: rotate(-1deg) translate(-0.5px, -0.5px); }
  97% { transform: rotate(1deg) translate(0.5px, 0.5px); }
}

/* Wiggle applies continuously to toggle groups that don't have a selection, and submit buttons */
#attendance-group:not(.has-selection) .rsvp-toggle-btn,
.alcohol-buttons-grid:not(.has-selection) .alcohol-select-btn,
#partner-group:not(.has-selection) .partner-toggle-btn,
.submit-btn:not(:disabled) {
  animation: wiggle 3.5s ease-in-out infinite;
}

/* Apply staggered delay to buttons so they don't wiggle all at the exact same millisecond */
.rsvp-toggle-btn:nth-child(2),
.partner-toggle-btn:nth-child(2) {
  animation-delay: 0.25s !important;
}
.alcohol-buttons-grid .alcohol-select-btn:nth-child(2n) {
  animation-delay: 0.35s !important;
}
.alcohol-buttons-grid .alcohol-select-btn:nth-child(3n) {
  animation-delay: 0.6s !important;
}

/* Transition for partner's name field */
#partner-name-wrap {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

