/* RSVP Form - Scoped styles to prevent WordPress conflicts */

/* Scope all styles to .rsvp-wrap container */
.rsvp-wrap {
  --text:#373c64;
  --bg:#fcf9eb;
  --border: rgba(55,60,100,.35);
  
  /* Reset within our scope */
  all: initial;
  display: block;
  
  /* Re-apply our styles */
  max-width: 900px;
  margin: 32px auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-family: system-ui,-apple-system,sans-serif;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.rsvp-wrap *,
.rsvp-wrap *::before,
.rsvp-wrap *::after { 
  box-sizing: border-box; 
}

.rsvp-wrap .rsvp-inner{
  padding: 28px 28px 32px;
  text-align:center;
}

.rsvp-wrap h2 {
  margin: 0 0 20px 0;
  padding: 0;
  font-size: 24px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

.rsvp-wrap .subtitle {
  font-size: 16px;
  margin: -10px 0 20px;
  padding: 0;
  opacity: 0.75;
  font-weight: 400;
}

.rsvp-wrap .guest-name {
  font-weight: 600;
  color: var(--text);
}

.rsvp-wrap h3 {
  margin: 16px 0 12px;
  padding: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.rsvp-wrap p {
  margin: 12px 0;
  padding: 0;
  opacity: 0.85;
  line-height: 1.6;
}

.rsvp-wrap .header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 18px;
  font-size: 14px;
  opacity:.85;
}

.rsvp-wrap .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Guest indicator */
.rsvp-wrap #guestProgress{
  display:flex;
  align-items:center;
  gap:10px;
}

.rsvp-wrap #guestIcons{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:30px;
  overflow:hidden;
  position:relative;
}

.rsvp-wrap #guestIcons span{
  font-size:28px;
  line-height:1;
  opacity:.35;
  display:inline-block;
  min-width:22px;
  text-align:center;
  transition: opacity 0.3s ease;
}

.rsvp-wrap #guestIcons span.done,
.rsvp-wrap #guestIcons span.no{
  opacity:1;
  font-weight:700;
}

.rsvp-wrap #guestIcons span.pop{
  animation:rsvp-pop .28s ease-out;
}

@keyframes rsvp-pop{
  0%{transform:scale(.5);opacity:0;}
  60%{transform:scale(1.35);opacity:1;}
  100%{transform:scale(1);opacity:1;}
}

/* Slide swap */
.rsvp-wrap #guestIcons.swap-next{ 
  animation: rsvp-slideNext .35s ease forwards; 
}

.rsvp-wrap #guestIcons.swap-prev{ 
  animation: rsvp-slidePrev .35s ease forwards; 
}

@keyframes rsvp-slideNext{
  0%{transform:translateX(24px);opacity:0;}
  100%{transform:translateX(0);opacity:1;}
}

@keyframes rsvp-slidePrev{
  0%{transform:translateX(-24px);opacity:0;}
  100%{transform:translateX(0);opacity:1;}
}

/* Steps */
.rsvp-wrap .step{ 
  display:none; 
  animation: rsvp-fadeIn 0.3s ease;
}

.rsvp-wrap .step.active{ 
  display:block !important; 
}

@keyframes rsvp-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rsvp-wrap .field{
  margin: 20px 0;
  padding: 0;
  text-align:left;
}

.rsvp-wrap .field label{
  display:block;
  margin: 0 0 8px 0;
  padding: 0;
  font-weight: 500;
  font-size: 15px;
}

.rsvp-wrap .section-title {
  margin: 24px 0 12px;
  padding: 0;
  font-weight: 600;
  font-size: 16px;
  text-align: left;
}

.rsvp-wrap input[type="text"], 
.rsvp-wrap input[type="email"], 
.rsvp-wrap textarea{
  width: 100%;
  padding: 14px 16px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: system-ui, -apple-system, sans-serif;
  transition: border-color 0.2s ease;
  line-height: 1.5;
  box-shadow: none;
}

.rsvp-wrap input[type="text"]:focus, 
.rsvp-wrap input[type="email"]:focus, 
.rsvp-wrap textarea:focus{
  outline: none;
  border-color: var(--text);
  box-shadow: none;
}

.rsvp-wrap textarea{ 
  resize:vertical;
  min-height: 80px;
}

.rsvp-wrap .radio-group{
  display:grid;
  gap: 12px;
  margin-top: 12px;
}

.rsvp-wrap .radio-card{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0;
  cursor: pointer;
  text-align:center;
  position: relative;
  transition: all 0.2s ease;
  background: transparent;
}

.rsvp-wrap .radio-card:hover {
  background: rgba(55,60,100,0.05);
}

