:root {
    --ink: #1A192E;
    --paper: #FAFAFA;
    --accent: #7B1FE4;
    --accent2: #5B3E9F;
    --muted: #6D6B7B;
    --border: #CCCBD1;
    --card: #ffffff;
  }

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

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    min-height: 100vh;
  }

  /* HEADER */
  header {
    background: var(--ink);
    color: white;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 4px solid var(--accent);
    position: relative;
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.1rem 2rem;
  }

  header::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #1A192E 33%, #ffffff 33%, #ffffff 66%, #7B1FE4 66%);
  }

  .logo {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
  }

  .logo span { color: #7B1FE4; }

  .badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }

  /* HERO */
  .hero {
    text-align: center;
    padding: 3.5rem 1rem 2rem;
    max-width: 640px;
    margin: 0 auto;
  }

  .hero h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.15;
    margin-bottom: 0.8rem;
  }

  .hero h1 em {
    font-style: italic;
    color: var(--accent);
  }

  .hero p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Tricolor accent line under hero */
  .hero-divider {
    display: flex;
    width: 120px;
    height: 4px;
    margin: 1.2rem auto 0;
    border-radius: 2px;
    overflow: hidden;
  }

  .hero-divider span {
    flex: 1;
  }

  .hero-divider span:nth-child(1) { background: #1A192E; }
  .hero-divider span:nth-child(2) { background: #ffffff; border: 1px solid #e0e0e0; }
  .hero-divider span:nth-child(3) { background: #7B1FE4; }

  /* MAIN LAYOUT */
  .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }

  @media (max-width: 680px) {
    .container { grid-template-columns: 1fr; }
  }

  /* FORM PANEL */
  .panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  }

  .panel h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 1.4rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--ink);
  }

  .field { margin-bottom: 1.1rem; }

  label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 0.35rem;
  }

  select, input, textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 0.2s;
    appearance: none;
  }

  select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8070' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem; }

  select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
  }

  textarea { resize: vertical; min-height: 70px; }

  .law-tag {
    display: inline-block;
    background: #eef2fb;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-top: 0.4rem;
    font-weight: 500;
  }

  .law-tag.active {
    background: #dde6f8;
    border-color: var(--ink);
    color: var(--ink);
  }

  .btn-generate {
    width: 100%;
    margin-top: 1rem;
    padding: 0.85rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.2px;
  }

  .btn-generate:hover { background: var(--accent); }
  .btn-generate:active { transform: scale(0.99); }
  .btn-generate:disabled { background: var(--muted); cursor: not-allowed; }

  /* OUTPUT PANEL */
  .output-panel {
    position: sticky;
    top: 1.5rem;
  }

  .output-panel h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 1.4rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .letter-box {
    background: var(--paper);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 300px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.75;
    white-space: pre-wrap;
    color: var(--ink);
    position: relative;
  }

  .letter-box.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-style: italic;
    font-size: 0.88rem;
  }

  .letter-placeholder {
    text-align: center;
  }

  .letter-placeholder .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
  }

  .loading-dots {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--muted);
  }

  .loading-dots.show { display: block; }

  .dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--ink);
    border-radius: 50%;
    margin: 0 3px;
    animation: bounce 1.2s infinite ease-in-out;
  }

  .dot:nth-child(2) { animation-delay: 0.2s; }
  .dot:nth-child(3) { animation-delay: 0.4s; }

  @keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-8px); opacity: 1; }
  }

  .actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.9rem;
  }

  .btn-action {
    flex: 1;
    padding: 0.6rem;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--ink);
  }

  .btn-action:hover { border-color: var(--ink); background: var(--ink); color: white; }
  .btn-action.primary { background: var(--ink); color: white; border-color: var(--ink); }
  .btn-action.primary:hover { background: var(--accent); border-color: var(--accent); }
  .btn-action:disabled { opacity: 0.4; cursor: not-allowed; }

  /* INFO PILL */
  .info-box {
    background: #eef2fb;
    border: 1px solid #b8c8e8;
    border-left: 4px solid var(--ink);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.8rem;
    color: #003080;
    margin-top: 1rem;
    line-height: 1.5;
  }

  .info-box strong { font-weight: 500; }

  footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
  }

  /* ===== ZONES ADSENSE ===== */
  .ad-zone {
    background: #e0e8f5;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    gap: 0.3rem;
    position: relative;
    overflow: hidden;
  }

  .ad-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(0,0,0,0.015) 10px,
      rgba(0,0,0,0.015) 20px
    );
  }

  .ad-zone .ad-label {
    font-size: 0.65rem;
    opacity: 0.6;
  }

  .ad-zone .ad-size {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.5;
  }

  /* Leaderboard 728×90 sous le hero */
  .ad-leaderboard {
    max-width: 900px;
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
  }

  .ad-leaderboard .ad-zone {
    width: 100%;
    height: 90px;
  }

  /* Rectangle 300×250 sous le conseil d'envoi */
  .ad-rectangle .ad-zone {
    width: 100%;
    height: 250px;
    margin-top: 1rem;
  }

  /* Banner horizontal 728×90 avant footer */
  .ad-banner {
    max-width: 900px;
    margin: 2rem auto 0;
    padding: 0 1.5rem;
  }

  .ad-banner .ad-zone {
    width: 100%;
    height: 90px;
  }

  @media (max-width: 680px) {
    .ad-leaderboard .ad-zone,
    .ad-banner .ad-zone { height: 60px; }
    .ad-rectangle .ad-zone { height: 200px; }
  }

  /* ===== AVERTISSEMENT IA ===== */
  .ai-disclaimer {
    display: none;
    margin-top: 1rem;
    background: #fff5f5;
    border: 1.5px solid #f5c0c0;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #7a1a1a;
  }

  .ai-disclaimer.visible {
    display: flex;
  }

  .ai-disclaimer .ai-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
  }

  .ai-disclaimer strong {
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
    color: var(--accent);
  }

  /* ===== FAQ SEO ===== */
  .faq-section {
    background: white;
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem;
  }

  .faq-inner {
    max-width: 900px;
    margin: 0 auto;
  }

  .faq-inner h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.6rem;
    color: var(--ink);
    margin-bottom: 1.8rem;
    position: relative;
    padding-bottom: 0.8rem;
  }

  .faq-inner h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: linear-gradient(to right, var(--ink), var(--accent));
    border-radius: 2px;
  }

  .faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  @media (max-width: 680px) {
    .faq-grid { grid-template-columns: 1fr; }
  }

  .faq-item {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
  }

  .faq-item[open] {
    border-color: var(--ink);
  }

  .faq-item summary {
    padding: 1rem 1.1rem;
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink);
    background: var(--paper);
  }

  .faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: transform 0.2s;
  }

  .faq-item[open] summary::after {
    content: '−';
  }

  .faq-item summary::-webkit-details-marker { display: none; }

  .faq-item p {
    padding: 0.8rem 1.1rem 1rem;
    font-size: 0.87rem;
    line-height: 1.65;
    color: #444;
    border-top: 1px solid var(--border);
    background: white;
  }
