@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500&display=swap');

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

:root {
  --bg: #FAFAFA;
  --white: #fff;
  --surface: #F4F4F2;
  --violet: #7B2FBE;
  --violet-light: #F0E8F9;
  --violet-mid: #C084FC;
  --text: #1A1A1A;
  --text-mid: #555;
  --text-dim: #999;
  --border: #E0E0E0;
  --border-strong: #C0C0C0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* HEADER */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo span { color: var(--violet); }
.tagline {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}
.anomalies-badge {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.6;
}
.anomalies-badge a { color: var(--violet); }
.anomalies-badge a:hover { text-decoration: underline; }
.anomalies-badge em { font-style: italic; }

/* ADS */
.ad-banner {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 0.5rem 2rem;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-mid {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}
.ad-bottom {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

/* HERO */
.hero { padding: 5rem 2rem; background: var(--white); border-bottom: 1px solid var(--border); }
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.hero-text h1 em { font-style: italic; color: var(--violet); }
.hero-sub {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.75;
  font-weight: 300;
  margin-bottom: 2rem;
  max-width: 440px;
}
.btn-hero {
  display: inline-block;
  background: var(--violet);
  color: #fff;
  padding: 0.9rem 2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-hero:hover { background: #6B1FA8; }

.hero-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  width: 280px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.preview-header { display: flex; gap: 6px; margin-bottom: 1.25rem; }
.preview-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.preview-line { height: 8px; background: var(--surface); border-radius: 4px; margin-bottom: 8px; }
.preview-line.long { width: 100%; }
.preview-line.medium { width: 70%; }
.preview-line.short { width: 45%; }
.preview-spacer { height: 16px; }

/* CATEGORIES */
.categories { padding: 5rem 2rem; background: var(--bg); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.75rem;
}
.categories h2, .how h2, .anomalies-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2.5rem;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  transition: border-color 0.15s, transform 0.15s;
  display: block;
}
.cat-card:hover { border-color: var(--violet-mid); transform: translateY(-2px); }
.cat-card-special { border-color: var(--violet-mid); background: var(--violet-light); }
.cat-badge {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  background: var(--white);
  border: 0.5px solid var(--violet-mid);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}
.cat-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.cat-title { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.cat-desc { font-size: 0.82rem; color: var(--text-mid); line-height: 1.5; font-weight: 300; margin-bottom: 0.75rem; }
.cat-examples { font-size: 0.72rem; color: var(--text-dim); }

/* HOW */
.how { padding: 5rem 2rem; background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--violet-light); color: var(--violet);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem;
}
.step-title { font-size: 0.95rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.step-desc { font-size: 0.82rem; color: var(--text-mid); line-height: 1.6; font-weight: 300; }

/* ANOMALIES */
.anomalies-section { padding: 5rem 2rem; background: var(--bg); }
.anomalies-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.anomalies-text p { font-size: 0.9rem; color: var(--text-mid); line-height: 1.75; font-weight: 300; margin-bottom: 1rem; }
.anomalies-text strong { color: var(--text); font-weight: 500; }
.btn-anomalies {
  display: inline-block;
  border: 1px solid var(--violet);
  color: var(--violet);
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
  transition: all 0.15s;
}
.btn-anomalies:hover { background: var(--violet); color: #fff; }
.anomalies-tones { display: flex; flex-direction: column; gap: 1rem; }
.tone-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem;
}
.tone-badge {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.5rem;
}
.tone-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* FOOTER */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 2rem 2rem 1.25rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.3rem;
}
.footer-sub { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; text-align: right; }
.footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.5); transition: color 0.15s; }
.footer-links a:hover { color: var(--violet-mid); }
.footer-copy {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  border-top: 0.5px solid rgba(255,255,255,0.1);
  padding-top: 1rem;
}

/* GENERATEUR */
.generateur-main { padding: 2rem 1.5rem; }
.gen-wrap { max-width: 760px; margin: 0 auto; }

.progress-bar {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
}
.prog-step { display: flex; align-items: center; gap: 0.5rem; }
.prog-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 500; color: var(--text-dim);
  flex-shrink: 0; transition: all 0.2s;
}
.prog-dot.active { border-color: var(--violet); background: var(--violet); color: #fff; }
.prog-dot.done { border-color: var(--violet); background: var(--violet-light); color: var(--violet); }
.prog-label { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.prog-label.active { color: var(--violet); font-weight: 500; }
.prog-line { flex: 1; height: 1px; background: var(--border); margin: 0 0.5rem; transition: background 0.2s; }
.prog-line.done { background: var(--violet-mid); }

.form-section { display: none; }
.form-section.active { display: block; }

.section-head { margin-bottom: 1.75rem; }
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 600;
  color: var(--text); margin-bottom: 0.3rem;
}
.section-head p { font-size: 0.85rem; color: var(--text-mid); font-weight: 300; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--text-mid); margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--white);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.65rem 0.9rem; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet); }
.field textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 0.3rem; font-style: italic; }
.optional-note {
  font-size: 0.75rem; color: var(--text-mid);
  margin-bottom: 1.25rem; padding: 0.6rem 0.9rem;
  background: var(--surface); border-radius: 6px;
  border-left: 3px solid var(--violet-mid);
}

