* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 16px;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.container {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.header {
  text-align: center;
  padding: 24px 0;
  color: white;
}

.logo {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  margin: 0 auto 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 15px;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.card h2 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  text-align: center;
}

.card .description {
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-group .required {
  color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  transition: all 0.2s ease;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* Custom select arrow */
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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-position: right 12px center;
  background-size: 20px;
  padding-right: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-group .hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
  line-height: 1.4;
}

.btn-primary {
  width: 100%;
  padding: 18px;
  font-size: 17px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  color: #667eea;
  background: transparent;
  border: 2px solid #667eea;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.btn-secondary:hover,
.btn-secondary:active {
  background: rgba(102, 126, 234, 0.1);
}

.error-msg {
  background: #fef2f2;
  color: #dc2626;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
  line-height: 1.4;
}

.success-card {
  text-align: center;
  padding: 32px 24px;
}

.success-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  margin: 0 auto 24px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.success-card h2 {
  color: #059669;
  font-size: 24px;
  margin-bottom: 12px;
}

.success-msg {
  color: #6b7280;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.5;
}

.position-info {
  font-size: 16px;
  color: #374151;
  margin-bottom: 8px;
}

.position-num {
  font-size: 48px;
  font-weight: 700;
  color: #667eea;
  display: block;
  margin-top: 8px;
}

.wait-note {
  color: #9ca3af;
  font-size: 14px;
  margin-top: 20px;
  line-height: 1.5;
}

.footer {
  text-align: center;
  padding: 28px 0 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.footer p {
  margin-bottom: 3px;
}

/* Loading state */
.btn-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  top: 50%;
  left: 50%;
  margin-left: -12px;
  margin-top: -12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile-first responsive adjustments */
@media (min-width: 480px) {
  body {
    padding: 24px;
  }

  .header {
    padding: 32px 0;
  }

  .logo {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  .header h1 {
    font-size: 28px;
  }

  .card {
    padding: 32px 28px;
    border-radius: 24px;
  }

  .card h2 {
    font-size: 24px;
  }
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  input[type="text"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    background: #f3f4f6;
  }
}
