/* ============================================================
   Waaraaboo V2 — Register Tunnel CSS
   Styles partagés entre les 4 écrans du tunnel d'inscription
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800;900&display=swap');

/* ---- Variables ---- */
:root {
  --brand-purple: #7C3AED;
  --brand-purple-dark: #5B21B6;
  --brand-purple-light: #EDE9FE;
  --brand-orange: #F97316;
  --brand-orange-dark: #EA580C;
  --brand-orange-light: #FFF7ED;

  --text-900: #0F172A;
  --text-700: #334155;
  --text-500: #64748B;
  --text-300: #94A3B8;

  --white: #FFFFFF;
  --bg-page: #F1F5F9;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-focus: #7C3AED;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12);
  --shadow-brand: 0 8px 24px rgba(124,58,237,.25);

  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  color: var(--text-900);
  line-height: 1.6;
}

/* ============================================================
   LAYOUT GLOBAL
   ============================================================ */

.reg-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header tunnel */
.reg-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.reg-header .logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--brand-purple);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.reg-header .login-hint {
  font-size: .875rem;
  color: var(--text-500);
}

.reg-header .login-hint a {
  color: var(--brand-purple);
  font-weight: 600;
  text-decoration: none;
}

/* Corps central */
.reg-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
}

/* ============================================================
   BARRE DE PROGRESSION
   ============================================================ */

.progress-bar {
  width: 100%;
  max-width: 560px;
  margin-bottom: 36px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-fill {
  position: absolute;
  top: 20px;
  left: 20px;
  height: 2px;
  background: var(--brand-purple);
  z-index: 1;
  transition: width .5s ease;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.step-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  color: var(--text-300);
  transition: var(--transition);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.step-bubble.active {
  border-color: var(--brand-purple);
  background: var(--brand-purple);
  color: var(--white);
  box-shadow: var(--shadow-brand);
}

.step-bubble.done {
  border-color: var(--brand-purple);
  background: var(--brand-purple);
  color: var(--white);
}

.step-bubble.done::before {
  content: '✓';
  font-size: 1rem;
}

.step-label {
  font-size: .75rem;
  color: var(--text-300);
  font-weight: 500;
  white-space: nowrap;
}

.step-label.active { color: var(--brand-purple); font-weight: 700; }
.step-label.done   { color: var(--brand-purple); }

/* ============================================================
   CARD PRINCIPALE
   ============================================================ */

.reg-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  padding: 48px 44px;
  border: 1px solid var(--border);
}

.reg-card .card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-900);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.reg-card .card-subtitle {
  color: var(--text-500);
  font-size: .95rem;
  margin-bottom: 32px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

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

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

label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text-700);
  margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

label .req { color: var(--brand-orange); }

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: .975rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-900);
  background: #FAFBFC;
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(124,58,237,.1);
}

.form-control::placeholder { color: var(--text-300); }

.form-control.is-invalid {
  border-color: #EF4444;
  background: #FFF5F5;
}

.form-control.is-valid {
  border-color: #10B981;
}

/* Phone avec préfixe */
.phone-group {
  display: flex;
  gap: 8px;
}

.phone-prefix {
  padding: 12px 14px;
  background: var(--bg-page);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-700);
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.phone-group .form-control { flex: 1; }

/* Password avec toggle */
.password-wrap {
  position: relative;
}

.password-wrap .form-control {
  padding-right: 48px;
}

.pwd-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-300);
  font-size: 1.1rem;
  padding: 4px;
}

/* Indicateur de force mot de passe */
.pwd-strength {
  margin-top: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.pwd-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.pwd-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: var(--transition);
}

.pwd-bar.weak   { background: #EF4444; }
.pwd-bar.medium { background: #F97316; }
.pwd-bar.strong { background: #10B981; }

.pwd-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-300);
  min-width: 48px;
}

.pwd-label.weak   { color: #EF4444; }
.pwd-label.medium { color: #F97316; }
.pwd-label.strong { color: #10B981; }

/* Messages d'erreur inline */
.field-error {
  margin-top: 6px;
  font-size: .825rem;
  color: #DC2626;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.4;
}

.field-error a { color: #DC2626; font-weight: 700; }

/* CGU Checkbox */
.cgu-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--brand-purple-light);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.cgu-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--brand-purple);
  accent-color: var(--brand-purple);
  flex-shrink: 0;
  margin-top: 1px;
}

.cgu-text {
  font-size: .875rem;
  color: var(--text-700);
  line-height: 1.5;
}

.cgu-text a {
  color: var(--brand-purple);
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================================
   BOUTONS
   ============================================================ */

.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--brand-orange), #FF6B35);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .3px;
  box-shadow: 0 4px 16px rgba(249,115,22,.3);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249,115,22,.35);
}

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

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-300);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  color: var(--brand-purple);
  border: 2px solid var(--brand-purple);
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--brand-purple-light);
}

/* Badges de confiance */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-300);
  font-weight: 500;
}

/* Alert flash */
.reg-alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.reg-alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.reg-alert-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

/* ============================================================
   ÉCRAN 2 — TUILES SECTEUR
   ============================================================ */

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.sector-tile {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  user-select: none;
}

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

