:root {
  --g-pink: #e92663;
  --g-pink-dark: #c81e54;
  --g-pink-light: #ff6b95;
  --g-navy: #192b4d;
  --g-navy-dark: #0f1b33;
  --g-navy-light: #2a406e;
  --g-bg: #f6f7fb;
  --g-white: #ffffff;
  --g-gray-50: #f8f9fc;
  --g-gray-100: #eef1f7;
  --g-gray-200: #dde2ec;
  --g-gray-300: #c6cddc;
  --g-gray-500: #6b7690;
  --g-gray-700: #3a4868;
  --g-error: #e3342f;
  --g-success: #16a34a;
  --g-warning: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(25, 43, 77, 0.06);
  --shadow-md: 0 8px 24px rgba(25, 43, 77, 0.08);
  --shadow-lg: 0 20px 60px rgba(25, 43, 77, 0.15);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--g-navy);
  background: var(--g-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--g-pink); text-decoration: none; }
a:hover { color: var(--g-pink-dark); }

/* ---------- Layout ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 30%) 1fr;
}

.illustration-pane {
  position: relative;
  background: linear-gradient(155deg, var(--g-navy) 0%, var(--g-navy-dark) 60%, #050a17 100%);
  color: var(--g-white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  min-height: 100vh;
}

.illustration-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, rgba(255,255,255,0.75) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 80% 12%, rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 72%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(2px 2px at 65% 88%, rgba(255,255,255,0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 55%, rgba(255,255,255,0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 45% 35%, rgba(255,255,255,0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 58%, rgba(255,255,255,0.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 42%, rgba(255,255,255,0.55) 50%, transparent 51%);
  opacity: 0.8;
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

.illustration-pane__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.illustration-pane__logo {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.illustration-pane__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.illustration-pane__viz {
  width: 80%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  position: relative;
}

.illustration-pane__viz svg {
  width: 100%;
  height: 100%;
  display: block;
}

.illustration-pane__eyebrow {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-pink-light);
  font-weight: 600;
}

.illustration-pane__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 440px;
}

.illustration-pane__subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 420px;
  line-height: 1.6;
}

.illustration-pane__footer {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.illustration-pane--centered .illustration-pane__header {
  justify-content: center;
}
.illustration-pane--centered .illustration-pane__footer {
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

/* Aside avec photo en background-cover */
.illustration-pane--photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.illustration-pane--photo::before {
  /* Masque l'animation des étoiles quand une photo est utilisée */
  display: none;
}
.illustration-pane--photo::after {
  /* Overlay subtil pour garantir la lisibilité du header/footer */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,27,51,0.55) 0%, rgba(15,27,51,0.25) 30%, rgba(15,27,51,0.25) 70%, rgba(15,27,51,0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Carré noir translucide avec texte à l'intérieur */
.illustration-pane__viz--dark {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 28px;
  text-align: center;
  gap: 14px;
}
.illustration-pane__viz--dark .illustration-pane__eyebrow {
  color: var(--g-pink-light);
  margin: 0;
}
.illustration-pane__viz--dark .illustration-pane__title {
  color: var(--g-white);
  font-size: 24px;
  line-height: 1.25;
  margin: 0;
}

.form-pane {
  background: var(--g-bg);
  padding: 48px 64px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

.form-pane__inner {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}

.form-pane__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  row-gap: 16px;
}

.form-pane__header hr {
  flex-basis: 100%;
  width: 100%;
  border: none;
  border-top: 1px solid var(--g-gray-200);
  margin: 0;
}

.form-pane__company {
  font-size: 13px;
  color: var(--g-gray-500);
}

.form-pane__company strong {
  color: var(--g-navy);
  font-weight: 600;
}

.form-pane__progress {
  font-size: 13px;
  color: var(--g-gray-500);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 4px;
  background: var(--g-gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--g-pink) 0%, var(--g-pink-light) 100%);
  border-radius: 4px;
  transition: width 0.5s var(--ease);
  width: 0%;
}

