/* MatDev — Générateur IA cahier des charges */
.spec-page {
  --spec-accent: rgba(118, 87, 255, 0.55);
  --spec-accent-2: rgba(32, 199, 232, 0.45);
  --spec-border: rgba(255, 255, 255, 0.1);
  --spec-card: rgba(10, 14, 32, 0.82);
  --spec-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.spec-hero {
  padding: calc(var(--header-height, 72px) + 1.5rem) 0 2rem;
  max-width: 820px;
}

.spec-hero__title {
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  margin: 0.75rem 0 1rem;
  letter-spacing: -0.02em;
}

.spec-hero__subtitle {
  color: var(--text-secondary, #a8b0c8);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.65;
  max-width: 62ch;
  margin: 0;
}

.spec-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.spec-hero__pills li {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--spec-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.spec-hero__brand {
  color: var(--accent-gold, #e8c547);
}

.spec-hero__trust {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary, var(--text-2, #94a3b8));
  letter-spacing: 0.02em;
}

.spec-app {
  max-width: 800px;
  margin-bottom: 3rem;
}

.spec-progress-wrap {
  margin-bottom: 1.25rem;
}

.spec-progress {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.spec-progress__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(118, 87, 255, 0.25), transparent);
  opacity: 0;
  animation: spec-progress-glow 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes spec-progress-glow {
  0%, 100% { opacity: 0; transform: translateX(-30%); }
  50% { opacity: 1; transform: translateX(30%); }
}

.spec-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
}

.spec-progress__bar {
  position: relative;
  z-index: 1;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold, #e8c547), var(--accent-2, #20c7e8), var(--accent-gold, #e8c547));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.55s var(--spec-ease);
  animation: spec-bar-shimmer 3s linear infinite;
}

@keyframes spec-bar-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.spec-steps-nav {
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-steps-nav li {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: transform 0.35s var(--spec-ease), background 0.35s, box-shadow 0.35s;
}

.spec-steps-nav li.is-active {
  background: linear-gradient(135deg, var(--accent-gold, #e8c547), var(--accent-2, #20c7e8));
  transform: scale(1.35);
  box-shadow: 0 0 12px rgba(118, 87, 255, 0.55);
}

.spec-steps-nav li.is-done {
  background: rgba(32, 199, 232, 0.65);
}

.spec-wizard {
  position: relative;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--spec-border);
  border-radius: 20px;
  background: var(--spec-card);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.spec-wizard::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(118, 87, 255, 0.35), transparent 40%, rgba(32, 199, 232, 0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

.spec-step {
  animation: none;
}

.spec-step--enter {
  animation: spec-step-in 0.5s var(--spec-ease) both;
}

@keyframes spec-step-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spec-step__title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.spec-step__desc {
  color: var(--text-secondary);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 58ch;
}

.spec-step__section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-step__section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.spec-step__section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text-primary, #fff);
}

.spec-step__section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  line-height: 1.5;
}

.spec-options {
  display: grid;
  gap: 0.65rem;
}

.spec-options--grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.spec-options--compact {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.spec-options--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.spec-options--inline .spec-option {
  flex: 1 1 180px;
}

@media (min-width: 600px) {
  .spec-options--grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

.spec-option--anim {
  animation: spec-option-in 0.45s var(--spec-ease) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

@keyframes spec-option-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spec-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.spec-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.spec-option__box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--spec-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--spec-ease), box-shadow 0.25s;
  min-height: 100%;
}

.spec-option input:checked + .spec-option__box {
  border-color: var(--spec-accent);
  background: linear-gradient(145deg, rgba(118, 87, 255, 0.16), rgba(32, 199, 232, 0.08));
  box-shadow: 0 0 0 1px rgba(118, 87, 255, 0.2), 0 8px 24px rgba(118, 87, 255, 0.12);
}

.spec-option:hover .spec-option__box {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.spec-other-wrap {
  margin-top: 0.85rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s var(--spec-ease), opacity 0.35s, margin 0.35s;
}

.spec-other-wrap.is-visible,
.spec-other-wrap:not([hidden]) {
  max-height: 200px;
  opacity: 1;
}

.spec-field--other textarea {
  min-height: 80px;
}

.spec-other-wrap[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
}

.spec-step__section:last-of-type {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

#s1-sub .spec-step__section {
  margin-top: 1.25rem;
}

.spec-field--url {
  margin-top: 1rem;
  margin-bottom: 0;
}

.spec-option input:focus-visible + .spec-option__box {
  outline: 2px solid var(--accent-2, #20c7e8);
  outline-offset: 2px;
}

.spec-option__label {
  font-weight: 600;
  font-size: 0.9rem;
}

.spec-option__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.spec-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.spec-field span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.spec-field input,
.spec-field textarea,
.spec-field select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--spec-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font: inherit;
  transition: border-color 0.2s;
}

.spec-field input:focus,
.spec-field textarea:focus,
.spec-field select:focus {
  outline: none;
  border-color: var(--spec-accent);
}

.spec-field textarea {
  min-height: 120px;
  resize: vertical;
}

.spec-char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.spec-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--spec-border);
}

.spec-nav .btn {
  min-height: 44px;
}

.spec-recap {
  display: grid;
  gap: 1rem;
}

.spec-recap__block {
  padding: 1rem;
  border: 1px solid var(--spec-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.spec-recap__block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.spec-recap__block p {
  margin: 0;
  font-size: 0.95rem;
}

/* Analysis animation */
.spec-analysis {
  text-align: center;
  padding: 2.5rem 1rem;
}

.spec-analysis--premium {
  position: relative;
}

.spec-analysis__orb {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
}

.spec-analysis__orb span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.spec-analysis__orb span:nth-child(1) {
  border-top-color: var(--accent-gold, #e8c547);
  animation: spec-spin 1.1s linear infinite;
}

.spec-analysis__orb span:nth-child(2) {
  inset: 8px;
  border-right-color: #20c7e8;
  animation: spec-spin 1.6s linear infinite reverse;
}

.spec-analysis__orb span:nth-child(3) {
  inset: 16px;
  border-bottom-color: rgba(255, 255, 255, 0.35);
  animation: spec-spin 2.2s linear infinite;
}

.spec-analysis__steps {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 360px;
  margin: 1.75rem auto 0;
  text-align: left;
}

.spec-analysis__step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  transition: color 0.35s, background 0.35s, transform 0.35s var(--spec-ease);
}

.spec-analysis__step.is-active {
  color: var(--text-primary, #fff);
  background: rgba(118, 87, 255, 0.1);
  transform: translateX(4px);
}

.spec-analysis__step.is-done {
  color: #20c7e8;
}

.spec-analysis__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.spec-analysis__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-2, #20c7e8);
  border-radius: 50%;
  animation: spec-spin 0.9s linear infinite;
}

@keyframes spec-spin {
  to { transform: rotate(360deg); }
}

/* Result inline (wizard) */
.spec-result-inline {
  display: grid;
  gap: 1rem;
}

.spec-result-card {
  padding: 1.35rem;
  border: 1px solid var(--spec-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  transition: transform 0.3s var(--spec-ease), border-color 0.3s, box-shadow 0.3s;
}

.spec-result-card--anim {
  animation: spec-card-in 0.55s var(--spec-ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes spec-card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spec-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(118, 87, 255, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.spec-result-card__subtitle {
  margin: 1rem 0 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.spec-result-list {
  margin: 0;
  padding-left: 1.1rem;
}

.spec-result-list li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.spec-result-empty {
  color: var(--text-muted);
  margin: 0;
}

.spec-phases {
  display: grid;
  gap: 0.85rem;
}

.spec-phase {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.spec-phase__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.spec-phase__dur {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(118, 87, 255, 0.15);
  color: #c4b5fd;
}

.spec-phase p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.spec-result-head--animated {
  animation: spec-step-in 0.6s var(--spec-ease) both;
}

.spec-cta-final--animated {
  animation: spec-card-in 0.65s var(--spec-ease) 0.2s both;
}

.spec-result-card h2,
.spec-result-card h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.spec-result-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.spec-result-card li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.spec-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.spec-score,
.spec-price-tag,
.spec-complexity {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--spec-border);
  background: rgba(255, 255, 255, 0.03);
}

.spec-complexity--simple { border-color: rgba(52, 211, 153, 0.4); color: #34d399; }
.spec-complexity--mid { border-color: rgba(251, 191, 36, 0.4); color: #fbbf24; }
.spec-complexity--advanced { border-color: rgba(248, 113, 113, 0.4); color: #f87171; }

.spec-cta-final {
  margin: 2.5rem 0;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--spec-border);
  border-radius: 16px;
}

.spec-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.spec-error {
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  margin-top: 1rem;
}

.spec-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Modal */
.spec-modal[hidden] { display: none; }
.spec-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.spec-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.spec-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  border: 1px solid var(--spec-border);
  border-radius: 16px;
  background: var(--bg-secondary, #0c1024);
}

.spec-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.spec-modal__desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.spec-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  cursor: pointer;
}

.spec-check input { margin-top: 0.2rem; flex-shrink: 0; }

.spec-form-error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

/* SEO content below tool */
.spec-seo-content {
  max-width: 720px;
  margin: 0 auto 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--spec-border);
}

.spec-seo-block {
  margin-bottom: 2.5rem;
}

.spec-seo-block h2 {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

.spec-seo-block p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* Result page */
.spec-result-page {
  padding: calc(var(--header-height, 72px) + 1.5rem) 0 4rem;
}

.spec-result-head__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin: 0.5rem 0;
}

.spec-result-head__summary {
  color: var(--text-secondary);
  max-width: 65ch;
  line-height: 1.65;
}

.spec-result-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .spec-result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .spec-result-card--wide {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spec-progress__bar,
  .spec-progress__glow,
  .spec-option__box,
  .spec-option--anim,
  .spec-analysis__orb span,
  .spec-step--enter,
  .spec-result-card--anim,
  .spec-result-head--animated,
  .spec-cta-final--animated {
    transition: none;
    animation: none;
  }
}

.spec-progress__label {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7289);
  margin: 0;
  font-weight: 500;
}
