:root {
  --primary: #a581b9;
  --primary-dark: #825f96;
  --primary-light: #f5f0f8;
  --primary-glow: rgba(165, 129, 185, 0.3);
  --accent-gold: #f59e0b;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --bg-body: #fbf9fc;
  --bg-card: #ffffff;
  --border: #e9e2ee;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px -5px rgba(130, 95, 150, 0.12), 0 0 1px 1px rgba(165, 129, 185, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  line-height: 1.5;
  background-image: radial-gradient(circle at 10% 20%, rgba(165, 129, 185, 0.06) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(130, 95, 150, 0.08) 0%, transparent 45%);
}

.app-wrapper {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Header & Logo */
.header-section {
  text-align: center;
  margin-bottom: 24px;
}

.logo-container {
  display: inline-block;
  background: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px rgba(165, 129, 185, 0.12);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.brand-logo {
  max-height: 70px;
  width: auto;
  display: block;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.header-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(165, 129, 185, 0.2);
}

/* Wizard Card */
.wizard-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 22px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 24px;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.step-label.active {
  color: var(--primary-dark);
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #f1ecf5;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 33.33%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Steps Animation */
.step-content {
  display: none;
  animation: fadeInSlide 0.35s ease forwards;
}

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

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

.step-header {
  margin-bottom: 18px;
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .required {
  color: #dc2626;
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.2s ease;
  outline: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
  color: #9ca3af;
}

/* Role Pills / Quick Selectors */
.pill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pill-option {
  position: relative;
}

.pill-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: #fdfbfe;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 52px;
}

.pill-option input[type="radio"]:checked + .pill-label {
  background: var(--primary-light);
  border-color: var(--primary-dark);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Interest Chips (Multiselect) */
.chips-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip-option input[type="checkbox"],
.chip-option input[type="radio"] {
  display: none;
}

.chip-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #fdfbfe;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
}

.chip-content {
  display: flex;
  align-items: center;
}

.chip-icon {
  margin-right: 10px;
  font-size: 16px;
}

.chip-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chip-option input[type="checkbox"]:checked + .chip-label,
.chip-option input[type="radio"]:checked + .chip-label {
  border-color: var(--primary-dark);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.chip-option input[type="checkbox"]:checked + .chip-label .chip-check {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

/* Checkbox RGPD */
.rgpd-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 10px;
  background: #fdfbfe;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.rgpd-checkbox {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.rgpd-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Action Buttons */
.button-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #f3ecf7;
  color: var(--primary-dark);
}

.btn-secondary:hover {
  background: #ebe0f1;
}

.btn-lg {
  padding: 15px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 30px;
}

/* Error message box */
.error-banner {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Success & PIN Screen */
.success-screen {
  text-align: center;
  padding: 10px 0;
}

.success-badge-icon {
  width: 64px;
  height: 64px;
  background: #ecfdf5;
  color: #059669;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 0 0 8px #f0fdf4;
}

.success-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.success-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* The Grand PIN Card */
.pin-display-box {
  background: linear-gradient(135deg, #faf7fc 0%, #f3ebf8 100%);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  margin: 16px 0 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(165, 129, 185, 0.15);
}

.pin-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.pin-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--primary-dark);
  text-shadow: 0 2px 8px rgba(130, 95, 150, 0.2);
  margin-left: 10px;
}

.pin-instruction {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: inline-block;
}

.pin-instruction span {
  color: var(--primary-dark);
  font-weight: 700;
}

.email-sent-notice {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 24px;
}

.app-footer a {
  color: var(--primary-dark);
  text-decoration: none;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .app-wrapper {
    padding: 12px 10px 30px;
  }
  .wizard-card {
    padding: 20px 16px;
  }
  .pin-digits {
    font-size: 44px;
    letter-spacing: 6px;
  }
}
