/*
 * theme-2026.css — Système de design « Le Portail TP » (refonte 2026)
 * ---------------------------------------------------------------------
 * Couche de présentation chargée APRÈS style.css (via inc/header.php ou
 * directement dans les pages d'authentification). Elle ne fait que
 * surcharger des jetons (variables CSS) et l'apparence des composants
 * existants (.card, .button, .control, .tp-header, .tp-footer, ...).
 * Aucune classe/identifiant utilisé par le JavaScript n'est renommé.
 *
 * Police : Inter auto-hébergée (css/fonts/) — compatible avec la CSP
 * publique (font-src 'self'), aucune requête vers fonts.googleapis.com.
 */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}

:root {
  /* Marque */
  --tp26-orange: #F39C3D;
  --tp26-orange-600: #E0841F;
  --tp26-orange-700: #B9600A;      /* orange accessible sur fond blanc (≥ 4.5:1) */
  --tp26-orange-50: #FEF4E8;
  --tp26-navy: #0f1b2d;
  --tp26-navy-800: #17263d;
  --tp26-navy-700: #22344f;

  /* Neutres */
  --tp26-bg: #f4f6f9;
  --tp26-surface: #ffffff;
  --tp26-surface-2: #f8fafc;
  --tp26-border: #e3e8ef;
  --tp26-border-strong: #cbd3df;
  --tp26-ink: #0f1b2d;
  --tp26-muted: #5b6b82;

  /* États */
  --tp26-success: #15803d;
  --tp26-success-bg: #ecfdf3;
  --tp26-danger: #b42318;
  --tp26-danger-bg: #fef3f2;
  --tp26-info: #1d4ed8;
  --tp26-info-bg: #eff6ff;

  /* Forme */
  --tp26-radius-sm: 8px;
  --tp26-radius: 12px;
  --tp26-radius-lg: 18px;
  --tp26-shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .05);
  --tp26-shadow: 0 4px 16px rgba(15, 27, 45, .07), 0 1px 3px rgba(15, 27, 45, .05);
  --tp26-shadow-lg: 0 18px 48px rgba(15, 27, 45, .14);
  --tp26-focus: 0 0 0 3px rgba(243, 156, 61, .45);
  --tp26-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

  /* Re-mappage des jetons historiques de style.css */
  --font-sans: var(--tp26-font);
  --page-background: var(--tp26-bg);
  --bg: var(--tp26-bg);
  --surface: var(--tp26-surface);
  --surface-strong: var(--tp26-navy);
  --ink: var(--tp26-ink);
  --muted: var(--tp26-muted);
  --accent: var(--tp26-orange-700);
  --border: var(--tp26-border);
  --border-strong: var(--tp26-border-strong);
  --shadow: var(--tp26-shadow);
  --shadow-strong: var(--tp26-shadow-lg);
  --radius: var(--tp26-radius-lg);
  --shell-width: 1200px;
  --tp-color-primary: var(--tp26-orange-700);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tp26-font);
  color: var(--tp26-ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;

}
img, svg, video { max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.01em; color: var(--tp26-ink); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--tp26-orange-600);
  outline-offset: 2px;
  box-shadow: var(--tp26-focus);
}

