* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 0;
  overflow-x: hidden;
}

.container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
  position: relative;
}

h2 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

form {
  width: 100%;
}

label {
  display: block;
  margin-bottom: 20px;
  color: #555;
  font-weight: 600;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 15px;
  margin-top: 8px;
  border: 2px solid #e1e5e9;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background-color: white;
  transform: translateY(-2px);
}

input:hover {
  border-color: #667eea;
  background-color: white;
}

button {
  width: 100%;
  padding: 15px;
  margin-top: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button:active {
  transform: translateY(-1px);
}

.message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  min-height: 20px;
  transition: all 0.3s ease;
}

.message:not(:empty) {
  border: 2px solid;
  background-color: rgba(255, 255, 255, 0.9);
}

/* Form field groups */
.form-group {
  position: relative;
  margin-bottom: 20px;
}

/* Input icons/styling */
input[type="url"]::placeholder,
input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="datetime-local"]::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    margin: 5px;
    padding: 20px 15px;
    max-width: 100%;
    border-radius: 15px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  input,
  button {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  label {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .step-title {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .step-navigation {
    margin-top: 20px;
    gap: 10px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 15px;
    font-size: 12px;
  }

  .step-indicator {
    margin-bottom: 20px;
    gap: 8px;
  }

  .step-dot {
    width: 10px;
    height: 10px;
  }

  .step-dot::after {
    width: 20px;
    left: 12px;
  }

  .message {
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px 10px;
    margin: 0;
    border-radius: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .step-navigation {
    flex-direction: column;
    gap: 10px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  input {
    padding: 15px 12px;
  }

  .step-indicator {
    gap: 6px;
    margin-bottom: 15px;
  }

  .step-dot {
    width: 8px;
    height: 8px;
  }

  .step-dot::after {
    width: 15px;
    left: 10px;
    top: 3px;
  }

  .step-title {
    font-size: 15px;
    margin-bottom: 15px;
  }

  label {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .form-group {
    margin-bottom: 15px;
  }
}

@media (max-width: 320px) {
  .container {
    padding: 10px 8px;
  }

  h2 {
    font-size: 18px;
  }

  input {
    padding: 12px 10px;
    font-size: 15px;
  }

  .step-indicator {
    gap: 4px;
  }

  .step-dot {
    width: 6px;
    height: 6px;
  }

  .step-dot::after {
    width: 12px;
    left: 8px;
    top: 2px;
  }
}

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Multi-step form styles */
.step {
  display: none;
}

.step.active {
  display: block;
  animation: slideIn 0.4s ease-out;
}

.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 10px;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #e1e5e9;
  transition: all 0.3s ease;
  position: relative;
}

.step-dot.active {
  background-color: #667eea;
}

.step-dot.completed {
  background-color: #28a745;
}

.step-dot::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 2px;
  background-color: #e1e5e9;
  top: 5px;
  left: 15px;
  transition: all 0.3s ease;
}

.step-dot:last-child::after {
  display: none;
}

.step-dot.completed::after {
  background-color: #28a745;
}

.step-title {
  text-align: center;
  color: #667eea;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 25px;
}

.step-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  gap: 15px;
  width: 100%;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Hide the main submit button initially */
#submitBtn {
  display: none;
  width: 100%;
  margin-top: 20px;
}

/* Animation for form appearance */
.container {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
