/* QuantAIHub — Swiss Grid Poster Design System */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #E30613;
  --black: #111111;
  --white: #FFFFFF;
  --grid-grey: #E5E5E5;
  --cobalt: #1D4ED8;
  --grey-mid: #666666;
  --grey-light: #F5F5F5;
  --font: Helvetica, Arial, sans-serif;
  --max: 1200px;
  --gap: 24px;
  --col: calc((var(--max) - 11 * var(--gap)) / 12);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--red); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.grid-bg {
  background-image:
    linear-gradient(var(--grid-grey) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-grey) 1px, transparent 1px);
  background-size: calc(var(--col) + var(--gap)) calc(var(--col) + var(--gap));
}

/* Header */
.site-header {
  border-bottom: 3px solid var(--black);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gap);
  max-width: var(--max);
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--black);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.logo span { color: var(--red); }

.logo-tagline {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--grey-mid);
  display: block;
  max-width: 220px;
  line-height: 1.3;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--black);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  border-color: var(--black);
  background: var(--grid-grey);
  color: var(--black);
}

.nav-toggle {
  display: none;
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
}

/* Hero */
.hero {
  border-bottom: 3px solid var(--black);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}

.hero-session-label {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 14px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 14ch;
  margin-bottom: 24px;
}

.hero-lead {
  font-size: 1.125rem;
  max-width: 52ch;
  margin-bottom: 32px;
  color: var(--black);
}

.hero-notice {
  background: var(--black);
  color: var(--white);
  padding: 20px 24px;
  border-left: 6px solid var(--red);
  max-width: 60ch;
  font-size: 0.9375rem;
  margin-bottom: 32px;
}

.hero-notice strong { color: var(--red); }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

.hero-image {
  border: 3px solid var(--black);
  position: relative;
}

.hero-image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.hero-image::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  border: 2px solid var(--cobalt);
  z-index: -1;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  border: 3px solid var(--black);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-primary:hover { background: var(--black); border-color: var(--black); color: var(--white); }

.btn-secondary { background: var(--white); color: var(--black); }
.btn-secondary:hover { background: var(--black); color: var(--white); }

.btn-cobalt { background: var(--cobalt); color: var(--white); border-color: var(--cobalt); }
.btn-cobalt:hover { background: var(--black); border-color: var(--black); color: var(--white); }

/* Sections */
section { padding: 64px 0; border-bottom: 1px solid var(--grid-grey); }

.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 24ch;
}

.section-intro {
  max-width: 60ch;
  margin-bottom: 40px;
  color: var(--grey-mid);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.stat-item {
  border: 2px solid var(--black);
  padding: 28px 20px;
  text-align: center;
  background: var(--white);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: 8px 8px 0 var(--grid-grey);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}

.card {
  border: 2px solid var(--black);
  padding: 28px 24px;
  background: var(--white);
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--red); }

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card p { font-size: 0.9375rem; color: var(--grey-mid); }

.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Session flow */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  position: relative;
}

.flow-step {
  border: 2px solid var(--black);
  padding: 24px 16px;
  text-align: center;
  position: relative;
}

.flow-step-num {
  display: inline-block;
  width: 36px;
  height: 36px;
  background: var(--cobalt);
  color: var(--white);
  font-weight: 700;
  line-height: 36px;
  margin-bottom: 12px;
}

.flow-step h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 8px; }
.flow-step p { font-size: 0.8125rem; color: var(--grey-mid); }

/* Reasons */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.reason-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--grid-grey);
  border-left: 4px solid var(--red);
}

.reason-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--grid-grey);
  line-height: 1;
  flex-shrink: 0;
}

.reason-item h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.reason-item p { font-size: 0.9375rem; color: var(--grey-mid); }

/* Demarche */
.demarche-list { counter-reset: demarche; }

.demarche-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--grid-grey);
  counter-increment: demarche;
}

.demarche-item::before {
  content: counter(demarche, decimal-leading-zero);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
}

.demarche-item h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 8px; }
.demarche-item p { font-size: 0.9375rem; color: var(--grey-mid); }

/* Format cards */
.format-card {
  border: 2px solid var(--black);
  overflow: hidden;
}

.format-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.format-card-body { padding: 24px; }
.format-card-body h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.format-card-body p { font-size: 0.9375rem; color: var(--grey-mid); }

/* Mini FAQ */
.mini-faq details {
  border: 1px solid var(--grid-grey);
  margin-bottom: 8px;
}

.mini-faq summary {
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-faq summary::-webkit-details-marker { display: none; }
.mini-faq summary::after { content: '+'; font-size: 1.25rem; color: var(--red); }
.mini-faq details[open] summary::after { content: '−'; }

.mini-faq details p {
  padding: 0 20px 16px;
  font-size: 0.9375rem;
  color: var(--grey-mid);
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.testimonial {
  border: 2px solid var(--black);
  padding: 28px 24px;
  position: relative;
}

.testimonial::before {
  content: '\201C';
  font-size: 3rem;
  color: var(--red);
  line-height: 1;
  position: absolute;
  top: 12px;
  left: 16px;
  opacity: 0.3;
}

.testimonial blockquote {
  font-size: 0.9375rem;
  font-style: italic;
  margin-bottom: 16px;
  padding-top: 24px;
}

.testimonial cite {
  font-size: 0.8125rem;
  font-weight: 700;
  font-style: normal;
}

/* CTA */
.cta-block {
  background: var(--black);
  color: var(--white);
  padding: 64px var(--gap);
  text-align: center;
}

.cta-block h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 16px;
}

.cta-block p {
  max-width: 50ch;
  margin: 0 auto 32px;
  opacity: 0.85;
}

/* AMF Disclaimer */
.amf-disclaimer {
  background: var(--grey-light);
  border: 2px solid var(--grid-grey);
  padding: 24px 28px;
  font-size: 0.8125rem;
  color: var(--grey-mid);
  line-height: 1.7;
}

.amf-disclaimer strong { color: var(--black); }

/* Footer */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 40px;
}

