/* Form and Popup Styles */

/* Contact Form Styles */
.contact-heading {
  font-family: 'Canela Deck Trial', serif;
  font-size: 1.75rem;
  text-align: left;
  color: var(--primary-blue);
  margin-bottom: 1rem;
  white-space: nowrap;
}

/* Form input */
.form-input {
  width: 100%;
  padding: 0.75rem 0;
  border: 0;
  border-bottom: 2px solid #d1d5db;
  background: transparent;
  color: #374151;
  transition: border-color 0.3s ease;
  font-size: 16px;
  min-height: 44px;
}

/* Smaller inputs for name and phone fields - WAITLIST ONLY - DESKTOP */
@media (min-width: 769px) {
  .waitlist-page input[name="firstName"],
  .waitlist-page input[name="phone"] {
    padding: 0.5rem 0;
    min-height: 36px;
    width: 70%;
    border-bottom-width: 2px;
  }
}

/* Form label */
.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--primary-blue);
}


/* Form grid */
.form-grid {
  display: grid;
  gap: 1.5rem;
}

/* Email field - match contact form width - WAITLIST ONLY - DESKTOP */
@media (min-width: 769px) {
  .waitlist-page input[name="email"] {
    width: calc(100% + 4rem);
  }
}

/* Mobile: Full width inputs for waitlist form to prevent clipping */
@media (max-width: 768px) {
  .waitlist-page input[name="firstName"],
  .waitlist-page input[name="phone"],
  .waitlist-page input[name="email"] {
    width: 100%;
  }
}

/* Message field - match width of two-column grid on desktop only */
textarea[name="message"] {
  width: 100%;
}

@media (min-width: 768px) {
  textarea[name="message"] {
    width: calc(100% + 4rem);
  }
}

/* Two column */
.form-grid.two-column {
  grid-template-columns: 1fr;
  align-items: start;
}

/* Outline button */
.btn-outline-blue {
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  background: transparent;
  padding: 0.75rem 3rem;
  font-family: 'Avillia', serif;
  letter-spacing: 0.05em;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 48px;
  display: inline-block;
  text-decoration: none;
  border-radius: 9999px;
  position: relative;
  z-index: 15;
}

/* Button hover */
.btn-outline-blue:hover {
  background-color: var(--primary-blue);
  color: white;
  transform: translateY(-1px);
}

.btn-outline-blue:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  border-color: #9ca3af;
  color: #9ca3af;
}

/* Message container */
.message-container {
  text-align: center;
  margin-top: 1rem;
}

/* Success message */
.success-message {
  color: #059669;
  font-weight: 500;
}

/* Error message */
.error-message {
  color: #dc2626;
  font-weight: 500;
}

/* Popup overlay */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

/* Popup container */
.popup-container {
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: scale(1);
  transition: transform 0.3s ease;
  position: relative;
}

/* Popup content */
.popup-content {
  text-align: center;
}

/* Popup icon */
.popup-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

/* Popup title */
.popup-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1f2937;
  line-height: 1.3;
}

/* Popup message */
.popup-message {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* Popup button */
.popup-button {
  background-color: var(--primary-blue);
  color: white;
  padding: 12px 48px;
  border: none;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  min-height: 44px;
}

.popup-button:hover {
  background-color: #065a8b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 75, 163, 0.3);
}

/* Popup spinner */
.popup-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #f8fafc;
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Contact grid */
.contact-grid {
  display: flex;
  flex-direction: column;
}

/* Input effects */
.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

/* Textarea */
textarea.form-input {
  min-height: 40px;
  resize: none;
  padding-top: 0.75rem;
}

/* Hidden states */
.popup-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.popup-content.hidden {
  display: none;
}

.popup-overlay.hidden .popup-container {
  transform: scale(0.95);
}

/* Popup variants */
.success-popup .popup-icon {
  color: #10b981;
}

.success-popup .popup-title {
  color: #10b981;
}

.error-popup .popup-icon {
  color: #ef4444;
}

.error-popup .popup-title {
  color: #ef4444;
}

.loading-popup .popup-title {
  color: var(--primary-blue);
}

/* Popup redirect */
.popup-redirect {
  font-size: 0.875rem;
  color: var(--primary-blue);
  font-weight: 500;
  margin-top: 1rem;
}

/* Contact form container positioning */
.contact-form-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100dvh; /* Modern browsers with dynamic viewport units */
  min-height: calc(var(--vh, 1vh) * 100); /* Fallback for older browsers */
  padding-bottom: env(safe-area-inset-bottom); /* iOS safe area support */
}

/* Validation styles */
.validation-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.validation-error.show {
  display: block;
}

.form-input.valid {
  border-color: #10b981;
}

.form-input.invalid {
  border-color: #ef4444;
}

/* Responsive */
@media (min-width: 640px) {
  .contact-heading {
    font-size: 2rem;
  }
}