/* ---------- Typo ---------- */
h1.form-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--g-navy);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 16px;
  color: var(--g-gray-500);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ---------- Form fields ---------- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

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

.field-row--thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--g-navy);
  display: flex;
  align-items: center;
  gap: 4px;
}

.field__required {
  color: var(--g-pink);
}

.field__hint {
  font-size: 12px;
  color: var(--g-gray-500);
  margin-top: 2px;
}

.field__error {
  font-size: 12px;
  color: var(--g-pink);
  margin-top: 4px;
  display: none;
  animation: shake 0.35s ease;
}

.field.has-error .field__error { display: block; }
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--g-pink);
  background: #fff5f8;
}
.field.has-error .input:focus,
.field.has-error .select:focus,
.field.has-error .textarea:focus {
  border-color: var(--g-pink);
  box-shadow: 0 0 0 4px rgba(233, 38, 99, 0.15);
}

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

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--g-gray-200);
  border-radius: var(--radius-sm);
  background: var(--g-white);
  font-family: inherit;
  font-size: 15px;
  color: var(--g-navy);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}

.input:hover, .select:hover, .textarea:hover {
  border-color: var(--g-gray-300);
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--g-navy);
  box-shadow: 0 0 0 4px rgba(25, 43, 77, 0.15);
}

.input::placeholder, .textarea::placeholder {
  color: var(--g-gray-300);
}

.textarea {
  resize: vertical;
  min-height: 96px;
  font-family: inherit;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23192b4d' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ---------- Input with suffix (calc display) ---------- */
.input-calc {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-calc .input { flex: 1; }

.input-calc__result {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(233, 38, 99, 0.08), rgba(233, 38, 99, 0.02));
  border: 1.5px dashed rgba(233, 38, 99, 0.35);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--g-pink);
  font-weight: 600;
  white-space: nowrap;
  min-width: 180px;
  text-align: center;
}

.total-card {
  background: linear-gradient(135deg, var(--g-navy) 0%, var(--g-navy-light) 100%);
  color: var(--g-white);
  padding: 18px 22px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.total-card__label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.total-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--g-pink-light);
  font-variant-numeric: tabular-nums;
}

/* ---------- URL input + copy ---------- */
.url-block {
  background: var(--g-white);
  border: 1.5px solid var(--g-gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.2s ease;
}

.url-block:focus-within {
  border-color: var(--g-navy);
}

.url-block__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--g-gray-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.url-block__row {
  display: flex;
  gap: 8px;
}

.url-block__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--g-navy);
  padding: 10px 12px;
  background: var(--g-gray-50);
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--g-pink);
  color: var(--g-white);
  box-shadow: 0 4px 14px rgba(233, 38, 99, 0.35);
}
.btn--primary:hover:not(:disabled) {
  background: var(--g-pink-dark);
  box-shadow: 0 6px 20px rgba(233, 38, 99, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--g-navy);
  border: 1.5px solid var(--g-gray-200);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--g-white);
  border-color: var(--g-gray-300);
}

.btn--blue {
  background: var(--g-navy);
  color: var(--g-white);
  box-shadow: 0 4px 14px rgba(25, 43, 77, 0.25);
}
.btn--blue:hover:not(:disabled) {
  background: var(--g-navy-light);
  box-shadow: 0 6px 20px rgba(25, 43, 77, 0.35);
}

.btn--icon {
  padding: 10px 14px;
  font-size: 14px;
}

.btn__icon {
  width: 16px;
  height: 16px;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--g-gray-200);
}

.actions--end {
  justify-content: flex-end;
}

/* ---------- Steps ---------- */
.step {
  display: none;
  animation: fadeSlide 0.5s var(--ease);
}
.step.is-active { display: block; }

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

/* ---------- File upload ---------- */
.file-drop {
  border: 2px dashed var(--g-gray-300);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--g-white);
}

.file-drop:hover, .file-drop.is-drag {
  border-color: var(--g-pink);
  background: rgba(233, 38, 99, 0.03);
}

.file-drop__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--g-pink);
}