/* Tableaux : défilement horizontal confiné au conteneur, jamais à la page */
.page table, .info-table-wrap, .table-wrap { max-width: 100%; }
.info-table-wrap, .table-wrap, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; }
.page th { color: var(--tp26-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* ---------- Composants génériques ---------- */
.card,
.content-box,
.auth-card {
  background: var(--tp26-surface);
  border: 1px solid var(--tp26-border);
  border-radius: var(--tp26-radius-lg);
  box-shadow: var(--tp26-shadow);
}

.control,
body:not(.tp26-compact) .form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body:not(.tp26-compact) .page input[type="text"], body:not(.tp26-compact) .page input[type="email"], body:not(.tp26-compact) .page input[type="password"],
body:not(.tp26-compact) .page input[type="tel"], body:not(.tp26-compact) .page input[type="number"], body:not(.tp26-compact) .page input[type="date"],
body:not(.tp26-compact) .page input[type="search"], body:not(.tp26-compact) .page select, body:not(.tp26-compact) .page textarea {
  font: inherit;
  font-size: 16px;               /* évite le zoom iOS */
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--tp26-border-strong);
  border-radius: var(--tp26-radius);
  background: var(--tp26-surface);
  color: var(--tp26-ink);
  transition: border-color .15s, box-shadow .15s;
}
body:not(.tp26-compact) .page textarea { min-height: 96px; }
.control:focus,
body:not(.tp26-compact) body:not(.tp26-compact) .form input:focus,
body:not(.tp26-compact) .page input:focus, body:not(.tp26-compact) .page select:focus, body:not(.tp26-compact) .page textarea:focus {
  outline: none;
  border-color: var(--tp26-orange-600);
  box-shadow: var(--tp26-focus);
}
body:not(.tp26-compact) :is(.form, .page) label { font-weight: 600; font-size: .9rem; color: var(--tp26-ink); }

.button,
.forgot-btn,
.reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: var(--tp26-radius);
  border: 1px solid var(--tp26-orange);
  background: var(--tp26-orange);
  color: var(--tp26-navy);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .08);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.button:hover, .forgot-btn:hover, .reset-btn:hover {
  background: var(--tp26-orange-600);
  border-color: var(--tp26-orange-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(243, 156, 61, .35);
}
.button:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.alert, .alert-error, .forgot-alert, .reset-alert {
  padding: 12px 14px; border-radius: var(--tp26-radius);
  border: 1px solid #fecdca; background: var(--tp26-danger-bg); color: var(--tp26-danger);
}
.alert-success, .forgot-success {
  padding: 12px 14px; border-radius: var(--tp26-radius);
  border: 1px solid #abefc6; background: var(--tp26-success-bg); color: var(--tp26-success);
}
.info, .forgot-note, .reset-note {
  padding: 12px 14px; border-radius: var(--tp26-radius);
  border: 1px solid #c7d7fe; background: var(--tp26-info-bg); color: var(--tp26-info);
}
.note { color: var(--tp26-muted); font-size: .875rem; }

/* ---------- En-tête partagé ---------- */
.tp-header { margin: 0 0 20px; position: relative; z-index: 20; }
.tp-header__inner { max-width: none; padding: 0; }
.tp-header__container {
  width: 100%;
  border-radius: 0;
  background: var(--tp26-surface);
  border-bottom: 1px solid var(--tp26-border);
  box-shadow: var(--tp26-shadow-sm);
  position: relative;
}
.tp-header__container::after {          /* liseré de marque */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--tp26-orange) 0%, var(--tp26-orange) 30%, transparent 100%);
}
.tp-header__nav {
  max-width: var(--shell-width);
  margin: 0 auto;
  min-height: 72px;
  padding: 6px clamp(10px, 3vw, 24px);
  gap: 8px;
}
.tp-header__left, .tp-header__right { width: 48px; }
.tp-header__logo { height: 56px; margin-bottom: 0; }
.tp-header__brand { flex-direction: row; gap: 12px; }
.tp-header__slogan { font-size: .85rem; color: var(--tp26-muted); font-weight: 500; text-align: left; max-width: 28ch; }
.tp-header__nav-button {
  width: 44px; height: 44px; border-radius: var(--tp26-radius);
  border: 1px solid var(--tp26-border); background: var(--tp26-surface);
}
.tp-header__nav-button:hover { background: var(--tp26-orange-50); border-color: var(--tp26-orange); }
.tp-header__logout-submit { border: 1px solid var(--tp26-border); background: var(--tp26-surface); }
.tp-header__nav-icon { width: 24px; height: 24px; }

@media (max-width: 600px) {
  .tp-header { margin-bottom: 12px; }
  .tp-header__nav { min-height: 60px; }
  .tp-header__logo { height: 42px; }
  .tp-header__slogan { display: none; }
}

