/* AIGuard control plane — backoffice styles.
 * Single CSS file, vanilla, dark/light auto, no framework. Edit freely. */

/* Design tokens (palette light + dark) live in css/theme.css, loaded BEFORE
   this file. This file holds only component rules referencing var(--token). */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font: 14px/1.5 -apple-system, system-ui, "Segoe UI", "Inter", sans-serif;
  color: var(--fg);
  background: var(--bg);
}

/* --- layout --- */
header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.brand-logo { width: 28px; height: 28px; display: block; flex: 0 0 auto; }
header .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
header .who { color: var(--fg-muted); font-size: 12px; }
/* iOS-style toggle switch */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--line); border-radius: 26px; transition: 0.2s;
}
.switch .slider:before {
  position: absolute; content: ""; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent, #2a8a4f); }
.switch input:checked + .slider:before { transform: translateX(24px); }

.callout-update {
  border-left: 3px solid #c83232;
  background: rgba(200, 50, 50, 0.08);
  padding: 10px 14px;
  margin: 0 0 12px;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
}

.update-badge {
  display: inline-block;
  background: #c83232;
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--row, rgba(127,127,127,0.08));
  color: var(--fg-muted);
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
}
.help-icon:hover { color: var(--fg); border-color: var(--fg-muted); }

/* --- help page ---------------------------------------------------------- */
.help-page { max-width: 900px; line-height: 1.6; }
.help-page h1 { font-size: 24px; margin: 0 0 6px; }
.help-page > p.muted { margin: 0 0 28px; }
.help-page section { margin-bottom: 32px; }
.help-page section h2 {
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-muted); margin: 0 0 12px; font-weight: 600;
}
.help-page p { margin: 0 0 12px; }
.help-list { padding-left: 20px; margin: 0 0 12px; }
.help-list li { margin-bottom: 8px; }
.help-page .callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 10px 14px;
  margin: 12px 0 0;
  border-radius: 0 4px 4px 0;
}
.help-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.help-table th, .help-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.help-table th { font-weight: 600; color: var(--fg-muted); background: rgba(127,127,127,0.04); }
.badge-action {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-action.alert { background: #fff4d6; color: #8a5a00; }
.badge-action.substitute { background: #d8ebff; color: #1a4a8a; }
.badge-action.block { background: #ffd6d6; color: #8a1a1a; }
@media (prefers-color-scheme: dark) {
  .badge-action.alert { background: #3a2e10; color: #f0c674; }
  .badge-action.substitute { background: #102a40; color: #7fb3e6; }
  .badge-action.block { background: #401414; color: #f08080; }
}
.help-faq dt { font-weight: 600; margin-top: 14px; }
.help-faq dd { margin: 4px 0 0; color: var(--fg-muted); }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
section { margin-bottom: 32px; }
section h2 {
  font-size: 12px;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  font-weight: 600;
}

/* --- tables --- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--fg-muted); }
tbody tr:hover { background: rgba(127, 127, 127, 0.05); }

/* --- forms --- */
button, .btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
}
button:hover, .btn:hover { background: rgba(127, 127, 127, 0.08); }
button.primary, .btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

input, textarea, select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: inherit;
  border-radius: 6px;
  font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- utilities --- */
.row { display: flex; gap: var(--space); align-items: center; flex-wrap: wrap; }
.row.tight { gap: 4px; }
.row.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: var(--space); }
.hidden { display: none !important; }
.muted { color: var(--fg-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 12px; }
.flag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
}
pre {
  background: rgba(127, 127, 127, 0.08);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
  border: 1px solid var(--line);
}

/* --- login card --- */
.login-card {
  max-width: 380px;
  margin: 80px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
}
.login-card h1 { margin: 0 0 18px; font-size: 18px; text-align: center; }
.login-card .col { gap: 12px; }
.login-card input { padding: 10px 12px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

/* --- responsive --- */
@media (max-width: 640px) {
  main { padding: 12px; }
  header { padding: 12px; }
  table { font-size: 12px; }
  /* Landing / home — fully responsive on phones. */
  .landing { margin: 24px auto; }
  .landing-hero { padding: 8px 4px 28px; }
  .landing-hero h1 { font-size: 26px; }
  .landing-hero .lead { font-size: 15px; }
  .hero-logo { width: 72px; height: 72px; margin-bottom: 16px; }
  .landing a.btn { padding: 11px 20px; }
  .landing-hero .row { gap: 10px; }
}

/* --- topnav links --- */
.topnav-links { display: flex; gap: 6px; margin-left: 16px; }
.topnav-links a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
}
.topnav-links a:hover { background: rgba(127,127,127,0.08); }
.topnav-links a.active {
  background: var(--accent);
  color: var(--accent-fg);
}

/* --- views (router) --- */
.view { display: block; }
.view.hidden { display: none !important; }

/* --- landing --- */
.landing {
  max-width: 1140px;
  margin: 50px auto;
  padding: 0 20px;
}
.landing-hero {
  text-align: center;
  padding: 30px 20px 16px;
}
.hero-logo {
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 8px 20px rgba(34, 148, 96, 0.28));
}
.landing-hero h1 {
  font-size: 36px;
  margin: 0 0 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.landing-hero .lead {
  max-width: 700px;
  margin: 0 auto;
  color: var(--fg-muted);
  font-size: 16px;
}
.landing a.btn { padding: 10px 22px; font-size: 15px; text-decoration: none; }
.landing a.btn.primary { background: var(--accent); color: var(--accent-fg); }
/* Center the hero CTA buttons (Démarrer l'essai / Se connecter). */
.landing-hero .row { justify-content: center; }

/* --- plans grid --- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.plan-card.current { border-color: var(--accent); }
.plan-name { font-weight: 600; font-size: 16px; }
.plan-price { font-size: 28px; font-weight: 700; }
.plan-price .muted { font-size: 14px; font-weight: 400; }
.plan-card .btn { margin-top: 8px; text-decoration: none; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- card-narrow (signup, verify, etc) --- */
.card-narrow {
  max-width: 440px;
  margin: 60px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
}
.card-narrow h1 { margin: 0 0 12px; font-size: 22px; }
.card-narrow .col { gap: 8px; }
.card-narrow label { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }
.card-narrow input, .card-narrow select { padding: 10px 12px; }
.dev-link {
  margin-top: 16px;
  padding: 12px;
  background: rgba(127,127,127,0.06);
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 12px;
  word-break: break-all;
}

/* --- info card --- */
.card {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
}

/* --- subscription status badges --- */
.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.status-trialing { background: rgba(90, 169, 255, 0.18); color: var(--accent); }
.status-active { background: rgba(46, 204, 113, 0.18); color: var(--ok); }
.status-past_due { background: rgba(241, 196, 15, 0.2); color: #b8860b; }
.status-suspended, .status-canceled { background: rgba(192, 57, 43, 0.18); color: var(--danger); }
.status-unknown, .status-missing { background: rgba(127, 127, 127, 0.18); color: var(--fg-muted); }

.who { font-size: 12px; color: var(--fg-muted); }

/* --- password reveal toggle ---
   The eye button sits NEXT to the input as a flex sibling (not absolute) so
   it doesn't clash with Firefox's native password-reveal widget. Both
   browsers render two eye icons — slightly redundant but always visible. */
.pw-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.pw-wrap input { flex: 1; min-width: 0; }
.pw-eye {
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--fg);
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex: 0 0 auto;
}
.pw-eye:hover { background: rgba(127, 127, 127, 0.1); }
.pw-eye svg { display: block; }

/* --- agent status badge --- */
.agent-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  font-size: 14px;
  line-height: 1;
  margin-right: 6px;
  vertical-align: middle;
}
.agent-status.status-online { color: var(--ok); }
.agent-status.status-idle { color: #f1c40f; }
.agent-status.status-offline { color: var(--fg-muted); }
button.danger.small { padding: 2px 8px; font-size: 11px; }

/* --- tenant identity banner --- */
.tenant-banner {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}
.tenant-banner.hidden { display: none !important; }
.tenant-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tenant-banner .tenant-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 600;
}
.tenant-banner .tenant-name {
  font-size: 18px;
  font-weight: 600;
}
.tenant-slug-pill {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(127, 127, 127, 0.12);
  border-radius: 10px;
  color: var(--fg-muted);
}

/* Version pill embedded in the top-nav h1: a small monospace tag right
   after "AIGuard control plane" so any admin sees the running version
   at a glance, without going hunting for it. */
.version-pill {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  margin-left: 10px;
  background: rgba(127, 127, 127, 0.15);
  border-radius: 8px;
  color: var(--fg-muted);
  vertical-align: middle;
}
.version-pill:empty { display: none; }

/* --- one-liner install command box --- */
.install-cmd-box {
  margin-top: 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg-card);
}
.install-cmd-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.install-cmd-box pre {
  background: rgba(0, 0, 0, 0.04);
  padding: 12px;
  margin: 0;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .install-cmd-box pre { background: rgba(255, 255, 255, 0.04); }
}
.install-cmd-box .copy-btn {
  margin-top: 8px;
}

/* ---- rules editor (Tenant > Régles) -------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-top: 14px; }
.tabs .tab {
  padding: 8px 14px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 6px 6px 0 0; text-decoration: none; color: var(--ink-soft);
  background: transparent; font-size: 13px;
}
.tabs .tab.active { color: var(--ink); background: var(--surface); font-weight: 600; }
.tabs .tab:hover { color: var(--ink); }

.packs-grid {
  display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.pack-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 4px;
}
.pack-card.enabled { border-color: var(--accent); }
.pack-card .pack-cat {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent);
}
.pack-card .pack-name { font-weight: 600; font-size: 14px; }
.pack-card .pack-desc { font-size: 12px; line-height: 1.4; }
.pack-card:has(.pack-rules-panel:not([hidden])) { grid-column: 1 / -1; }
.pack-rules-panel { margin-top: 10px; overflow-x: auto; }
.pack-rules-panel table.grid { font-size: 12px; }
.pack-rules-panel table.grid code { font-size: 11px; }

.rule-form { display: flex; gap: 8px; margin: 10px 0 16px; flex-wrap: wrap; }
.rule-form input, .rule-form select {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--ink); font-size: 13px;
  min-width: 140px;
}
.rule-form input[name="pattern"] { flex: 2; min-width: 240px; font-family: monospace; }
.rule-form input[name="name"] { flex: 1; }
.rule-form button { white-space: nowrap; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.grid th, table.grid td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
table.grid code { font-size: 12px; }

/* Compact action icons in the agents list (force-update / reset / delete).
   Sunil 2026-05-22: la ligne agent débordait, on remplace les boutons
   texte par des icônes avec tooltip. */
.icon-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 4px 7px; margin: 0 2px; border-radius: 4px;
  opacity: 0.55; font-size: 17px; line-height: 1; color: var(--ink, #1a2a3a);
}
.icon-btn:hover { opacity: 1; background: var(--surface-hover, #eef2ff); }
.icon-btn.has-update { color: #2a9d3f; opacity: 1; }
.icon-btn.has-update:hover { background: rgba(42,157,63,0.12); }
.icon-btn.sent {
  color: #2a9d3f; opacity: 1; background: rgba(42,157,63,0.18);
  animation: icon-pulse 1.2s ease-in-out infinite;
}
@keyframes icon-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.icon-btn.danger { color: #b03030; }
.icon-btn.danger:hover { background: rgba(180,48,48,0.12); opacity: 1; }

/* Pack assignment chips (tab Utilisateurs). Each chip = pack applied to
   a given user, with an × to remove it. The "+" capsule opens a menu of
   packs that were previously removed. */
.pack-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.pack-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--surface, #eef2ff); color: var(--ink, #1a2a3a);
  font-size: 12px; font-weight: 500; line-height: 1;
  border: 1px solid var(--line, #d0d8e0);
}
.pack-chip .chip-x {
  border: none; background: transparent; cursor: pointer;
  color: inherit; opacity: 0.55; font-size: 16px; line-height: 1;
  padding: 0 6px; border-radius: 999px;
}
.pack-chip .chip-x:hover { opacity: 1; background: rgba(255,80,80,0.18); color: #b03030; }
.pack-chip-add { position: relative; display: inline-block; }
.pack-chip-add .chip-add-btn {
  border: 1px dashed var(--line, #b0b8c0); background: transparent;
  width: 28px; height: 28px; border-radius: 999px;
  cursor: pointer; color: var(--muted, #6a7280); font-size: 16px;
  font-weight: 600; line-height: 1;
}
.pack-chip-add .chip-add-btn:hover { color: var(--ink, #1a2a3a); border-color: var(--ink, #1a2a3a); }
.pack-chip-add .chip-add-menu {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  min-width: 220px; max-height: 280px; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--line, #d0d8e0);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px; z-index: 50; display: flex; flex-direction: column; gap: 2px;
}
.pack-chip-add .chip-add-menu.hidden { display: none; }
.pack-chip-add .chip-add-menu button {
  text-align: left; padding: 6px 10px; border: none; background: transparent;
  cursor: pointer; border-radius: 4px; font-size: 13px; color: var(--ink, #1a2a3a);
}
.pack-chip-add .chip-add-menu button:hover { background: var(--surface-hover, #eef2ff); }

/* ===================== Landing / marketing page ===================== */
.hero-tagline {
  font-size: 18px; font-weight: 600; color: var(--accent);
  margin: -4px 0 14px;
}
.availability { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.avail-badge {
  font-size: 13px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-muted); background: var(--surface);
}
.avail-badge.avail-ok { border-color: #BBE3CC; background: #E7F1EA; color: #1F7A4E; font-weight: 600; }
.avail-badge.avail-soon { font-style: italic; }

.section-title { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 28px; }
.features { margin: 18px 0 8px; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px;
}
.feature-ic { font-size: 26px; line-height: 1; margin-bottom: 10px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; }
.feature p { margin: 0; color: var(--fg-muted); font-size: 14px; line-height: 1.55; }

.plans-section { margin: 44px 0 8px; }
.plan-enterprise { border-color: var(--accent); box-shadow: 0 6px 20px rgba(34,148,96,0.10); }
.plan-card .btn { appearance: none; cursor: pointer; }

/* Footer */
.landing-footer {
  margin-top: 64px; padding: 26px 0 8px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  color: var(--fg-muted); font-size: 13px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--fg-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--faint, var(--fg-muted)); }

/* Modal (À propos / CGU / contact) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(31,30,28,.42);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: agFade .15s ease;
}
@keyframes agFade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; background: var(--bg-card); color: var(--fg);
  border: 1px solid var(--line); border-radius: 14px;
  max-width: 620px; width: 100%; max-height: 86vh; overflow: auto;
  padding: 28px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-muted);
  cursor: pointer; font-size: 15px; line-height: 1;
}
.modal-x:hover { color: var(--danger); border-color: var(--danger); }
.modal-title { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.modal-sub { margin: 18px 0 4px; font-size: 15px; font-weight: 650; }
.modal p { line-height: 1.6; color: var(--fg); }
.modal .muted { color: var(--fg-muted); }
.modal-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.modal a { color: var(--accent); }

/* Enterprise contact form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 14px; }
.form-grid label, .form-full { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg-muted); }
.form-full { margin-top: 12px; }
.modal input, .modal textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); width: 100%;
}
.modal textarea { resize: vertical; }
.ec-feedback { margin-top: 10px; font-size: 13px; min-height: 18px; }
.ec-feedback.err { color: var(--danger); }

@media (max-width: 640px) {
  .features { margin-top: 44px; }
  .plans-section { margin-top: 44px; }
  .section-title { font-size: 22px; }
  .landing-footer { flex-direction: column; text-align: center; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px; }
}

/* ---- Hero : moderne mais sobre ---- */
.landing-hero {
  position: relative;
  padding: 54px 24px 34px;
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(78% 72% at 50% 0%, rgba(34, 148, 96, 0.10), transparent 62%),
    radial-gradient(60% 60% at 88% 8%, rgba(204, 120, 92, 0.07), transparent 60%),
    var(--bg-card);
}
.hero-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hero-logo {
  width: 54px; height: 54px; margin: 0;
  filter: drop-shadow(0 6px 18px rgba(34, 148, 96, 0.28));
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-wordmark { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); }
.landing-hero h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
  margin: 6px auto 10px; max-width: 18ch;
}
.landing-hero .lead { font-size: 16.5px; max-width: 720px; }
.landing-hero .btn.primary {
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 6px 18px rgba(204, 120, 92, 0.26);
}
.landing-hero .btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(204, 120, 92, 0.34); }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }
@media (max-width: 640px) {
  .landing-hero { padding: 38px 16px 26px; border-radius: 18px; }
  .hero-logo { width: 46px; height: 46px; }
  .hero-wordmark { font-size: 25px; }
}

/* Tagline : surlignage type marqueur sur les mots-clés */
.hl-mark {
  font-weight: 700; color: var(--ink);
  background: linear-gradient(transparent 58%, rgba(60, 190, 123, 0.32) 58%);
  padding: 0 3px; border-radius: 2px;
}

/* Carte "Hébergement France" : pleine largeur + mise en valeur */
.feature-fr {
  grid-column: 1 / -1;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-color: var(--line);
  background: var(--bg-card);
}
.feature-fr::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, #0055A4 0 33.34%, #ffffff 33.34% 66.67%, #EF4135 66.67%);
}
.feature-fr .feature-ic { font-size: 40px; margin-top: 6px; }
.feature-fr h3 { font-size: 19px; }
.feature-fr p { font-size: 15px; max-width: 760px; margin: 0 auto; }

/* Pages auth (signup/login) : marque + liens */
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.auth-brand img { filter: drop-shadow(0 4px 12px rgba(34, 148, 96, 0.25)); }
.auth-wordmark { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); }
.auth-links { margin-top: 16px; display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.auth-links a { text-decoration: none; }
.auth-links a:hover { color: var(--accent); }

/* Footer : marque AIGuard en gras */
.footer-brand span { font-weight: 700; color: var(--ink); }

/* Capsules versions sous le hero */
.landing > .availability { margin: 22px 0 0; }

/* Page légale plein écran (CGU) */
.legal-page { max-width: 820px; margin: 44px auto; padding: 0 20px; line-height: 1.6; }
.legal-page p { color: var(--fg); line-height: 1.6; }
.legal-page .muted { color: var(--fg-muted); }
.legal-page a { color: var(--accent); }
.legal-back { display: inline-block; margin-bottom: 18px; color: var(--fg-muted); text-decoration: none; font-size: 14px; }
.legal-back:hover { color: var(--accent); }

/* ---- Support tickets (integrated helpdesk) ------------------------------ */
tr.clickable { cursor: pointer; }

.support-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.support-open    { background: var(--accent-soft); color: var(--accent); }
.support-answered{ background: rgba(47,125,84,0.12); color: var(--ok); }
.support-closed  { background: var(--row); color: var(--fg-muted); border: 1px solid var(--line); }

.support-thread { display: flex; flex-direction: column; gap: 12px; }
.support-msg {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 6px; padding: 10px 14px; background: var(--surface);
}
.support-msg-staff  { border-left-color: var(--accent); background: var(--accent-soft); }
.support-msg-client { border-left-color: var(--ok); }
.support-msg-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 6px; font-size: 13px;
}
.support-msg-body { line-height: 1.5; white-space: normal; word-break: break-word; }

/* ---- Support attachments ------------------------------------------------ */
.att-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.att-input { font-size: 13px; }
.support-atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.att-thumb {
  display: inline-block; max-width: 220px; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: var(--row); line-height: 0;
}
.att-thumb .att-pending { display: inline-block; padding: 8px 10px; font-size: 12px; line-height: 1.2; color: var(--fg-muted); }
.att-img-el { display: block; max-width: 220px; max-height: 180px; object-fit: contain; }
.att-file {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  cursor: pointer; font-size: 13px; color: var(--ink);
}
.att-file:hover { background: var(--surface-hover); }

/* ---- Landing refonte commerciale (2026-05-25) ------------------------- */
.section-sub { text-align: center; color: var(--fg-muted); max-width: 680px; margin: 6px auto 0; line-height: 1.5; }

/* "Comment ça marche" — 3 étapes */
.howit { max-width: 1040px; margin: 56px auto 0; padding: 0 20px; }
.howit-grid { display: flex; align-items: stretch; gap: 14px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.howit-step { flex: 1 1 260px; max-width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.howit-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.howit-step h3 { margin: 0 0 8px; font-size: 16px; }
.howit-step p { margin: 0; color: var(--fg-muted); line-height: 1.5; font-size: 14px; }
.howit-arrow { display: flex; align-items: center; color: var(--accent); font-size: 24px; font-weight: 700; }
.token-ex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* "Pour qui ?" */
.usecases { max-width: 1040px; margin: 56px auto 0; padding: 0 20px; }
.usecases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 26px; }
.usecase { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.usecase h3 { margin: 10px 0 8px; font-size: 16px; }
.usecase p { margin: 0; color: var(--fg-muted); line-height: 1.5; font-size: 14px; }

/* Tableau de bord de conformité */
.dashsection { max-width: 1040px; margin: 56px auto 0; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.dashsection-text p { color: var(--fg-muted); line-height: 1.6; }
.dash-tag { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.dash-points { list-style: none; padding: 0; margin: 14px 0 0; }
.dash-points li { padding: 4px 0; color: var(--ink); }
.dashboard-mock { background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.10); overflow: hidden; }
.dash-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--row); }
.dash-dot { width: 10px; height: 10px; border-radius: 50%; background: #d9534f; opacity: .55; }
.dash-dot:nth-child(2) { background: #f0ad4e; } .dash-dot:nth-child(3) { background: #5cb85c; }
.dash-title { margin-left: 8px; font-size: 12px; color: var(--fg-muted); }
.dash-body { padding: 20px; }
.dash-hero-stat { text-align: center; margin-bottom: 18px; }
.dash-bignum { font-size: 48px; font-weight: 800; color: var(--accent); line-height: 1; }
.dash-biglabel { color: var(--fg-muted); font-size: 13px; margin-top: 4px; }
.dash-rows { display: flex; flex-direction: column; gap: 10px; }
.dash-row { display: grid; grid-template-columns: 1fr 90px 28px; align-items: center; gap: 10px; font-size: 13px; }
.dash-bar { background: var(--row); border-radius: 4px; height: 8px; overflow: hidden; }
.dash-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dash-row b { text-align: right; }
.dash-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--fg-muted); text-align: center; }

/* Bascule mensuel/annuel + extras cartes */
.plan-toggle { display: flex; justify-content: center; gap: 0; margin: 18px auto 4px; background: var(--row); border: 1px solid var(--line); border-radius: 999px; padding: 4px; width: max-content; }
.plan-toggle-btn { border: none; background: transparent; padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--fg-muted); }
.plan-toggle-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.plan-toggle-save { font-size: 11px; opacity: .9; }
.plan-permonth { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.plan-save { color: var(--ok); font-weight: 600; }
.plan-includes { list-style: none; padding: 0; margin: 14px 0; text-align: left; }
.plan-includes li { padding: 5px 0 5px 22px; position: relative; font-size: 14px; color: var(--ink); }
.plan-includes li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan-trial { margin-bottom: 12px; }
.plan-featured { border-color: var(--accent); box-shadow: 0 8px 30px rgba(204,120,92,0.15); }
.plan-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.plan-card { position: relative; }

@media (max-width: 780px) { .dashsection { grid-template-columns: 1fr; } .howit-arrow { display: none; } }

/* Billing checkout buttons */
.billing-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.plan-card.current { border-color: var(--ok); }

/* Modern price block + trial banner (2026-05-25) */
.plan-price { display: flex; align-items: baseline; justify-content: center; gap: 3px; margin: 10px 0 2px; min-height: 46px; }
.plan-amount { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.plan-cur { font-size: 20px; font-weight: 700; color: var(--ink); }
.plan-per { font-size: 14px; color: var(--fg-muted); align-self: flex-end; margin-bottom: 5px; }
.plan-quote { font-size: 26px; font-weight: 700; color: var(--ink); }
.plan-permonth { min-height: 18px; }
.trial-banner { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