@media (min-width: 768px) {
  .form-grid.two-column {
    grid-template-columns: 4fr 2fr;
    gap: 0;
    align-items: end;
  }
  
  .form-grid.two-column > div {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .form-grid.two-column .form-label {
    margin-bottom: 0.75rem;
    min-height: 1.5rem;
    white-space: nowrap;
  }
  
  .form-grid.two-column .form-input {
    margin-top: auto;
  }
  
  .form-grid.two-column > div:nth-child(2) {
    transform: translateX(4rem);
  }
}

@media (min-width: 1024px) {
  .contact-form-container {
    padding-left: 4rem;
    padding-bottom: 4rem;
    justify-content: flex-start;
  }
  
  .contact-grid {
    display: grid;
    grid-template-columns: 35% 60%;
    gap: 0;
    min-height: 100%;
  }
}

@media (max-width: 640px) {
  .popup-container {
    padding: 2rem 1.5rem;
    max-width: 340px;
    border-radius: 1rem;
  }
  
  .popup-title {
    font-size: 1.25rem;
  }
  
  .popup-message {
    font-size: 0.875rem;
  }
  
  .popup-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }

  .popup-button {
    padding: 10px 32px;
    font-size: 0.875rem;
  }
}

/* Pilot Page Specific Styles */
.pilot-page .pilot-overlay-content {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
  justify-content: center;
  padding-left: 3rem;
  padding-right: 3rem;
}

@media (min-width: 1024px) {
  .pilot-page .pilot-overlay-content {
    padding-left: 4rem;
    padding-right: 2rem;
  }

  /* Prevent navigation bar from overlapping first form field */
  .pilot-page .contact-form-container {
    padding-top: 140px;
  }
}

.pilot-hero-title {
  font-family: 'Canela Deck Trial', serif;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: white;
}

.pilot-event-details {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  color: white;
  opacity: 0.95;
}

.pilot-event-location {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  color: white;
  opacity: 0.95;
}

.pilot-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  color: white;
}

.pilot-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pilot-bullet-list li {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;
  color: white;
  opacity: 0.9;
  padding-left: 1.5rem;
  position: relative;
}

.pilot-bullet-list li::before {
  content: '•';
  position: absolute;
  left: 0.5rem;
  color: white;
  font-weight: bold;
}

.pilot-footer-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  color: white;
  opacity: 0.85;
}

.pilot-link {
  color: white;
  text-decoration: underline;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.pilot-link:hover {
  opacity: 0.8;
}

/* Responsive adjustments for pilot page */
@media (max-width: 1023px) {
  .pilot-overlay-content {
    justify-content: flex-start;
    padding-top: 12rem;
    padding-bottom: 2rem;
  }

  .pilot-hero-title {
    font-size: 2rem;
  }

  .pilot-event-details,
  .pilot-event-location {
    font-size: 1rem;
  }

  .pilot-section-title {
    font-size: 1.125rem;
  }

  .pilot-bullet-list li {
    font-size: 0.95rem;
  }

  .pilot-footer-text {
    font-size: 0.875rem;
  }
}

/* Extra spacing for mobile screens */
@media (max-width: 640px) {
  .pilot-overlay-content {
    justify-content: flex-start;
    padding-top: 11rem;
    padding-bottom: 2rem;
  }
}

/* Gender and Age Combined Row */
.gender-age-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.gender-field {
  flex: 1 1 60%;
  min-width: 0;
}

.age-field {
  flex: 1 1 40%;
  min-width: 0;
}

/* Form select styling (for age dropdown) */
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 0;
  border-bottom: 2px solid #d1d5db;
  background: transparent;
  color: #374151;
  transition: border-color 0.3s ease;
  font-size: 16px;
  min-height: 44px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
  padding-right: 2rem;
}

/* Custom Age Dropdown Styling */
.age-field {
  position: relative;
}

/* Hide native select when custom selector is active */
select.age-selector-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* Custom display button (shows selected value when closed) */
.custom-age-display {
  width: 100%;
  padding: 0.75rem;
  padding-right: 2rem;
  border: 0;
  border-bottom: 2px solid #d1d5db;
  background: white;
  color: #374151;
  transition: border-color 0.3s ease;
  font-size: 16px;
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.custom-age-display:hover {
  border-color: var(--primary-blue);
}

.custom-age-display:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.custom-age-value {
  flex: 1;
}

.custom-age-arrow {
  position: absolute;
  right: 0.5rem;
  color: #374151;
  transition: transform 0.2s ease;
}

.custom-age-display[aria-expanded="true"] .custom-age-arrow {
  transform: rotate(180deg);
}

/* Dropdown panel (shows 5 ages when open) */
.custom-age-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: white;
  border: 2px solid var(--primary-blue);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.custom-age-dropdown-panel.hidden {
  display: none;
  pointer-events: none;
}

/* Individual age options */
.custom-age-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 16px;
  color: #374151;
}

.custom-age-option:hover {
  background-color: #f3f4f6;
}

.custom-age-option.selected {
  background-color: var(--primary-blue);
  color: white;
  font-weight: 500;
}

.custom-age-option.selected:hover {
  background-color: #065a8b;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.form-select.invalid {
  border-color: #ef4444;
}

/* Mobile: Stack gender and age vertically */
@media (max-width: 768px) {
  .gender-age-row {
    flex-direction: column;
    gap: 1rem;
  }

  .gender-field,
  .age-field {
    flex: 1 1 100%;
  }
}