/* ---------- Pied de page partagé ---------- */
.tp-footer { margin-top: 32px; }
.tp-footer__inner { max-width: none; }
.tp-footer__container {
  max-width: var(--shell-width);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  border-top: 1px solid var(--tp26-border);
  padding: 20px clamp(12px, 3vw, 24px) 28px;
  color: var(--tp26-muted);
  font-size: .8rem;
}
.tp-footer__value a { color: var(--tp26-muted); font-weight: 600; }
.tp-footer__value a:hover { color: var(--tp26-orange-700); }
.tp-footer__logo { max-height: 40px; width: auto; }
.tp-footer__certification { gap: 10px; color: var(--tp26-muted); font-size: .75rem; }
@media (max-width: 600px) {
  .tp-footer__section { flex: 1 1 100%; }
}

/* ---------- Conteneur de page ---------- */
.page { width: 100%; max-width: var(--shell-width); padding: 8px clamp(12px, 3.5vw, 32px) 32px; }

/* ---------- Tableau de bord ---------- */
.tp-dashboard-page .tp-dashboard {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0 clamp(12px, 3.5vw, 32px);
  gap: 20px;
}
.tp-dashboard .content-box { padding: 0; overflow: hidden; }
.tp-dashboard .content-box__header { padding: 16px 20px; border-bottom: 1px solid var(--tp26-border); background: var(--tp26-surface); }
.tp-dashboard .content-box__heading { font-size: 1.05rem; font-weight: 700; margin: 0; }
.tp-dashboard .content-box__body { padding: 16px 20px 20px; }
.tp-dashboard .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 12px;
}
.tp-dashboard .tool-card {
  border: 1px solid var(--tp26-border);
  border-radius: var(--tp26-radius);
  background: var(--tp26-surface);
  box-shadow: none;
  min-height: 76px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tp-dashboard .tool-card:hover {
  border-color: var(--tp26-orange);
  box-shadow: 0 8px 22px rgba(15, 27, 45, .08);
  transform: translateY(-2px);
}
.tp-dashboard .tool-card__title { color: var(--tp26-ink); font-weight: 650; }
.tp-dashboard .tool-card__description { color: var(--tp26-muted); }
.tp-dashboard .tool-card__arrow { color: var(--tp26-orange-700); }
.dashboard__greeting { color: var(--tp26-ink); }

/* =====================================================================
 * Pages d'authentification (login, mot de passe oublié, réinitialisation,
 * session invalidée, accès refusé)
 * ===================================================================== */
body.layout-auth,
body.tp26-auth {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(243, 156, 61, .14), transparent 60%),
    var(--tp26-bg);
}
body.layout-auth > .tp-header, body.layout-auth > .tp-footer { width: 100%; }

.tp26-auth-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px) clamp(12px, 4vw, 32px);
}

/* Carte simple centrée (forgot/reset/session/refus) */
.tp26-auth-card,
.forgot-shell,
.reset-shell {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 36px);
  background: var(--tp26-surface);
  border: 1px solid var(--tp26-border);
  border-radius: var(--tp26-radius-lg);
  box-shadow: var(--tp26-shadow-lg);
}
.tp26-auth-card h1, .forgot-shell h1, .reset-shell h1 { font-size: 1.5rem; margin: 0 0 8px; }
.tp26-auth-card .tp26-lead { color: var(--tp26-muted); margin: 0 0 20px; }
.forgot-form, .reset-form { display: grid; gap: 16px; }
.forgot-form label, .reset-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.forgot-form input, .reset-form input {
  font: inherit; font-size: 16px; min-height: 46px; background: var(--tp26-surface);
  border: 1px solid var(--tp26-border-strong); border-radius: var(--tp26-radius);
}
.forgot-form input:focus, .reset-form input:focus { outline: none; border-color: var(--tp26-orange-600); box-shadow: var(--tp26-focus); }
.forgot-btn, .reset-btn, .tp26-auth-card .button { width: 100%; }

.tp26-icon-badge {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--tp26-orange-50); color: var(--tp26-orange-700);
  font-size: 22px; font-weight: 700; margin-bottom: 14px;
}
.tp26-icon-badge--danger { background: var(--tp26-danger-bg); color: var(--tp26-danger); }
.tp26-back-link { display: inline-block; margin-top: 16px; font-size: .9rem; color: var(--tp26-orange-700); font-weight: 600; }
.tp26-back-link:hover { text-decoration: underline; }