.footer-brand .logo { color: var(--white); margin-bottom: 12px; }
.footer-brand p { font-size: 0.8125rem; opacity: 0.7; max-width: 30ch; }

.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  color: var(--red);
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--white); text-decoration: none; font-size: 0.8125rem; opacity: 0.8; }
.footer-col a:hover { opacity: 1; color: var(--red); }

.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 24px;
  font-size: 0.75rem;
  opacity: 0.6;
  line-height: 1.8;
}

.footer-legal a { color: var(--white); }

/* Page header */
.page-header {
  padding: 48px 0 32px;
  border-bottom: 3px solid var(--black);
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.page-header p { max-width: 60ch; color: var(--grey-mid); }

/* Programmes / Services lists */
.programme-list, .service-list { display: flex; flex-direction: column; gap: var(--gap); }

.programme-item, .service-item {
  display: grid;
  grid-template-columns: 120px 1fr 180px;
  gap: var(--gap);
  border: 2px solid var(--black);
  padding: 28px;
  align-items: start;
}

.programme-code, .service-code {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.05em;
}

.programme-item h2, .service-item h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.programme-item p, .service-item p {
  font-size: 0.9375rem;
  color: var(--grey-mid);
  margin-bottom: 8px;
}

.price-range {
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
  padding: 12px;
  background: var(--grid-grey);
  border: 1px solid var(--black);
}

/* About */
.about-content { max-width: 72ch; }
.about-content h2 { font-size: 1.375rem; font-weight: 700; margin: 32px 0 12px; }
.about-content p { margin-bottom: 16px; color: var(--grey-mid); }
.about-content img { margin: 32px 0; border: 2px solid var(--black); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: 40px 0;
}

/* Contact form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gap) * 2);
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--black);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}

.form-group textarea { min-height: 160px; resize: vertical; }

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.contact-info {
  border: 2px solid var(--black);
  padding: 32px;
}

.contact-info h2 { font-size: 1.25rem; margin-bottom: 20px; }
.contact-info p { margin-bottom: 12px; font-size: 0.9375rem; }
.contact-info a { color: var(--black); font-weight: 600; }

.form-message {
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 2px solid var(--black);
  font-weight: 600;
}

.form-message.success { background: #ECFDF5; border-color: #059669; }
.form-message.error { background: #FEF2F2; border-color: var(--red); }

/* FAQ full page */
.faq-list details {
  border: 2px solid var(--black);
  margin-bottom: 12px;
}

.faq-list summary {
  padding: 20px 24px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }
.faq-list .faq-answer { padding: 0 24px 20px; color: var(--grey-mid); font-size: 0.9375rem; }

/* Legal pages */
.legal-content { max-width: 72ch; padding: 48px 0; }
.legal-content h1 { font-size: 2rem; margin-bottom: 24px; }
.legal-content h2 { font-size: 1.25rem; margin: 32px 0 12px; }
.legal-content p, .legal-content li { margin-bottom: 12px; color: var(--grey-mid); font-size: 0.9375rem; }
.legal-content ul { margin-left: 24px; margin-bottom: 16px; }

/* 404 */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px var(--gap);
}

.error-page h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 16px;
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
}

.error-page p { color: var(--grey-mid); margin-bottom: 32px; max-width: 40ch; margin-left: auto; margin-right: auto; }

.error-code {
  font-size: 6rem;
  font-weight: 700;
  color: var(--grid-grey);
  line-height: 1;
  margin-bottom: 24px;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  padding: 20px var(--gap);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  border-top: 4px solid var(--red);
}

.cookie-banner.visible { transform: translateY(0); }

.cookie-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}

.cookie-text { flex: 1; min-width: 280px; font-size: 0.875rem; line-height: 1.5; }
.cookie-text a { color: var(--red); }

.cookie-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.cookie-buttons button {
  padding: 10px 18px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8125rem;
  border: 2px solid var(--white);
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-accept { background: var(--red); color: var(--white); border-color: var(--red); }
.cookie-accept:hover { background: var(--white); color: var(--black); }

.cookie-refuse { background: transparent; color: var(--white); }
.cookie-refuse:hover { background: var(--white); color: var(--black); }

.cookie-customize { background: transparent; color: var(--white); border-color: var(--cobalt); }
.cookie-customize:hover { background: var(--cobalt); color: var(--white); }

/* Animations — contenu visible par défaut (sans dépendance JS) */
.fade-in {
  opacity: 1;
  transform: translateY(0);
}

html.js-anim .fade-in:not(.visible) {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.grid-line-animate {
  position: relative;
  overflow: hidden;
}

.grid-line-animate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.8s ease;
}

.grid-line-animate.visible::before { transform: scaleX(1); }

/* Responsive */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-steps { grid-template-columns: repeat(3, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .programme-item, .service-item { grid-template-columns: 1fr; }
  .price-range { text-align: left; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 3px solid var(--black);
  }

  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { border-bottom: 1px solid var(--grid-grey); }

  .hero-grid { grid-template-columns: 1fr; }
  .cards-grid, .cards-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .flow-steps { grid-template-columns: 1fr; }
  .reasons-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .cookie-inner { flex-direction: column; text-align: center; }
  .cookie-buttons { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
}
