/* ============================================================
   NEXORYA × G Coffrage — Phase 0 questionnaire client
   Brand: NEXORYA strict (purple #7a26fb · magenta #e100ff · black)
   ============================================================ */

:root {
  /* NEXORYA palette officielle */
  --nx-black: #121212;
  --nx-white: #ffffff;
  --nx-purple: #7a26fb;
  --nx-magenta: #e100ff;
  --nx-light-purple: #c7caff;
  --nx-pink: #f6c2f4;
  --nx-orange: #ff5f2e;
  --nx-yellow: #fdf070;

  /* UI tokens dérivés */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #1a1a1a;
  --ink-soft: #525252;
  --ink-mute: #8b8b8b;
  --border: #e5e5e5;
  --border-soft: #f0f0f0;
  --success: #16a34a;
  --warn: #ea580c;
  --error: #dc2626;

  /* Gradients NEXORYA signature */
  --grad-cosmic: linear-gradient(135deg, var(--nx-purple) 0%, var(--nx-magenta) 100%);
  --grad-cosmic-soft: linear-gradient(135deg, rgba(122, 38, 251, 0.08) 0%, rgba(225, 0, 255, 0.08) 100%);
  --grad-glow: radial-gradient(circle at 30% 20%, rgba(122, 38, 251, 0.15) 0%, transparent 50%);

  /* Typography */
  --font-heading: 'Anton', 'Impact', -apple-system, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  --font-accent: 'Varela Round', -apple-system, sans-serif;

  /* Spacing */
  --gap-xs: 0.5rem;
  --gap-sm: 0.75rem;
  --gap: 1rem;
  --gap-md: 1.5rem;
  --gap-lg: 2rem;
  --gap-xl: 3rem;
  --gap-xxl: 5rem;

  /* Radius */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --sh-2: 0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -1px rgba(0,0,0,.04);
  --sh-glow: 0 20px 60px -20px rgba(122, 38, 251, 0.4);
}

/* ============================================================
   Reset
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--nx-purple); text-decoration: none; }
a:hover { color: var(--nx-magenta); }

/* ============================================================
   Hero NEXORYA cosmic dark
   ============================================================ */
.hero {
  background: var(--nx-black);
  color: var(--nx-white);
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(225, 0, 255, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
}
.hero-brand img {
  height: 28px;
  width: auto;
}
.hero-brand .sep {
  width: 1px; height: 24px;
  background: rgba(255,255,255,0.25);
}
.hero-brand .client {
  font-family: var(--font-accent);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}
.hero h1 .accent {
  background: var(--grad-cosmic);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: rgba(255,255,255,0.85);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 2rem;
}
.hero .meta-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
}
.hero .meta-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  backdrop-filter: blur(8px);
}
.hero .meta-card .label {
  font-family: var(--font-accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nx-light-purple);
  margin-bottom: 0.25rem;
}
.hero .meta-card .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--nx-white);
}
.hero .cta-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero .btn-primary {
  background: var(--grad-cosmic);
  color: var(--nx-white);
  font-weight: 600;
  padding: 0.95rem 1.75rem;
  border-radius: var(--r);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: var(--sh-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 70px -15px rgba(225, 0, 255, 0.5);
}
.hero .duration-hint {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
}

/* ============================================================
   Sticky progress bar
   ============================================================ */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem clamp(1rem, 3vw, 2rem);
  display: none;
  align-items: center;
  gap: 1rem;
}
.progress-bar.active { display: flex; }
.progress-bar .label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
}
.progress-bar .track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--grad-cosmic);
  width: 0;
  transition: width 0.3s ease;
  border-radius: 999px;
}
.progress-bar .count {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ============================================================
   Main content
   ============================================================ */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) clamp(1rem, 3vw, 2rem);
}

/* Section step */
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  scroll-margin-top: 80px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.step.is-active {
  border-color: var(--nx-purple);
  box-shadow: 0 8px 24px -8px rgba(122, 38, 251, 0.15);
}
.step-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease;
}
.step.is-done .step-num {
  background: var(--grad-cosmic);
  color: var(--nx-white);
}
.step.is-active .step-num {
  background: var(--grad-cosmic);
  color: var(--nx-white);
  box-shadow: 0 4px 12px rgba(122, 38, 251, 0.3);
}
.step-head h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.2;
}
.step-head .sub {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-weight: 400;
}
.step-body {
  padding: 1.5rem 1.75rem 1.75rem;
}
.step-intro {
  background: var(--grad-cosmic-soft);
  border-left: 3px solid var(--nx-purple);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.step-intro strong { color: var(--ink); }

/* ============================================================
   Form fields
   ============================================================ */
.field-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.field-group.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field label,
.field-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.45;
}
.field-label.required::after {
  content: " *";
  color: var(--nx-magenta);
  font-weight: 700;
}
.field .hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  font-weight: 400;
  margin-top: -0.15rem;
}
.field .example {
  font-size: 0.82rem;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: -0.1rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="url"],