/* Connexion : mise en page scindée */
.tp26-login {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.tp26-login__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background:
    radial-gradient(800px 500px at 0% 100%, rgba(243, 156, 61, .28), transparent 60%),
    radial-gradient(600px 400px at 100% 0%, rgba(59, 130, 246, .18), transparent 60%),
    linear-gradient(160deg, var(--tp26-navy-800) 0%, var(--tp26-navy) 70%);
}
.tp26-login__brand::before {            /* trame « carte » discrète */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
}
.tp26-login__brand > * { position: relative; }
.tp26-login__wordmark { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.tp26-login__wordmark-dot {
  width: 36px; height: 36px; border-radius: 10px; background: var(--tp26-orange);
  display: grid; place-items: center; color: var(--tp26-navy); font-weight: 800;
}
.tp26-login__wordmark small { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .08em; opacity: .7; text-transform: uppercase; }
.tp26-login__headline { font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; color: #fff; font-weight: 750; }
.tp26-login__headline em { font-style: normal; color: var(--tp26-orange); }
.tp26-login__tagline { margin: 0; max-width: 46ch; color: rgba(255,255,255,.75); }
.tp26-login__features { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.tp26-login__features li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.85); font-size: .95rem; }
.tp26-login__features li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tp26-orange); flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(243,156,61,.2);
}
.tp26-login__muni {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--tp26-radius);
  background: rgba(255,255,255,.96); color: var(--tp26-ink); max-width: 420px;
}
.tp26-login__muni img { height: 52px; width: auto; max-width: 160px; object-fit: contain; }
.tp26-login__muni span { font-size: .9rem; font-weight: 600; color: var(--tp26-muted); }

.tp26-login__panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 56px) clamp(14px, 4vw, 48px);
  background: var(--tp26-surface);
}
.tp26-login__panel .auth-card {
  width: min(420px, 100%);
  border: 0; box-shadow: none; padding: 0; background: transparent;
}
.tp26-login__panel .auth-card__logo { width: 168px; margin: 0 0 28px; }
.tp26-login__panel .auth-card h1 { font-size: 1.75rem; font-weight: 750; margin: 0 0 6px; }
.tp26-login__panel .auth-card > p { color: var(--tp26-muted); margin-bottom: 22px; }
.tp26-login__panel .alert, .tp26-login__panel .info { margin-bottom: 16px; }
.tp26-login__panel .form { gap: 16px; }
.tp26-login__panel #login-submit { width: 100%; margin-top: 4px; }
.tp26-login__links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tp26-login__links a { color: var(--tp26-orange-700); }
.tp26-login__links a:hover { text-decoration: underline; }
.tp26-login__panel .auth-card__certification {
  justify-content: flex-start; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--tp26-border); font-size: .75rem; color: var(--tp26-muted);
}
.tp26-login__panel .auth-card__quebec-logo { width: 72px; }
.tp26-login__mobile-brand { display: none; }

@media (max-width: 900px) {
  .tp26-login { grid-template-columns: 1fr; min-height: 0; }
  .tp26-login__brand { display: none; }
  .tp26-login__panel { background: transparent; justify-content: flex-start; padding-top: 28px; }
  .tp26-login__panel .auth-card {
    background: var(--tp26-surface); border: 1px solid var(--tp26-border);
    border-radius: var(--tp26-radius-lg); box-shadow: var(--tp26-shadow-lg);
    padding: clamp(20px, 6vw, 32px);
  }
  .tp26-login__panel .auth-card__logo { margin: 0 auto 20px; width: 150px; }
  .tp26-login__mobile-brand {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin: 0 0 16px; color: var(--tp26-muted); font-size: .85rem; text-align: center;
  }
  .tp26-login__mobile-brand img { height: 36px; width: auto; }
}

