* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  /* Prevent zoom on input focus in mobile Safari */
  -webkit-text-size-adjust: 100%;
  /* Smooth scrolling */
  -webkit-overflow-scrolling: touch;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  background: white;
  min-height: 100vh;
  /* Better mobile rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

.screen {
  animation: fadeIn 0.3s ease-in;
}

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

/* Loader */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007AFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loader p {
  margin-top: 16px;
  color: #666;
}

/* Success & Error Screens */
.success-icon, .error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 40px auto 20px;
}

.success-icon {
  background: #34C759;
  color: white;
}

.error-icon {
  background: #FF3B30;
  color: white;
}

#success-screen, #error-screen {
  text-align: center;
  padding: 40px 20px;
}

#success-screen h1 {
  color: #34C759;
  margin-bottom: 12px;
}

#error-screen h1 {
  color: #FF3B30;
  margin-bottom: 12px;
}

#success-screen p, #error-screen p {
  color: #666;
  margin-bottom: 20px;
}

/* Form */
h1 {
  font-size: 28px;
  margin-bottom: 24px;
  font-weight: 600;
}

/* Hotel Image */
.hotel-image-container {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background: #f0f0f0;
  animation: fadeIn 0.3s ease-in-out;
}

.hotel-image {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease-in-out;
}

.hotel-image:not([src]), .hotel-image[src=""] {
  opacity: 0;
}

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

/* Hotel Info */
.hotel-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.hotel-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.hotel-details {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
}

.hotel-details .separator {
  margin: 0 8px;
}

.hotel-price {
  font-size: 24px;
  font-weight: 700;
  margin-top: 8px;
}

.section {
  margin-bottom: 32px;
}

.section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  font-weight: 600;
  color: #000;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px; /* Minimum 16px to prevent zoom on iOS */
  background: #fafafa;
  transition: all 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007AFF;
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

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

/* Guest Item */
.guest-item {
  background: #f8f8f8;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
}

.guest-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.guest-item-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.remove-guest {
  background: #FF3B30;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.guest-item .form-row {
  grid-template-columns: 2fr 1fr;
}

/* Buttons */
.btn-primary, .btn-secondary {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.btn-primary {
  background: #007AFF;
  color: white;
}

.btn-primary:active {
  background: #0051D5;
  transform: scale(0.97);
}

.btn-secondary {
  background: white;
  color: #007AFF;
  border: 2px solid #007AFF;
  margin-bottom: 16px;
}

.btn-secondary:active {
  background: #f0f8ff;
  transform: scale(0.97);
}

#error-screen button {
  width: auto;
  padding: 12px 32px;
}

/* 3DS Container */
#threeds-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 1000;
}

#threeds-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 16px;
  }
  
  .hotel-image {
    max-height: 200px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .guest-item .form-row {
    grid-template-columns: 1fr;
  }
}