.file-drop__text {
  font-size: 14px;
  color: var(--g-gray-500);
}

.file-drop__text strong {
  color: var(--g-pink);
}

.file-drop input[type="file"] { display: none; }

.file-preview {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--g-white);
  border: 1.5px solid var(--g-gray-200);
  align-items: center;
  gap: 12px;
}

.file-preview.is-visible { display: flex; }

.file-preview__thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--g-gray-50);
}

.file-preview__info {
  flex: 1;
  font-size: 13px;
  color: var(--g-navy);
}

.file-preview__name {
  font-weight: 600;
  word-break: break-all;
}

.file-preview__size {
  color: var(--g-gray-500);
  font-size: 12px;
}

.file-preview__remove {
  background: none;
  border: none;
  color: var(--g-gray-500);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.file-preview__remove:hover { background: #fff5f5; color: var(--g-error); }

/* ---------- Reuse contact ---------- */
.reuse-block {
  padding: 14px 16px;
  background: rgba(233, 38, 99, 0.05);
  border: 1px solid rgba(233, 38, 99, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
}

.reuse-block__label {
  font-weight: 600;
  color: var(--g-navy);
  margin-bottom: 8px;
  display: block;
}

.reuse-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reuse-chip {
  padding: 6px 12px;
  background: var(--g-white);
  border: 1px solid var(--g-gray-200);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--g-navy);
  transition: all 0.15s ease;
}

.reuse-chip:hover {
  background: var(--g-navy);
  color: var(--g-white);
  border-color: var(--g-navy);
}

/* ---------- Radio/Check ---------- */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-pill {
  position: relative;
  cursor: pointer;
}

.radio-pill input { position: absolute; opacity: 0; }

.radio-pill span {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid var(--g-gray-200);
  border-radius: 999px;
  background: var(--g-white);
  font-size: 14px;
  color: var(--g-navy);
  transition: all 0.2s ease;
}

.radio-pill input:checked + span {
  background: var(--g-navy);
  color: var(--g-white);
  border-color: var(--g-navy);
}

.radio-pill input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(233, 38, 99, 0.15);
}

/* ---------- Recap ---------- */
.recap {
  background: var(--g-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--g-gray-200);
  padding: 8px 0;
}

.recap__section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--g-gray-100);
}
.recap__section:last-child { border-bottom: none; }

.recap__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--g-pink);
  margin-bottom: 10px;
}

.recap__edit {
  background: none;
  border: none;
  color: var(--g-gray-500);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  font-family: inherit;
}

.recap__edit:hover { color: var(--g-pink); }

.recap__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 4px 0;
  font-size: 14px;
}

.recap__key { color: var(--g-gray-500); }
.recap__value { color: var(--g-navy); font-weight: 500; word-break: break-word; }
.recap__value--empty { color: var(--g-gray-300); font-style: italic; font-weight: 400; }

/* ---------- Success ---------- */
.success-wrap {
  text-align: center;
  padding: 48px 24px;
}

.success-wrap__icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g-pink), var(--g-pink-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--g-white);
  box-shadow: 0 12px 32px rgba(233, 38, 99, 0.35);
  animation: pop 0.6s var(--ease);
}

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--g-navy);
  color: var(--g-white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  transition: transform 0.4s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast--success { background: var(--g-success); }
.toast--error { background: var(--g-error); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .illustration-pane {
    min-height: 320px;
    padding: 32px;
  }
  .illustration-pane__viz { max-width: 240px; }
  .illustration-pane__title { font-size: 22px; }
  .form-pane { padding: 32px 24px; }
}

@media (max-width: 640px) {
  .form-pane { padding: 24px 20px; }
  h1.form-title { font-size: 26px; }
  .field-row, .field-row--thirds { grid-template-columns: 1fr; }
  .input-calc { flex-direction: column; align-items: stretch; }
  .input-calc__result { min-width: 0; }
  .recap__row { grid-template-columns: 1fr; gap: 2px; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn { width: 100%; }
  .total-card { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
