/* =============================================================
   Free ADHD cleaning schedule generator
   Le contenu passe aux blocs pg-*. Le generateur garde un encadrement:
   c'est un formulaire, et le plan qu'il produit est concu pour etre
   imprime (voir le bloc @media print en fin de fichier).
   Toutes les classes .sched-* et .overwhelmed-banner sont ecrites par
   tool-schedule-generator.js: elles doivent rester declarees ici.
   ============================================================= */

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-actions + .discord-cta { margin-top: 18px; }

.btn-sm { min-height: 40px; padding: 8px 14px; font-size: var(--dop-fs-xs); }

/* Respiration entre le corps d'article et le tableau a filets. */
.pg-prose + .pg-table-wrap,
.pg-table-wrap + .pg-prose,
.pg-prose + .pg-list { margin-top: clamp(28px, 3vw, 44px); }

/* ---------- Le generateur ---------- */
.tool-wrap {
  max-width: 900px;
  padding: clamp(26px, 3.4vw, 40px);
  border: 1px solid var(--dop-border-strong);
  border-radius: var(--dop-radius-xl);
}

.tool-form-title {
  margin-bottom: 30px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: var(--dop-tracking-tight);
}

.form-group { margin-bottom: 28px; }

.form-group > label {
  display: block;
  margin-bottom: 12px;
  font-family: var(--dop-font-body);
  font-weight: 700;
  font-size: var(--dop-fs-sm);
  color: var(--dop-ink-1);
}

.label-hint { color: var(--dop-ink-3); font-weight: 500; font-size: var(--dop-fs-xs); }

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.pill-btn {
  padding: 8px 16px;
  border: 1px solid var(--dop-border-strong);
  border-radius: var(--dop-radius-pill);
  background: transparent;
  color: var(--dop-ink-2);
  font-family: var(--dop-font-body);
  font-size: var(--dop-fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--dop-dur), border-color var(--dop-dur), background var(--dop-dur);
}

.pill-btn:hover { color: var(--dop-ink-1); border-color: var(--dop-ink-3); }

.pill-btn[aria-pressed="true"] {
  background: var(--dop-primary-soft);
  border-color: var(--dop-primary);
  color: var(--dop-ink-1);
}

/* Les trois niveaux d'energie gardent leur code couleur semantique:
   c'est une information, pas une decoration. */
.pill-btn.energy-low[aria-pressed="true"] { background: rgba(106, 211, 107, .12); border-color: var(--dop-energy-low); }
.pill-btn.energy-medium[aria-pressed="true"] { background: rgba(255, 207, 92, .12); border-color: var(--dop-energy-mid); }
.pill-btn.energy-high[aria-pressed="true"] { background: rgba(239, 90, 165, .12); border-color: var(--dop-energy-high); }

.btn-generate { width: 100%; margin-top: 8px; font-size: var(--dop-fs-body); padding: 16px 24px; }

/* ---------- Sortie ---------- */
.tool-output.hidden,
.tab-panel.hidden { display: none; }

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--dop-rule);
  margin-bottom: 20px;
}

.output-tabs { display: flex; gap: 8px; }

.output-tab {
  padding: 8px 16px;
  border: 1px solid var(--dop-border-strong);
  border-radius: var(--dop-radius-sm);
  background: transparent;
  color: var(--dop-ink-2);
  font-family: var(--dop-font-display);
  font-size: var(--dop-fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: color var(--dop-dur), border-color var(--dop-dur), background var(--dop-dur);
}

.output-tab.active { background: var(--dop-primary-soft); border-color: var(--dop-primary); color: var(--dop-ink-1); }

.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.no-guilt-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 2px solid var(--dop-primary);
  color: var(--dop-ink-2);
  font-size: var(--dop-fs-sm);
  line-height: var(--dop-lh-normal);
}

.overwhelmed-banner {
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--dop-warning);
  color: var(--dop-ink-2);
  font-size: var(--dop-fs-sm);
  line-height: var(--dop-lh-normal);
}

.overwhelmed-banner strong { color: var(--dop-ink-1); }

/* ---------- Le plan genere ----------
   Il est concu pour etre imprime: on garde les bandeaux roses qui
   servent de reperes sur le papier. */