.field input[type="date"],
.field select,
.field textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--nx-purple);
  box-shadow: 0 0 0 4px rgba(122, 38, 251, 0.1);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-mute);
}
.field textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

/* Choice cards (radio/checkbox) */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}
.choices.stack {
  grid-template-columns: 1fr;
}
.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  font-size: 0.93rem;
  line-height: 1.45;
}
.choice:hover {
  border-color: var(--nx-light-purple);
  background: rgba(122, 38, 251, 0.03);
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice .check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  background: var(--surface);
}
.choice input[type="radio"] ~ .check { border-radius: 50%; }
.choice .check::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--nx-white);
  border-radius: 3px;
  transform: scale(0);
  transition: transform 0.15s;
}
.choice input[type="radio"] ~ .check::after { border-radius: 50%; }
.choice input:checked ~ .check {
  background: var(--grad-cosmic);
  border-color: var(--nx-purple);
}
.choice input:checked ~ .check::after { transform: scale(1); }
.choice input:checked ~ .label-content { color: var(--ink); font-weight: 500; }
.choice:has(input:checked) {
  border-color: var(--nx-purple);
  background: rgba(122, 38, 251, 0.04);
}
.choice .label-content {
  flex: 1;
  color: var(--ink-soft);
}
.choice .label-content strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}
.choice .label-content span {
  font-size: 0.85rem;
  color: var(--ink-mute);
  line-height: 1.4;
}

/* Two-column block (G + 2M) */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.entity-card {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 1.25rem;
}
.entity-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 0.25rem;
}
.entity-card .ent-sub {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 1rem;
  font-family: var(--font-accent);
}
.entity-card .field { margin-bottom: 0.9rem; }
.entity-card .field:last-child { margin-bottom: 0; }
.entity-card .field label { font-size: 0.88rem; }
.entity-card input { font-size: 0.9rem; padding: 0.55rem 0.75rem; }

/* Notes block (free text) */
.notes-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}

/* ============================================================
   Step nav buttons
   ============================================================ */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary {
  background: var(--grad-cosmic);
  color: var(--nx-white);
  box-shadow: 0 4px 14px rgba(122, 38, 251, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(225, 0, 255, 0.35);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--nx-purple);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--nx-purple); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   Save indicator
   ============================================================ */
.save-pulse {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--ink);
  color: var(--nx-white);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.save-pulse.show {
  opacity: 1;
  transform: translateY(0);
}
.save-pulse::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  background: var(--nx-black);
  color: var(--nx-white);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
  margin-top: 4rem;
  text-align: center;
}
footer .signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}
footer .signature img {
  height: 22px;
}
footer .signature .by {
  font-family: var(--font-accent);
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}
footer .tagline {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  background: var(--grad-cosmic);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}
footer .links {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
footer .links a {
  color: rgba(255,255,255,0.75);
}
footer .links a:hover { color: var(--nx-light-purple); }

/* ============================================================
   Submit panel (final step)
   ============================================================ */
.submit-panel {
  background: var(--nx-black);
  color: var(--nx-white);
  border-radius: var(--r-lg);
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
}
.submit-panel::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}
.submit-panel > * { position: relative; z-index: 1; }
.submit-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.submit-panel p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.5rem;
}
.submit-panel .btn-submit {
  background: var(--grad-cosmic);
  color: var(--nx-white);
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 40px -10px rgba(225, 0, 255, 0.5);
  transition: all 0.2s ease;
}
.submit-panel .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px -10px rgba(225, 0, 255, 0.7);
}
.submit-panel .small-note {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.55);
  margin-top: 1rem;
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  .step-head { padding: 1.25rem; gap: 0.9rem; }
  .step-body { padding: 1.25rem; }
  .field-group.cols-2 { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .entity-grid { grid-template-columns: 1fr; }
  .step-num { width: 38px; height: 38px; font-size: 1.1rem; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .btn { width: 100%; justify-content: center; }
}