/* Accès refusé */
.refuse-wrap {
  width: min(640px, calc(100% - 24px));
  margin: clamp(24px, 8vh, 72px) auto;
  padding: clamp(22px, 5vw, 36px);
  background: var(--tp26-surface);
  border: 1px solid var(--tp26-border);
  border-top: 4px solid var(--tp26-danger);
  border-radius: var(--tp26-radius-lg);
  box-shadow: var(--tp26-shadow-lg);
}
.refuse-title { color: var(--tp26-danger); font-size: 1.5rem; }
.refuse-text, .refuse-meta { color: var(--tp26-ink); }
.refuse-wrap .btn-close, .refuse-wrap .btn-dashboard {
  background: var(--tp26-navy); border-color: var(--tp26-navy); color: #fff;
}
.refuse-wrap .btn-close:hover, .refuse-wrap .btn-dashboard:hover { background: var(--tp26-navy-700); border-color: var(--tp26-navy-700); box-shadow: none; }
.refuse-wrap .auth-pill { background: var(--tp26-orange-50); color: var(--tp26-orange-700); }

/* Règles de mot de passe */
.password-rules { border-radius: var(--tp26-radius); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Cartes : liseré latéral bleu historique remplacé par un accent de marque discret */
.card::after { width: 3px; background: var(--tp26-orange); opacity: .9; }
.card::before { background: linear-gradient(135deg, rgba(243, 156, 61, .06), transparent 60%); }
.auth-card::after, .auth-card::before, .tp26-auth-card::after { display: none; }
.auth-card > p { margin: 0 0 18px; }

/* Bandeau d'accueil du tableau de bord */
.tp-dashboard .dashboard__hero {
  background: linear-gradient(120deg, var(--tp26-navy) 0%, var(--tp26-navy-700) 70%, #5a3a17 100%);
  color: #fff;
  border-radius: var(--tp26-radius-lg);
  box-shadow: var(--tp26-shadow);
  border: 0;
}
.tp-dashboard .dashboard__greeting, .tp-dashboard .dashboard__greeting strong { color: #fff; }
.tp-dashboard .dashboard__greeting strong { color: var(--tp26-orange); }

/* =====================================================================
 * STAGE 2 — Pages internes, cartes, formulaires iframe, tableau de bord
 * ===================================================================== */

/* ---------- Boutons historiques (.btn-*) : variantes conservées ---------- */
.btn { border-radius: var(--tp26-radius); font-family: inherit; min-height: 42px; cursor: pointer; }
.btn-primary { background: var(--tp26-orange); color: var(--tp26-navy); border-color: var(--tp26-orange); box-shadow: var(--tp26-shadow-sm); }
.btn-primary:hover { background: var(--tp26-orange-600); }
.btn-secondary { background: var(--tp26-navy); color: #fff; border-color: var(--tp26-navy); box-shadow: var(--tp26-shadow-sm); }
.btn-secondary:hover { background: var(--tp26-navy-700); }
.btn-amber { background: var(--tp26-orange-50); color: var(--tp26-orange-700); border-color: #f8cf9f; box-shadow: none; }
.btn-ghost { background: var(--tp26-surface); color: var(--tp26-ink); border-color: var(--tp26-border-strong); }
.btn-danger { background: var(--tp26-danger); color: #fff; border-color: var(--tp26-danger); box-shadow: none; }
.btn span { color: inherit; opacity: .85; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15, 27, 45, .12); }

.req-button, .projet-button {
  border-radius: var(--tp26-radius); min-height: 42px; font-family: inherit; font-weight: 650;
  background: var(--tp26-orange); border-color: var(--tp26-orange); color: var(--tp26-navy);
}
.req-button:hover, .projet-button:hover { background: var(--tp26-orange-600); border-color: var(--tp26-orange-600); color: var(--tp26-navy); }
.req-button--secondary, .projet-button--secondary { background: var(--tp26-surface); color: var(--tp26-ink); border: 1px solid var(--tp26-border-strong); }
.req-button--secondary:hover, .projet-button--secondary:hover { background: var(--tp26-surface-2); border-color: var(--tp26-orange); color: var(--tp26-ink); }
.req-button--ghost { background: transparent; color: var(--tp26-ink); border-color: var(--tp26-border); }
.projet-button--active, .projet-button--active:hover { background: var(--tp26-navy); border-color: var(--tp26-navy); color: #fff; }
.projet-button--danger, .projet-button--danger:hover { background: var(--tp26-danger); border-color: var(--tp26-danger); color: #fff; }

/* ---------- Coquilles de page internes ---------- */
:is(.page, .projet-page, .req-page, .account-shell, .online-shell, main.tp-dashboard) {
  width: 100%;
  max-width: var(--shell-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(12px, 3.5vw, 32px);
  padding-right: clamp(12px, 3.5vw, 32px);
  box-sizing: border-box;
}
body.projet-body { background: var(--tp26-bg); }
:is(.req-card, .projet-card, .content-box, .account-card, .online-card, .panel) {
  background: var(--tp26-surface);
  border: 1px solid var(--tp26-border);
  border-radius: var(--tp26-radius-lg);
  box-shadow: var(--tp26-shadow);
}
.projet-card--danger { border-color: #fecdca; }
:is(.req-card__header, .projet-card__header) { border-bottom: 1px solid var(--tp26-border); }
:is(.req-card__title, .projet-card__title, .req-section__title, .content-box__heading) { color: var(--tp26-ink); font-weight: 700; letter-spacing: -0.01em; }
.req-section__title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tp26-muted); }
:is(.req-kv__label, .projet-kv__label, .details-label, .smtp-label) { color: var(--tp26-muted); font-size: .8rem; font-weight: 600; }
:is(.req-kv__value, .projet-kv__value, .details-value) { color: var(--tp26-ink); }
:is(.req-alert, .projet-alert) { border-radius: var(--tp26-radius); }
.badge { border-radius: 999px; font-weight: 600; font-size: .75rem; padding: 3px 10px; }
.muted, .req-note, .smtp-help, .req-subtitle { color: var(--tp26-muted); }

/* Champs : uniquement dans les pages internes (pas dans les iframes .marker-form) */
:is(.projet-page, .req-page, .account-shell, .online-shell, main.tp-dashboard)
  :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
      input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea),
.smtp-input {
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--tp26-border-strong);
  border-radius: var(--tp26-radius);
  background: var(--tp26-surface);
  color: var(--tp26-ink);
}
:is(.projet-page, .req-page, .account-shell, .online-shell, main.tp-dashboard) :is(input, select, textarea):focus,
.smtp-input:focus { outline: none; border-color: var(--tp26-orange-600); box-shadow: var(--tp26-focus); }
:is(.req-form-grid--two, .req-form-grid--three) { gap: 14px; }
@media (max-width: 720px) {
  :is(.req-form-grid--two, .req-form-grid--three) { grid-template-columns: 1fr !important; }
  :is(.req-actions, .actions, .projet-actions) { flex-wrap: wrap; }
  :is(.req-actions, .projet-actions) > :is(a, button) { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Tableaux (historique, utilisateurs, journaux, en ligne, info) ---------- */
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--tp26-border);
  border-radius: var(--tp26-radius);
  background: var(--tp26-surface);
}
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) table { width: 100%; border-collapse: collapse; }
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) :is(th, td) {
  padding: 11px 14px; border-bottom: 1px solid var(--tp26-border); text-align: left; vertical-align: top;
}
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) th {
  background: var(--tp26-surface-2); color: var(--tp26-muted);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; white-space: nowrap;
}
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) tbody tr:hover td { background: #fffaf3; }
:is(.table-wrap, .online-table-wrap, .info-table-wrap, .req-table-wrap, .projet-table-wrap) tbody tr:last-child td { border-bottom: 0; }

/* ---------- Mises à jour (timeline) ---------- */
.updates-date-group { border-left: 2px solid var(--tp26-border); padding-left: 16px; position: relative; }
.updates-date-group::before {
  content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--tp26-orange); box-shadow: 0 0 0 4px var(--tp26-orange-50);
}
.updates-version { color: var(--tp26-orange-700); font-weight: 700; }
@media (max-width: 720px) {
  .updates-date-group { display: block !important; }
  .updates-date-column, .updates-content-column { width: auto !important; max-width: 100% !important; }
}

/* ---------- Tableau de bord : mise en page avec barre latérale ---------- */
body.tp26-has-sidebar .tp-header { margin-bottom: 0; }
.tp26-app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
  align-items: start;
}
.tp26-sidebar {
  position: sticky; top: 0;
  max-height: 100vh; overflow-y: auto;
  padding: 18px 12px 28px;
  background: var(--tp26-surface);
  border-right: 1px solid var(--tp26-border);
  align-self: stretch;
}
.tp26-nav { display: flex; flex-direction: column; gap: 2px; }
.tp26-nav__section {
  margin: 16px 10px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #8a97ab;
}
.tp26-nav__link {
  display: flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 8px 10px; border-radius: 10px;
  color: var(--tp26-ink); font-size: .92rem; font-weight: 500; line-height: 1.25;
}
.tp26-nav__link:hover { background: var(--tp26-surface-2); }
.tp26-nav__link.is-active { background: var(--tp26-orange-50); color: var(--tp26-orange-700); font-weight: 650; box-shadow: inset 3px 0 0 var(--tp26-orange); }
.tp26-nav__icon { width: 22px; text-align: center; flex: 0 0 22px; font-size: 1rem; }
.tp26-app__main { min-width: 0; padding: 24px 0 8px; }
body.tp26-has-sidebar .tp-dashboard { max-width: 1160px; }
body.tp26-has-sidebar .tp-footer { margin-top: 0; }