.rsvp-wrap .radio-card input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.rsvp-wrap .radio-card span{ 
  display:block;
  transition: all 0.2s ease;
}

.rsvp-wrap .radio-card input:checked + span{
  background: var(--text);
  color:#fff;
  border-radius:9px;
  padding:14px 16px;
  margin:-14px -16px;
  font-weight: 500;
}

.rsvp-wrap .actions{
  margin-top: 28px;
  padding: 0;
  display:flex;
  gap: 12px;
  justify-content:center;
  flex-wrap: wrap;
}

.rsvp-wrap button{
  padding: 12px 28px;
  margin: 0;
  border-radius: 10px;
  border:none;
  background: var(--text);
  color:#fff;
  font-size:16px;
  font-weight: 500;
  cursor:pointer;
  transition: all 0.2s ease;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  text-decoration: none;
  box-shadow: none;
}

.rsvp-wrap button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.rsvp-wrap button.secondary{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.rsvp-wrap button.secondary:hover {
  background: rgba(55,60,100,0.05);
}

.rsvp-wrap button:disabled{
  opacity:.6;
  cursor:not-allowed;
  transform: none !important;
}

.rsvp-wrap .hr{
  height:1px;
  background:var(--border);
  margin:20px 0;
  border: none;
}

.rsvp-wrap .notice{
  border:1px solid rgba(180,60,60,.45);
  border-radius:12px;
  padding:16px 20px;
  margin: 12px 0 0 0;
  color: var(--text);
  text-align:center;
  background: rgba(255, 243, 205, 0.5);
  display: none;
}

.rsvp-wrap .notice p {
  margin: 8px 0;
  color: var(--text);
  opacity: 1;
}

.rsvp-wrap .notice.show {
  display: block;
}

.rsvp-wrap .notice input[type="text"] {
  text-align: center;
  font-weight: 600;
  letter-spacing: 1px;
}

.rsvp-wrap .notice button {
  white-space: nowrap;
}

/* Review section */
.rsvp-wrap #review, 
.rsvp-wrap #reviewFinal {
  text-align: left;
  margin: 20px 0;
  padding: 0;
}

.rsvp-wrap #review ul, 
.rsvp-wrap #reviewFinal ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rsvp-wrap #review li, 
.rsvp-wrap #reviewFinal li {
  background: rgba(55,60,100,0.05);
  padding: 16px;
  margin: 0 0 12px 0;
  border-radius: 10px;
  line-height: 1.8;
}

.rsvp-wrap #review strong, 
.rsvp-wrap #reviewFinal strong {
  font-size: 18px;
  display: block;
  margin: 0 0 8px 0;
  padding: 0;
  color: var(--text);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 640px) {
  .rsvp-wrap {
    margin: 16px;
    border-radius: 12px;
  }
  
  .rsvp-wrap .rsvp-inner {
    padding: 20px 16px 24px;
  }
  
  .rsvp-wrap h2 {
    font-size: 20px;
  }
  
  .rsvp-wrap .actions {
    flex-direction: column;
  }
  
  .rsvp-wrap button {
    width: 100%;
  }
  
  /* Mobile: Stack code entry vertically */
  .rsvp-wrap .notice > div {
    flex-direction: column !important;
  }
  
  .rsvp-wrap .notice input[type="text"] {
    width: 100% !important;
  }
  
  .rsvp-wrap .notice button {
    width: 100%;
  }
}

/* Special styling for guest steps */
.rsvp-wrap #stepGuestContact.active,
.rsvp-wrap #stepGuestAttendance.active,
.rsvp-wrap #stepGuestFood.active,
.rsvp-wrap #stepGuestSleep.active {
  display: block !important;
}

.rsvp-wrap #guestNumber, 
.rsvp-wrap #guestLoopMax,
.rsvp-wrap #guestNumberContact,
.rsvp-wrap #guestNumberAttendance, 
.rsvp-wrap #guestNumberFood, 
.rsvp-wrap #guestNumberSleep,
.rsvp-wrap #guestLoopMaxContact,
.rsvp-wrap #guestLoopMaxAttendance,
.rsvp-wrap #guestLoopMaxFood,
.rsvp-wrap #guestLoopMaxSleep {
  font-weight: 700;
  color: var(--text);
}

/* Form element overrides - extra specificity to prevent WordPress theme conflicts */
.rsvp-wrap form {
  margin: 0;
  padding: 0;
}

.rsvp-wrap a {
  text-decoration: none;
}

/* Prevent WordPress from affecting our elements */
.rsvp-wrap *:not(input):not(textarea):not(select) {
  border: 0;
  outline: 0;
}