.sector-tile:hover {
  border-color: var(--brand-purple);
  background: var(--brand-purple-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.sector-tile.selected {
  border-color: var(--brand-purple);
  background: var(--brand-purple-light);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

.sector-tile.selected::after {
  content: '✓';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: var(--brand-purple);
  color: var(--white);
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.sector-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.sector-name {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-900);
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: block;
  line-height: 1.3;
}

/* ============================================================
   ÉCRAN 3 — SPLIT LAYOUT PERSONNALISATION
   ============================================================ */

.reg-card.split {
  max-width: 1100px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.split-form {
  padding: 44px 40px;
  overflow-y: auto;
  max-height: 85vh;
  border-right: 1px solid var(--border);
}

.split-preview {
  padding: 24px;
  background: #F8FAFC;
  position: sticky;
  top: 0;
  overflow-y: auto;
  max-height: 85vh;
}

.split-preview h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: .875rem;
  color: var(--text-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Aperçu live */
.live-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--white);
  border: 1px solid var(--border);
  min-height: 400px;
  transition: var(--transition);
}

/* Slug preview pill */
.slug-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-purple-light);
  color: var(--brand-purple);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  margin-top: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Upload zones */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.upload-zone {
  position: relative;
  aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  background: #FAFBFC;
}

.upload-zone:hover {
  border-color: var(--brand-purple);
  background: var(--brand-purple-light);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-zone .upload-label {
  font-size: .7rem;
  color: var(--text-300);
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

.upload-zone .upload-icon {
  font-size: 1.4rem;
  pointer-events: none;
}

.upload-zone.has-image .upload-icon,
.upload-zone.has-image .upload-label {
  display: none;
}

.upload-zone img.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,.5);
  color: white;
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Palettes */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.palette-option {
  position: relative;
  cursor: pointer;
}

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

.palette-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.palette-card:hover {
  border-color: var(--brand-purple);
  transform: scale(1.04);
}

.palette-option input:checked + .palette-card {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

.palette-swatch {
  height: 36px;
  display: flex;
}

.palette-swatch span {
  flex: 1;
  display: block;
}

.palette-name {
  padding: 4px 6px;
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-700);
  background: var(--white);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ============================================================
   ÉCRAN 4 — ACTIVATION
   ============================================================ */

.activation-recap {
  background: var(--brand-purple-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.recap-thumb {
  width: 80px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  flex-shrink: 0;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.recap-info h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-purple-dark);
  margin-bottom: 2px;
}

.recap-info p, .recap-info a {
  font-size: .8rem;
  color: var(--text-500);
}

.recap-info a {
  color: var(--brand-purple);
  font-weight: 600;
  text-decoration: none;
}

.recap-url {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .8rem;
  color: var(--brand-purple);
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

/* Options d'activation */
.activation-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.activation-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  background: var(--white);
}

.activation-card:hover {
  border-color: var(--brand-purple);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.activation-card.selected {
  border-color: var(--brand-purple);
  background: var(--brand-purple-light);
}

.activation-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.act-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  margin-bottom: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.act-badge.free  { background: #D1FAE5; color: #065F46; }
.act-badge.paid  { background: #FEF3C7; color: #92400E; }

.act-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.act-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-900);
  margin-bottom: 6px;
}

.act-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brand-purple-dark);
}

.act-price span {
  font-size: .8rem;
  color: var(--text-300);
  font-weight: 400;
}

.act-items {
  list-style: none;
  margin-top: 10px;
  text-align: left;
  font-size: .8rem;
  color: var(--text-500);
}

.act-items li {
  padding: 3px 0;
  display: flex;
  gap: 6px;
}

.act-items li::before {
  content: '✓';
  color: #10B981;
  font-weight: 700;
}

/* ============================================================
   TEMPLATES APERÇU LIVE — styles communs
   ============================================================ */

.preview-shell {
  background: var(--preview-bg, #fff);
  min-height: 400px;
  font-family: 'Inter', sans-serif;
  transition: background .3s ease;
}

.preview-navbar {
  background: var(--preview-primary, #7C3AED);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-logo {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: color .2s;
}

.preview-nav-cta {
  background: var(--preview-secondary, #FFD700);
  color: var(--preview-primary, #1a1a2e);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}

.preview-hero {
  background: linear-gradient(135deg, var(--preview-primary), var(--preview-primary-fade, rgba(124,58,237,.7)));
  padding: 40px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}

.preview-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .4;
}

.preview-hero-text {
  position: relative;
  z-index: 1;
}

.preview-h1 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.3;
}

.preview-slogan {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
}

.preview-desc-block {
  padding: 16px 20px;
  background: var(--preview-bg, #fff);
}

.preview-desc-block p {
  font-size: .82rem;
  color: #64748B;
  line-height: 1.5;
}

.preview-products {
  padding: 16px 20px;
  background: var(--preview-bg, #fff);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-product-card {
  background: var(--preview-card-bg, #F8FAFC);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
}

.preview-product-img {
  height: 64px;
  background: var(--preview-primary);
  opacity: .15;
}

.preview-product-info {
  padding: 8px 10px;
  font-size: .75rem;
  color: var(--text-700);
  font-weight: 600;
}

.preview-product-price {
  font-weight: 800;
  font-size: .8rem;
  color: var(--preview-primary, #7C3AED);
}

/* Footer preview */
.preview-footer {
  background: var(--preview-primary);
  padding: 12px 20px;
  text-align: center;
  color: rgba(255,255,255,.7);
  font-size: .7rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .reg-card.split {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
  .split-form {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .split-preview {
    position: static;
    max-height: none;
  }
}

@media (max-width: 600px) {
  .reg-card {
    padding: 32px 22px;
    border-radius: var(--radius-lg);
  }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .sectors-grid { grid-template-columns: repeat(2, 1fr); }
  .activation-options { grid-template-columns: 1fr; }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-grid { grid-template-columns: 1fr 1fr; }
  .reg-card .card-title { font-size: 1.4rem; }
  .trust-row { gap: 12px; }
}

@media (max-width: 400px) {
  .sectors-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reg-body { padding: 24px 14px 40px; }
}