.tp26-menu-toggle {
  display: none;
  align-items: center; gap: 10px;
  margin: 10px clamp(12px, 3.5vw, 32px) 0;
  min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--tp26-border-strong); border-radius: var(--tp26-radius);
  background: var(--tp26-surface); color: var(--tp26-ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
.tp26-menu-toggle__bars, .tp26-menu-toggle__bars::before, .tp26-menu-toggle__bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.tp26-menu-toggle__bars::before, .tp26-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.tp26-menu-toggle__bars::before { top: -6px; }
.tp26-menu-toggle__bars::after { top: 6px; }
.tp26-sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 27, 45, .45); z-index: 59; }
.tp26-sidebar-backdrop[hidden] { display: none; }

@media (max-width: 1024px) {
  .tp26-app { grid-template-columns: 1fr; }
  .tp26-menu-toggle { display: inline-flex; }
  .tp26-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
    width: min(300px, 86vw); max-height: none;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: var(--tp26-shadow-lg); visibility: hidden;
  }
  body.tp26-sidebar-open .tp26-sidebar { transform: none; visibility: visible; }
  body.tp26-sidebar-open { overflow: hidden; }
  .tp26-app__main { padding-top: 12px; }
}

/* Contenu du tableau de bord */
.tp-dashboard .content-box__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tp-dashboard .content-box__title { display: flex; align-items: center; gap: 10px; }
.tp-dashboard .content-box__icon { color: var(--tp26-orange-700); width: 22px; height: 22px; }
.tp-dashboard .content-box__badge { background: var(--tp26-navy); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .72rem; font-weight: 700; }
.tp-dashboard .tool-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.tp-dashboard .tool-card::before { display: none; }
.tp-dashboard .tool-card__badge {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: var(--tp26-surface-2); border: 1px solid var(--tp26-border);
}
.tp-dashboard .tool-card__badge img { width: 26px; height: 26px; object-fit: contain; }
.tp-dashboard .tool-card__content { flex: 1 1 auto; min-width: 0; }
.tp-dashboard .tool-card__title { margin: 0 0 2px; font-size: .95rem; }
.tp-dashboard .tool-card__description { margin: 0; font-size: .8rem; line-height: 1.35; }
.tp-dashboard .dashboard__bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.tp-dashboard :is(.user-tools, .info-tools) { display: grid; gap: 10px; }
.tp-dashboard .user-profile { padding: 14px 20px 0; }
.tp-dashboard .user-profile__name { font-weight: 700; color: var(--tp26-ink); font-size: 1.05rem; }
.tp-dashboard .user-profile__role { color: var(--tp26-muted); font-size: .85rem; }
.tp-dashboard .dashboard__hero { padding: 22px clamp(18px, 3vw, 28px); }
.tp-dashboard .dashboard__hero-content { text-align: left; }
.tp-dashboard .dashboard__greeting { font-size: clamp(1.15rem, 2.4vw, 1.5rem); display: block; }

