/* ==========================================================================
   RESET & FOUNDATION
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #ffffff;
  --color-accent: #0082FA; /* BMW light blue */
  --color-accent-hover: #006bd6;
  --color-bg: #050505;
  --color-surface: rgba(15, 17, 21, 0.75);
  --color-text: #e2e8f0;
  --color-text-light: #94a3b8;
  --color-border: rgba(255, 255, 255, 0.12);
  --color-error: #ef4444;
  --color-success: #10b981;
  
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  background-color: var(--color-bg);
  background-image: url('https://offertabs.s3.amazonaws.com/offer/j9hjsh/site/media/6aaae44e337918.41373566.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utility classes */
.hidden { display: none !important; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.page-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 60px 20px;
}

.rsvp-container {
  width: 100%;
  max-width: 680px;
  background: var(--color-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 56px 48px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* M-Color Stripe */
.rsvp-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to right, 
    #0082FA 0%, #0082FA 33.3%, 
    #00215F 33.3%, #00215F 66.6%, 
    #F62B28 66.6%, #F62B28 100%);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  opacity: 0.95;
}

/* ==========================================================================
   TYPOGRAPHY & HEADER
   ========================================================================== */
.rsvp-header {
  text-align: center;
  margin-bottom: 40px;
}

.brand-subtitle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
}

.separator {
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  margin: 24px auto;
}

.brand-description {
  font-size: 1.1rem;
  color: #cbd5e1;
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 2px;
  cursor: pointer;
}

/* Enhanced Tap Targets */
input, select, textarea {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 16px; /* explicit 16px prevents iOS auto-zoom on focus */
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  min-height: 56px;
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(0, 130, 250, 0.15);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Custom Select Styling */
.select-wrapper {
  position: relative;
}
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
}
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
option {
  color: #000;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Button */
.btn-primary {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 12px;
  padding: 20px 24px;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 60px;
}

.btn-primary:hover {
  background: #e2e8f0;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   ALERTS & FEEDBACK
   ========================================================================== */
.alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-info {
  background-color: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-message h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: #ffffff;
  margin-bottom: 16px;
}

.success-message p {
  color: #cbd5e1;
  font-size: 1.15rem;
  max-width: 450px;
  margin: 0 auto;
}

/* ==========================================================================
   WOOBOX SDK FOOTER
   ========================================================================== */
#wbx-powered-by-slot {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 640px) {
  .page-wrapper {
    padding: 12px 10px;
  }
  
  .rsvp-container {
    padding: 32px 16px;
    border-radius: 20px;
  }
  
  .rsvp-container::before {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .rsvp-form {
    gap: 20px;
  }
  
  .brand-title {
    font-size: 2rem;
  }
  
  .brand-description {
    font-size: 1rem;
  }
}
