/* ============================================================
   CALCULATEURPLEX.COM — pages.css
   Styles partagés des pages secondaires
   (forfaits, connexion, inscription, faq, blogue, dashboard,
    baromètre, guide, glossaire, légal)
   ============================================================ */

/* ── En-tête de page ─────────────────────────────────────── */
.page-shell { padding-top: 76px; min-height: 100vh; background: var(--bg); }
.page-hero {
  position: relative; overflow: hidden;
  padding: 72px 24px 48px; text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg2), var(--bg));
}
.page-hero .section-eyebrow { margin-bottom: 12px; }
.page-hero h1 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(30px, 4vw, 50px); line-height: 1.1; margin: 0 auto;
  max-width: 760px;
}
.page-hero p {
  font-size: 16px; color: var(--text2);
  max-width: 620px; margin: 16px auto 0; line-height: 1.7;
}
.page-body { max-width: 1080px; margin: 0 auto; padding: 56px 24px 90px; }
.page-narrow { max-width: 760px; }

/* ── Fil d'Ariane ────────────────────────────────────────── */
.crumbs { font-size: 13px; color: var(--text3); margin-bottom: 20px; }
.crumbs a { color: var(--text2); }
.crumbs a:hover { color: var(--accent); }

/* ── Contenu éditorial (légal, guide, articles) ──────────── */
.prose { font-size: 15px; color: var(--text2); line-height: 1.8; }
.prose h2 {
  font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700;
  color: var(--text); margin: 38px 0 14px;
}
.prose h3 {
  font-family: 'Fraunces', serif; font-size: 18px; font-weight: 700;
  color: var(--text); margin: 26px 0 10px;
}
.prose p { margin-bottom: 16px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.prose .updated { font-size: 13px; color: var(--text3); font-style: italic; }

/* ── Cartes / panneaux génériques ────────────────────────── */
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 28px;
}
.panel + .panel { margin-top: 16px; }

/* ── Champs de formulaire ────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text2); }
.field input, .field select, .field textarea {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--r); padding: 12px 14px;
  color: var(--text); font-size: 14px; font-family: 'DM Sans', sans-serif;
  transition: border-color .2s; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--text3); }
.btn-block { width: 100%; justify-content: center; }

/* ── Authentification ────────────────────────────────────── */
.auth-shell {
  min-height: 100vh; padding: 96px 24px 64px;
  display: flex; align-items: center; justify-content: center; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--r-lg); padding: 36px 32px; box-shadow: var(--shadow);
}
.auth-card h1 { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 900; text-align: center; }
.auth-card .auth-sub { font-size: 14px; color: var(--text2); text-align: center; margin: 8px 0 26px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border-radius: var(--r);
  background: #fff; color: #1f2937; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: opacity .2s; margin-bottom: 18px;
}
.btn-google:hover { opacity: .9; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text3); font-size: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; font-size: 13px; color: var(--text2); margin-top: 20px; }
.auth-foot a { color: var(--accent); font-weight: 500; }

/* ── FAQ (accordéon) ─────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 22px; color: var(--text); font-size: 15px; font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq-q .faq-chevron { color: var(--accent); transition: transform .2s; flex-shrink: 0; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 22px 20px; font-size: 14px; color: var(--text2); line-height: 1.7; }
.faq-item.open .faq-a { max-height: 400px; }

/* ── Blogue ──────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.blog-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px; transition: all .25s;
  display: flex; flex-direction: column;
}
.blog-card:hover { border-color: rgba(63,165,53,.25); transform: translateY(-4px); }
.blog-tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(63,165,53,.1); padding: 3px 10px; border-radius: 99px; margin-bottom: 14px;
}
.blog-card h3 { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.blog-card p { font-size: 13.5px; color: var(--text2); line-height: 1.6; flex: 1; }
.blog-meta { font-size: 12px; color: var(--text3); margin-top: 16px; }

/* ── Tableau de bord ─────────────────────────────────────── */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.dash-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.dash-stat .ds-num { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 900; }
.dash-stat .ds-lbl { font-size: 12.5px; color: var(--text3); margin-top: 4px; }
.dash-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th {
  text-align: left; padding: 14px 20px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text3);
  background: var(--card2); border-bottom: 1px solid var(--border);
}
.dash-table td { padding: 14px 20px; font-size: 14px; border-bottom: 1px solid var(--line-faint); }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--hover-nav); }
.pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pill.bon { background: rgba(63,165,53,.15); color: var(--accent); }
.pill.moyen { background: rgba(245,158,11,.15); color: var(--gold); }
.pill.mauvais { background: rgba(239,68,68,.15); color: var(--red); }
.empty-dash { text-align: center; padding: 60px 24px; color: var(--text2); }

.dash-section { margin-top: 40px; }
.dash-section-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.dash-section-desc { font-size: 14px; color: var(--text2); margin-bottom: 16px; }
.achats-ref {
  font-size: 12px;
  color: var(--text3);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  word-break: break-all;
}
.achats-ref-cell { max-width: 140px; }
.achats-ref-cell code.achats-ref {
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── Glossaire ───────────────────────────────────────────── */
.gloss-search { max-width: 480px; margin: 0 auto 36px; }
.gloss-list { display: flex; flex-direction: column; gap: 14px; }
.gloss-term {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 24px;
}
.gloss-term h3 { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.gloss-term p { font-size: 14px; color: var(--text2); line-height: 1.7; }

/* ── Centre de page (CTA) ────────────────────────────────── */
.page-cta { text-align: center; margin-top: 48px; }

/* ── Messages d'authentification ─────────────────────────── */
.auth-msg {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.auth-msg.info    { background: rgba(120,120,120,.08); color: var(--text2); }
.auth-msg.success { background: rgba(63,165,53,.10);  color: #3FA535; border-color: rgba(63,165,53,.35); }
.auth-msg.warn    { background: rgba(234,179,8,.10);  color: #a16207; border-color: rgba(234,179,8,.35); }
.auth-msg.error   { background: rgba(239,68,68,.10);  color: #b91c1c; border-color: rgba(239,68,68,.35); }

.dash-greeting {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dash-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  .dash-table { min-width: 640px; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .btn-google {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
}
