:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --background: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* Added dark mode variables */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #94a3b8;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --border: #334155;
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Added theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Progress Steps */
.progress-container {
  margin-bottom: 32px;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-hover), #3b82f6);
  width: 50%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.step.active {
  color: var(--primary-color);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.step.active .step-number {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: scale(1.1);
}

.step.active .step-number::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover), var(--primary-color));
  border-radius: 50%;
  z-index: -1;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Registration Card */
.registration-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.registration-card:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  transform: translateY(-2px);
}

[data-theme="dark"] .registration-card:hover {
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 10px 10px -5px rgb(0 0 0 / 0.2);
}

.card-header {
  text-align: center;
  padding: 40px 32px 32px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-hover) 100%);
}

/* Enhanced logo container styling */
.logo-container {
  margin-bottom: 24px;
}

.logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--surface-hover);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.logo-wrapper:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.logo {
  height: 32px;
  width: auto;
  filter: brightness(1);
  transition: filter 0.3s ease;
}

[data-theme="dark"] .logo {
  filter: brightness(1.2) contrast(1.1);
}

.title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
}

/* Form */
.registration-form {
  padding: 0 32px 32px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-header {
  text-align: center;
  margin-bottom: 32px;
}

.step-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.form-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.form-focus .input-icon {
  color: var(--primary-color);
  transform: scale(1.1);
}

.form-group.form-success .form-input {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.05);
}

.form-group.form-success .input-icon {
  color: var(--success-color);
}

.form-group.form-error .form-input {
  border-color: var(--error-color);
  background: rgba(239, 68, 68, 0.05);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

.form-group.form-error .input-icon {
  color: var(--error-color);
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 16px;
  z-index: 2;
  transition: color 0.3s ease;
}

.form-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 400;
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.2);
}

.form-input:focus + .input-icon,
.form-input:not(:placeholder-shown) + .input-icon {
  color: var(--primary-color);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 48px;
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

.form-select option {
  color: var(--text-primary);
  background: var(--surface);
}

.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.password-strength.weak {
  background: var(--error-color);
  width: 33%;
}

.password-strength.medium {
  background: var(--warning-color);
  width: 66%;
}

.password-strength.strong {
  background: var(--success-color);
  width: 100%;
}

.form-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .btn-primary {
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-secondary);
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  color: transparent;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.form-actions .btn {
  flex: 1;
}

/* Form Footer */
.form-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.form-footer p {
  color: var(--text-secondary);
  font-size: 15px;
}

.login-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.login-link:hover {
  color: var(--primary-hover);
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.trust-item i {
  color: var(--success-color);
  font-size: 16px;
}

/* Enhanced loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.loading-content p {
  font-size: 16px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .container {
    max-width: 100%;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .card-header {
    padding: 32px 24px 24px;
  }

  .registration-form {
    padding: 0 24px 24px;
  }

  .title {
    font-size: 24px;
  }

  .step-header h2 {
    font-size: 20px;
  }

  .form-grid {
    gap: 20px;
  }

  .form-actions {
    flex-direction: column;
  }

  .trust-indicators {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .steps {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .form-input {
    padding: 14px 14px 14px 44px;
    font-size: 16px;
  }

  .input-icon {
    left: 14px;
    font-size: 14px;
  }

  .btn {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* Loading States */
.form-loading {
  pointer-events: none;
  opacity: 0.7;
}

.form-loading .form-input {
  background: var(--surface-hover);
}

/* Success States */
.form-success .form-input {
  border-color: var(--success-color);
}

.form-success .input-icon {
  color: var(--success-color);
}

/* Error States */
.form-error .form-input {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

[data-theme="dark"] .form-error .form-input {
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.2);
}

.form-error .input-icon {
  color: var(--error-color);
}

.error-message {
  color: var(--error-color);
  font-size: 13px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.error-message i {
  font-size: 12px;
}
