/* Modern Apple-inspired design system */
:root {
  --primary-color: #007aff;
  --primary-hover: #0056cc;
  --secondary-color: #5856d6;
  --success-color: #34c759;
  --warning-color: #ff9500;
  --error-color: #ff3b30;
  --text-primary: #000000;
  --text-secondary: #8e8e93;
  --text-tertiary: #c7c7cc;
  --background-primary: #ffffff;
  --background-secondary: #f2f2f7;
  --background-tertiary: #ffffff;
  --border-color: #c6c6c8;
  --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.15);
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #00ff88 0%, #0066ff 100%); /*135deg, #00ff88, #0066ff*/
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
}

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

.form-container {
  background: var(--background-primary);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-heavy);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

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

/* Header */
.header {
  text-align: center;
  padding: 40px 40px 30px;
  background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 100%);
}

.logo {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-light);
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Progress */
.progress-container {
  padding: 30px 40px 20px;
  background: var(--background-primary);
}

.progress-bar {
  height: 6px;
  background: var(--background-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 25%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

#progress-percentage {
  color: var(--primary-color);
  font-weight: 600;
}

/* Form Steps */
.form-step {
  display: none;
  padding: 20px 40px 40px;
  animation: fadeIn 0.4s ease-out;
}

.form-step.active {
  display: block;
}

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

.step-header {
  text-align: center;
  margin-bottom: 30px;
}

.step-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.step-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.step-header p {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-medium);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--background-primary);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

.error-message {
  display: block;
  color: var(--error-color);
  font-size: 14px;
  font-weight: 500;
  margin-top: 6px;
  min-height: 20px;
}

.form-group input.error,
.form-group select.error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.1);
}

/* Password Strength */
.password-strength {
  margin-top: 12px;
}

.strength-meter {
  height: 4px;
  background: var(--background-secondary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.strength-bar {
  height: 100%;
  width: 0;
  transition: var(--transition);
  border-radius: 2px;
}

#strength-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.password-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.requirement {
  padding: 4px 8px;
  background: var(--background-secondary);
  border-radius: var(--radius-small);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.requirement.valid {
  background: var(--success-color);
  color: white;
}

/* Configuration Cards */
.config-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 30px;
}

.config-card {
  background: var(--background-secondary);
  border-radius: var(--radius-medium);
  padding: 24px;
  transition: var(--transition);
}

.config-card.full-width {
  grid-column: 1 / -1;
}

.config-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group.horizontal {
  flex-direction: row;
  gap: 16px;
}

.radio-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--background-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-medium);
  cursor: pointer;
  transition: var(--transition);
}

.radio-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.radio-card input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

.radio-card input[type="radio"]:checked + .radio-content {
  color: var(--primary-color);
}

.radio-content strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.radio-content span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Terms */
.terms-container {
  margin-bottom: 30px;
}

.checkbox-card {
  background: var(--background-secondary);
  border-radius: var(--radius-medium);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.checkbox-card.optional {
  opacity: 0.8;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 16px;
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}

.checkbox-content strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.checkbox-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.terms-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Buttons */
.button-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  gap: 16px;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
}

.next-btn,
.submit-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: var(--shadow-medium);
}

.next-btn:hover,
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

.prev-btn {
  background: var(--background-secondary);
  color: var(--text-primary);
}

.prev-btn:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 18px;
  transition: var(--transition);
}

.next-btn:hover .btn-icon,
.submit-btn:hover .btn-icon {
  transform: translateX(2px);
}

.prev-btn:hover .btn-icon {
  transform: translateX(-2px);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

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

/* Button click animation */
button.clicked {
  transform: scale(0.98);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--background-primary);
  border-radius: var(--radius-large);
  padding: 40px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: var(--shadow-heavy);
  animation: modalSlideUp 0.4s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.success-animation {
  margin-bottom: 24px;
}

.success-icon {
  display: inline-block;
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.success-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--success-color), #30d158);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: var(--shadow-medium);
}

.success-check {
  font-size: 40px;
  color: white;
  font-weight: bold;
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.modal-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.success-details {
  background: var(--background-secondary);
  border-radius: var(--radius-medium);
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}

.success-details h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.success-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 12px 24px;
  border-radius: var(--radius-medium);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.modal-btn.primary {
  background: var(--primary-color);
  color: white;
}

.modal-btn.secondary {
  background: var(--background-secondary);
  color: var(--text-primary);
}

.modal-btn:hover {
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .form-container {
    margin: 10px;
  }

  .header,
  .progress-container,
  .form-step {
    padding-left: 20px;
    padding-right: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .config-grid {
    gap: 16px;
  }

  .radio-group.horizontal {
    flex-direction: column;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

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

  .step-header h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 100px;
  }

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

  .subtitle {
    font-size: 16px;
  }

  .step-header h2 {
    font-size: 22px;
  }

  .step-icon {
    font-size: 40px;
  }
}