.ton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.ton-card {
  padding: 1rem; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  transition: all 0.15s; background: var(--white);
}
.ton-card:hover { border-color: var(--violet-mid); background: var(--violet-light); }
.ton-card.selected { border-color: var(--violet); background: var(--violet-light); }
.ton-badge {
  display: inline-block; font-size: 0.58rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--violet); background: var(--violet-light);
  padding: 0.15rem 0.5rem; border-radius: 3px;
  margin-bottom: 0.3rem; border: 0.5px solid var(--violet-mid);
}
.ton-name { font-size: 0.88rem; font-weight: 500; color: var(--text); margin-bottom: 0.2rem; }
.ton-desc { font-size: 0.72rem; color: var(--text-dim); line-height: 1.4; }

.nav-btns {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.btn { padding: 0.7rem 1.75rem; border-radius: 6px; font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.btn-secondary { background: var(--white); border: 1px solid var(--border); color: var(--text-mid); }
.btn-secondary:hover { border-color: var(--border-strong); color: var(--text); }
.btn-primary { background: var(--violet); border: none; color: #fff; }
.btn-primary:hover { background: #6B1FA8; }

.loading { display: none; text-align: center; padding: 3.5rem 1.5rem; }
.loading.show { display: block; }
.loading-spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.9rem; color: var(--text-mid); }
.loading-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.3rem; font-style: italic; }

.result-block { display: none; }
.result-block.show { display: block; }

.letter-wrap {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; padding: 2.5rem; margin-bottom: 1.25rem;
}
.letter-label {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--violet); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.letter-label::after { content: ''; flex: 1; height: 0.5px; background: var(--border); }
.letter-content {
  font-size: 0.88rem; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; font-family: 'Inter', sans-serif;
}

.result-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0; }
.btn-action {
  padding: 0.6rem 1.25rem; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-copy { background: var(--white); border: 1px solid var(--border); color: var(--text-mid); }
.btn-copy:hover { border-color: var(--violet); color: var(--violet); }
.btn-pdf { background: var(--violet); border: none; color: #fff; }
.btn-pdf:hover { background: #6B1FA8; }
.btn-regen { background: var(--violet-light); border: 1px solid var(--violet-mid); color: var(--violet); }
.btn-regen:hover { background: var(--violet); color: #fff; }
.btn-new { background: var(--white); border: 1px solid var(--border); color: var(--text-mid); margin-left: auto; }
.btn-new:hover { border-color: var(--border-strong); }

.anomalies-footer-block {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-dim);
  padding: 0.75rem 0; border-top: 0.5px solid var(--border);
  margin-top: 0;
}
.anomalies-footer-block a { color: var(--violet); }
.anomalies-footer-block a:hover { text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .anomalies-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-preview { display: none; }
}
@media (max-width: 600px) {
  .cat-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .ton-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .anomalies-badge { text-align: left; }
  .prog-label { display: none; }
  .hero-text h1 { font-size: 2.2rem; }
  .result-actions { gap: 0.5rem; }
  .anomalies-footer-block { flex-direction: column; gap: 0.25rem; }
}