.sched-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.sched-room-card,
.sched-focus-card,
.sched-day-card {
  border: 1px solid var(--dop-border-strong);
  border-radius: var(--dop-radius-lg);
  overflow: hidden;
}

.sched-room-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--dop-primary);
}

.sched-room-icon { font-size: 18px; line-height: 1; }

.sched-room-name {
  font-family: var(--dop-font-display);
  font-weight: 800;
  font-size: var(--dop-fs-xs);
  letter-spacing: .05em;
  color: #fff;
}

.sched-room-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }

/* Ligne de tache */
.sched-task-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: start;
}

.sched-cb {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--dop-primary);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--dop-dur);
}

.sched-cb[aria-checked="true"] { background: var(--dop-primary); }
.sched-cb[aria-checked="true"]::after { content: '\2713'; }

.sched-task-text {
  grid-column: 2;
  grid-row: 1;
  color: var(--dop-ink-1);
  font-size: var(--dop-fs-xs);
  line-height: 1.45;
}

.sched-task-item.is-done .sched-task-text { text-decoration: line-through; color: var(--dop-ink-3); }

.sched-micro-btn {
  grid-column: 3;
  grid-row: 1;
  margin-top: 1px;
  padding: 0;
  border: 0;
  background: none;
  font-size: var(--dop-fs-xs);
  line-height: 1;
  opacity: .55;
  cursor: pointer;
  transition: opacity var(--dop-dur);
}

.sched-micro-btn:hover { opacity: 1; }

.sched-micro-row {
  grid-column: 2 / 4;
  grid-row: 2;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 0 2px;
  color: var(--dop-ink-2);
  font-size: var(--dop-fs-2xs);
  line-height: 1.5;
}

.sched-micro-row.hidden { display: none; }
.sched-micro-arrow { flex-shrink: 0; color: var(--dop-primary); }
.sched-micro-dur { white-space: nowrap; color: var(--dop-ink-3); font-style: normal; }

/* Encart de rappel */
.sched-focus-header {
  padding: 11px 14px;
  border-bottom: 1px solid var(--dop-border-strong);
  font-family: var(--dop-font-display);
  font-weight: 800;
  font-size: var(--dop-fs-xs);
  letter-spacing: .05em;
}

.sched-focus-list { list-style: none; display: flex; flex-direction: column; gap: 11px; padding: 12px 14px; margin: 0; }

.sched-focus-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--dop-ink-2);
  font-size: var(--dop-fs-xs);
  line-height: 1.45;
}

.sched-focus-list li span { flex-shrink: 0; }

/* Bandeau de bas de plan */
.sched-footer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-radius: var(--dop-radius-lg);
  background: var(--dop-primary);
}

.sched-footer-left { display: flex; flex-direction: column; gap: 2px; }
.sched-footer-left strong { font-family: var(--dop-font-display); font-weight: 800; font-size: var(--dop-fs-body); color: #fff; }
.sched-footer-left span { font-size: var(--dop-fs-xs); color: rgba(255, 255, 255, .84); }
.sched-footer-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sched-xp-label { font-family: var(--dop-font-display); font-weight: 800; font-size: var(--dop-fs-2xs); color: rgba(255, 255, 255, .92); }

.sched-xp-badge {
  padding: 5px 11px;
  border-radius: var(--dop-radius-sm);
  background: var(--dop-warning);
  color: #1a1005;
  font-family: var(--dop-font-display);
  font-weight: 800;
  font-size: var(--dop-fs-xs);
}

/* Vue semaine */
.sched-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 14px; }

.sched-day-card.is-catchup { border-color: var(--dop-warning); }
.sched-day-card.is-prep { border-color: var(--dop-purple); }

.sched-day-header {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--dop-primary);
}

.sched-day-card.is-catchup .sched-day-header { background: rgba(255, 207, 92, .18); }
.sched-day-card.is-prep .sched-day-header { background: rgba(141, 103, 251, .18); }

.sched-day-name {
  font-family: var(--dop-font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .05em;
  color: #fff;
}

.sched-day-card.is-catchup .sched-day-name,
.sched-day-card.is-prep .sched-day-name { color: var(--dop-ink-1); }

.sched-day-badge {
  padding: 1px 5px;
  border-radius: var(--dop-radius-pill);
  background: rgba(255, 255, 255, .16);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, .84);
}

