/* 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);
}

/* 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;
  }
}