/* ---------- Pages de cartes (chrome autour de Google Maps) ---------- */
body.map-page { font-family: var(--tp26-font); }
.map-page :is(.map-menu__title, .map-menu__home, .map-menu__locate, .map-menu__layer, .map-bug-report, .map-help-link) {
  border-radius: var(--tp26-radius);
  box-shadow: 0 2px 10px rgba(15, 27, 45, .18);
}
.map-page .map-menu__title { background: var(--tp26-navy); color: #fff; font-weight: 650; }
.map-page :is(.map-menu__home, .map-menu__locate, .map-menu__layer, .map-bug-report, .map-help-link) { background: #fff; border: 1px solid var(--tp26-border); }
.map-page :is(.map-menu__home, .map-menu__locate, .map-menu__layer, .map-bug-report, .map-help-link):hover { border-color: var(--tp26-orange); }
.map-page :is(.map-menu__home, .map-menu__locate) { min-width: 44px; min-height: 44px; }

/* ---------- Formulaires en iframe (form/*) : compacts, sans gonflement ---------- */
body.marker-form, body.photo-capture, body.photo-gallery { font-family: var(--tp26-font); }
body.tp26-compact :is(input[type="text"], input[type="number"], input[type="date"], input[type="email"], select, textarea) {
  border-radius: var(--tp26-radius-sm);
  border-color: var(--tp26-border-strong);
}
body.tp26-compact :is(input, select, textarea):focus { outline: none; border-color: var(--tp26-orange-600); box-shadow: var(--tp26-focus); }
body.tp26-compact .button { min-height: 40px; padding: 8px 16px; }

/* Formulaires iframe : on neutralise les tailles « confort » des pages internes */
body.tp26-compact .button { min-height: 38px; padding: 8px 14px; }
body.tp26-compact { line-height: 1.4; }
.gm-style img, .gm-style svg { max-width: none; }

/* ---------- Portail citoyen (publique/index.php, formulaires publics) ---------- */
body.req-public-shell { background: radial-gradient(1000px 500px at 100% -10%, rgba(243,156,61,.12), transparent 60%), var(--tp26-bg); }
.req-public-header {
  background: var(--tp26-surface);
  border-bottom: 1px solid var(--tp26-border);
  box-shadow: var(--tp26-shadow-sm);
  position: relative;
}
.req-public-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--tp26-orange), transparent); }
.req-public-brand { max-width: 1000px; margin: 0 auto; padding: 12px clamp(12px, 4vw, 28px); display: flex; align-items: center; gap: 14px; }
.req-public-brand img { height: 52px; width: auto; max-width: 150px; object-fit: contain; }
.req-public-brand__title { font-weight: 750; color: var(--tp26-ink); font-size: clamp(1rem, 2.6vw, 1.2rem); }
.req-public-brand__subtitle { color: var(--tp26-muted); font-size: .85rem; }
.req-page--public { max-width: 1000px; }
.req-hero { background: linear-gradient(120deg, var(--tp26-navy), var(--tp26-navy-700)); color: #fff; border-radius: var(--tp26-radius-lg); padding: clamp(18px, 4vw, 28px); border: 0; }
.req-hero .req-title { color: #fff; }
.req-hero .req-subtitle { color: rgba(255,255,255,.78); }
.req-hero__eyebrow { color: var(--tp26-orange); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }

/* Correctifs de débordement mobile (grilles à piste unique) */
.req-grid, .projet-grid { min-width: 0; }
.req-grid > *, .projet-grid > *, .req-card, .projet-card { min-width: 0; max-width: 100%; }
@media (max-width: 720px) {
  .req-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
/* Barre latérale : colonne blanche pleine hauteur sur grand écran */
@media (min-width: 1025px) {
  .tp26-app { background: linear-gradient(90deg, var(--tp26-surface) 263px, var(--tp26-border) 263px, var(--tp26-border) 264px, transparent 264px); }
  .tp26-sidebar { height: 100vh; border-right: 0; align-self: start; }
}

/* Formulaires iframe : boutons d'action toujours visibles (pied collant) */
body.tp26-compact .marker-form__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--panel-bg, #fff);
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--tp26-border);
  box-shadow: 0 -6px 12px rgba(15, 27, 45, .06);
}