.sched-day-body { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; }
.sched-day-body .sched-task-item { grid-template-columns: 18px 1fr auto; }
.sched-day-body .sched-cb { width: 16px; height: 16px; font-size: 9px; }
.sched-day-body .sched-task-text { font-size: var(--dop-fs-2xs); }
.sched-empty { padding: 4px 0; color: var(--dop-ink-3); font-size: var(--dop-fs-2xs); }

/* ---------- Questions ----------
   Le balisage reste en <button>/<div hidden>: tool-schedule-generator.js
   pilote aria-expanded et aria-controls. On le met simplement au
   registre filete de .pg-faq. */
.faq-list { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--dop-rule); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 22px 4px;
  border: 0;
  background: none;
  color: var(--dop-ink-1);
  font-family: var(--dop-font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: var(--dop-tracking-tight);
  text-align: left;
  cursor: pointer;
}

.faq-chevron { flex-shrink: 0; color: var(--dop-primary); font-size: 12px; transition: transform var(--dop-dur); }
.faq-question[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  max-width: 660px;
  padding: 0 4px 24px;
  color: var(--dop-ink-2);
  font-size: var(--dop-fs-body);
  line-height: var(--dop-lh-relaxed);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) { .sched-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .sched-week-grid { grid-template-columns: repeat(4, 1fr); } }

@media (max-width: 640px) {
  .sched-grid { grid-template-columns: 1fr; }
  .sched-week-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .output-header { flex-direction: column; align-items: stretch; }
  .output-tabs .output-tab { flex: 1; }
}

/* ---------- Impression ----------
   Seul le plan genere part sur le papier: pas de nav, pas d'article.
   Les fonds sont forces en clair, les bandeaux gardent leur couleur. */
.print-title,
.print-source { display: none; }

@media print {
  #tool-output {
    visibility: visible;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: #fff;
  }

  #tool-output * { visibility: visible; }

  .output-header,
  .no-guilt-banner,
  .sched-micro-btn,
  .sched-micro-row { display: none !important; }

  .sched-room-header,
  .sched-day-header,
  .sched-footer-banner,
  .sched-xp-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .sched-room-header { background: #dd4b95 !important; }
  .sched-room-name { color: #fff !important; }
  .sched-room-body { background: #fff !important; }
  .sched-room-card { border: 1px solid #e0e0e0 !important; break-inside: avoid; }

  .sched-focus-card { border: 1px solid #c8b0fb !important; break-inside: avoid; }
  .sched-focus-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: rgba(141, 103, 251, .18) !important; color: #111 !important; }
  .sched-focus-list li { color: #333 !important; }

  .sched-task-text { color: #111 !important; }
  .sched-cb { border-color: #dd4b95 !important; }

  .sched-footer-banner { background: #dd4b95 !important; }
  .sched-footer-left strong { color: #fff !important; }
  .sched-footer-left span { color: rgba(255, 255, 255, .88) !important; }
  .sched-xp-label { color: rgba(255, 255, 255, .92) !important; }
  .sched-xp-badge { background: #ffcf5c !important; color: #1a1005 !important; }

  .sched-week-grid { grid-template-columns: repeat(7, 1fr) !important; gap: 5px !important; }
  .sched-day-card { border: 1px solid #e0e0e0 !important; break-inside: avoid; }
  .sched-day-header { background: #dd4b95 !important; }
  .sched-day-card.is-catchup .sched-day-header { background: rgba(255, 207, 92, .28) !important; }
  .sched-day-card.is-prep .sched-day-header { background: rgba(141, 103, 251, .22) !important; }
  .sched-day-name { color: #fff !important; }
  .sched-day-card.is-catchup .sched-day-name,
  .sched-day-card.is-prep .sched-day-name { color: #111 !important; }
  .sched-day-body { background: #fff !important; }
  .sched-day-body .sched-task-text { color: #111 !important; }

  .overwhelmed-banner { color: #8a6000 !important; }
}

/* Cibles tactiles de 44px: on agrandit la pastille, pas l'espace autour. */
.pill-btn { min-height: 44px; }
