/* ============================================================
   Archiga — Landing publique (page d'accueil visiteurs)
   Chargé uniquement sur core/landing.html via {% block extra_css %}.
   Toutes les classes sont préfixées .lp- et scopées sous .lp pour
   ne pas entrer en collision avec les composants globaux de main.css.
   Couleurs, rayons et ombres : tokens de _settings.scss (var(--color-*)).
   ============================================================ */

/* Le layout anonyme (base_anonymous.html) centre son contenu pour le login.
   landing.css n'étant chargé que sur la landing, on peut cibler le wrapper
   directement : ici on veut un flux pleine largeur en haut de page. */
.layout-anonymous {
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  background: var(--color-surface);
}

/* ── Jetons locaux (échelles absentes des tokens globaux) ── */
.lp {
  --lp-accent: var(--color-primary);
  --lp-accent-hover: #153d56;
  --lp-accent-bg: var(--color-primary-bg);
  --lp-accent-bg-strong: #d5e5ee;
  --lp-text: var(--color-text);
  --lp-text-secondary: var(--color-text-secondary);
  --lp-text-muted: var(--color-text-muted);
  --lp-surface: var(--color-surface);
  --lp-bg-subtle: var(--color-bg);
  --lp-border: var(--color-border);
  --lp-border-strong: #d4dbe4;

  --lp-shadow-sm: var(--shadow-sm);
  --lp-shadow-md: var(--shadow-md);
  --lp-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --lp-s-1: 4px;  --lp-s-2: 8px;  --lp-s-3: 12px; --lp-s-4: 16px;
  --lp-s-5: 20px; --lp-s-6: 24px; --lp-s-8: 32px; --lp-s-10: 40px;
  --lp-s-12: 48px; --lp-s-16: 64px; --lp-s-20: 80px; --lp-s-24: 96px;

  --lp-text-xs: 12px; --lp-text-sm: 13px; --lp-text-base: 14px;
  --lp-text-md: 15px; --lp-text-lg: 18px; --lp-text-xl: 24px;
  --lp-text-2xl: 30px; --lp-text-4xl: 48px; --lp-text-5xl: 60px;

  --lp-r-sm: var(--radius-sm);   /* 6 */
  --lp-r-md: var(--radius-md);   /* 10 */
  --lp-r-lg: var(--radius-lg);   /* 12 */
  --lp-r-2xl: 16px;
  --lp-r-pill: 999px;

  --lp-success: var(--color-success); --lp-success-bg: var(--color-success-bg);
  --lp-warning: var(--color-warning); --lp-warning-bg: var(--color-warning-bg);
  --lp-danger:  var(--color-danger);  --lp-danger-bg:  var(--color-danger-bg);
  --lp-info:    var(--color-info);     --lp-info-bg:    var(--color-info-bg);

  --lp-nav-h: 60px;
  --lp-container: 1120px;

  color: var(--lp-text);
  font-size: var(--lp-text-base);
  line-height: 1.6;
}

.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }
/* :where() → spécificité nulle : toute classe (.lp-btn, .lp-nav__link…) reprend la main sur la couleur. */
:where(.lp) a { color: var(--lp-accent); text-decoration: none; }
:where(.lp) a:hover { text-decoration: none; }
.lp button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.lp svg { display: block; }

/* Focus visible cohérent (accessibilité clavier) */
.lp a:focus-visible,
.lp button:focus-visible,
.lp input:focus-visible {
  outline: 2px solid var(--lp-accent);
  outline-offset: 2px;
  border-radius: var(--lp-r-sm);
}

.lp-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--lp-accent); color: #fff;
  padding: var(--lp-s-2) var(--lp-s-4); border-radius: var(--lp-r-sm); z-index: 300;
}
.lp-skip:focus { left: var(--lp-s-4); top: var(--lp-s-4); }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

.lp-container {
  width: 100%; max-width: var(--lp-container);
  margin: 0 auto; padding: 0 var(--lp-s-6);
}

.lp-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--lp-accent);
}
.lp-muted { color: var(--lp-text-muted); }

/* ── Boutons ── */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--lp-s-2); height: 36px; padding: 0 var(--lp-s-4);
  font-size: var(--lp-text-sm); font-weight: 500; line-height: 1;
  color: var(--lp-text); background: var(--lp-surface);
  border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-sm);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.lp-btn:hover { background: var(--lp-bg-subtle); }
.lp-btn--primary { background: var(--lp-accent); border-color: var(--lp-accent); color: #fff; }
.lp-btn--primary:hover { background: var(--lp-accent-hover); border-color: var(--lp-accent-hover); }
.lp-btn--ghost { background: transparent; border-color: transparent; color: var(--lp-text-secondary); }
.lp-btn--ghost:hover { background: var(--lp-bg-subtle); color: var(--lp-text); }
.lp-btn--lg { height: 44px; padding: 0 var(--lp-s-6); font-size: var(--lp-text-md); }
.lp-btn--on-accent { background: #fff; border-color: #fff; color: var(--lp-accent); }
.lp-btn--on-accent:hover { background: var(--lp-accent-bg-strong); border-color: var(--lp-accent-bg-strong); }
.lp-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Badges (aperçu produit) ── */
.lp-badge {
  display: inline-flex; align-items: center; gap: var(--lp-s-1);
  height: 22px; padding: 0 var(--lp-s-2);
  font-size: 11px; font-weight: 500; line-height: 1;
  border-radius: var(--lp-r-sm); white-space: nowrap;
}
.lp-badge__dot { width: 6px; height: 6px; border-radius: var(--lp-r-pill); background: currentColor; opacity: 0.7; }
.lp-badge--blue   { background: var(--lp-info-bg);    color: var(--lp-info); }
.lp-badge--green  { background: var(--lp-success-bg); color: var(--lp-success); }
.lp-badge--yellow { background: var(--lp-warning-bg); color: var(--lp-warning); }

/* ════════════════════════ NAVIGATION ════════════════════════ */
.lp-nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--lp-nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--lp-border);
}
.lp-nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--lp-s-6); }
.lp-nav__brand { display: flex; align-items: center; gap: var(--lp-s-2); font-weight: 700; font-size: var(--lp-text-lg); letter-spacing: -0.02em; color: var(--lp-text); }
.lp-nav__logo { width: 26px; height: 26px; }
.lp-nav__links { display: flex; align-items: center; gap: var(--lp-s-2); }
.lp-nav__link {
  padding: var(--lp-s-2) var(--lp-s-3); font-size: var(--lp-text-sm); font-weight: 500;
  color: var(--lp-text-secondary); border-radius: var(--lp-r-sm); white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}
.lp-nav__link:hover { background: var(--lp-bg-subtle); color: var(--lp-text); }
.lp-nav__actions { display: flex; align-items: center; gap: var(--lp-s-2); }

.lp-nav__burger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--lp-r-sm); color: var(--lp-text); }
.lp-nav__burger:hover { background: var(--lp-bg-subtle); }
.lp-nav__burger svg { width: 22px; height: 22px; }

.lp-nav__mobile {
  display: none; position: fixed; inset: var(--lp-nav-h) 0 auto 0;
  background: var(--lp-surface); border-bottom: 1px solid var(--lp-border);
  padding: var(--lp-s-4) var(--lp-s-6) var(--lp-s-6); box-shadow: var(--lp-shadow-md); z-index: 199;
}
.lp-nav__mobile.is-open { display: block; }
.lp-nav__mobile .lp-nav__link { display: block; padding: var(--lp-s-3); font-size: var(--lp-text-md); }
.lp-nav__mobile-actions { display: flex; flex-direction: column; gap: var(--lp-s-2); margin-top: var(--lp-s-4); }
.lp-nav__mobile-actions .lp-btn { width: 100%; }

/* Connexion inline (topbar) */
.lp-login { position: relative; display: flex; align-items: center; gap: var(--lp-s-2); }
.lp-login__input {
  height: 34px; width: 150px; padding: 0 var(--lp-s-3);
  font-size: var(--lp-text-sm); color: var(--lp-text);
  background: var(--lp-surface); border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.lp-login__input:hover { border-color: var(--lp-text-muted); }
.lp-login__input:focus { outline: none; border-color: var(--lp-accent); box-shadow: 0 0 0 3px var(--lp-accent-bg); }
.lp-login__error {
  position: absolute; top: calc(100% + 10px); right: 0; margin: 0;
  font-size: var(--lp-text-xs); color: var(--lp-danger); white-space: nowrap;
  padding: var(--lp-s-2) var(--lp-s-3); background: var(--lp-surface);
  border: 1px solid var(--lp-border); border-radius: var(--lp-r-sm); box-shadow: var(--lp-shadow-sm);
}

/* Connexion pleine largeur (menu mobile) */
.lp-field { margin-bottom: var(--lp-s-4); }
.lp-field__label { display: block; font-size: var(--lp-text-sm); font-weight: 500; margin-bottom: var(--lp-s-1); }
.lp-field__input {
  width: 100%; height: 40px; padding: 0 var(--lp-s-3);
  font-size: var(--lp-text-md); color: var(--lp-text);
  background: var(--lp-surface); border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.lp-field__input:focus { outline: none; border-color: var(--lp-accent); box-shadow: 0 0 0 3px var(--lp-accent-bg); }
.lp-nav__mobile-login { margin-bottom: var(--lp-s-4); padding-bottom: var(--lp-s-2); border-bottom: 1px solid var(--lp-border); }

/* ════════════════════════ HERO ════════════════════════ */
.lp-hero { position: relative; padding: var(--lp-s-16) 0 var(--lp-s-12); background: var(--lp-surface); overflow: hidden; }
.lp-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(27, 73, 101, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 73, 101, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(160deg, #000 0%, transparent 65%);
  pointer-events: none;
}
.lp-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 0.92fr 1.08fr; gap: var(--lp-s-12); align-items: center; }
.lp-hero__copy { text-align: left; }
.lp-hero__title { font-size: var(--lp-text-5xl); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; margin: 0 0 var(--lp-s-5); color: var(--lp-text); }
.lp-hero__title em { font-style: normal; color: var(--lp-accent); }
.lp-hero__sub { font-size: var(--lp-text-lg); line-height: 1.45; color: var(--lp-text-secondary); max-width: 48ch; margin: 0 0 var(--lp-s-8); }

/* Formulaire "commencer gratuitement" → signup */
.lp-cta-form { display: flex; gap: var(--lp-s-2); max-width: 460px; }
.lp-cta-form__field { flex: 1; min-width: 0; }
.lp-cta-form__input {
  width: 100%; height: 44px; padding: 0 var(--lp-s-4);
  font-size: var(--lp-text-md); color: var(--lp-text);
  background: var(--lp-surface); border: 1px solid var(--lp-border-strong); border-radius: var(--lp-r-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.lp-cta-form__input:hover { border-color: var(--lp-text-muted); }
.lp-cta-form__input:focus { outline: none; border-color: var(--lp-accent); box-shadow: 0 0 0 3px var(--lp-accent-bg); }

/* Aperçu produit (mock HTML/CSS) */
.lp-preview { margin: 0; border: 1px solid var(--lp-border); border-radius: var(--lp-r-2xl); background: var(--lp-surface); box-shadow: var(--lp-shadow-lg); overflow: hidden; text-align: left; }
.lp-appbar { display: flex; align-items: center; gap: var(--lp-s-2); padding: var(--lp-s-3) var(--lp-s-4); border-bottom: 1px solid var(--lp-border); background: var(--lp-bg-subtle); }
.lp-appbar__dot { width: 10px; height: 10px; border-radius: var(--lp-r-pill); background: var(--lp-border-strong); }
.lp-appbar__url { margin-left: var(--lp-s-3); font-size: var(--lp-text-xs); color: var(--lp-text-muted); font-variant-numeric: tabular-nums; }
.lp-appshell { display: grid; grid-template-columns: 168px 1fr; min-height: 340px; }
.lp-appshell__side { border-right: 1px solid var(--lp-border); background: var(--lp-bg-subtle); padding: var(--lp-s-4) var(--lp-s-3); }
.lp-appnav { display: flex; flex-direction: column; gap: 2px; }
.lp-appnav__item { display: flex; align-items: center; gap: var(--lp-s-2); padding: var(--lp-s-2) var(--lp-s-3); border-radius: var(--lp-r-sm); font-size: var(--lp-text-sm); color: var(--lp-text-secondary); }
.lp-appnav__item svg { width: 15px; height: 15px; }
.lp-appnav__item--active { background: #e6ebf1; color: var(--lp-text); font-weight: 500; }
.lp-appshell__main { padding: var(--lp-s-5); }
.lp-appshell__crumb { font-size: var(--lp-text-xs); color: var(--lp-text-muted); margin-bottom: var(--lp-s-2); }
.lp-appshell__title { font-size: var(--lp-text-lg); font-weight: 600; margin-bottom: var(--lp-s-5); }

.lp-kpi-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--lp-s-3); margin-bottom: var(--lp-s-5); }
.lp-kpi { border: 1px solid var(--lp-border); border-radius: var(--lp-r-md); padding: var(--lp-s-4); }
.lp-kpi__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lp-text-muted); font-weight: 600; }
.lp-kpi__value { font-size: var(--lp-text-lg); font-weight: 700; margin-top: var(--lp-s-2); letter-spacing: -0.01em; }
.lp-kpi__delta { font-size: var(--lp-text-xs); margin-top: var(--lp-s-1); color: var(--lp-success); }

.lp-mini-table { width: 100%; border-collapse: collapse; font-size: var(--lp-text-sm); }
.lp-mini-table th { text-align: left; padding: var(--lp-s-2) var(--lp-s-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--lp-text-muted); font-weight: 500; border-bottom: 1px solid var(--lp-border); }
.lp-mini-table td { padding: var(--lp-s-3); border-bottom: 1px solid var(--lp-border); }
.lp-mini-table tr:last-child td { border-bottom: none; }
.lp-mini-table td.num { text-align: right; }

/* ════════════════════════ SECTIONS ════════════════════════ */
.lp-section { padding: var(--lp-s-24) 0; }
.lp-section--subtle { background: var(--lp-bg-subtle); }
.lp-section__head { max-width: 680px; margin: 0 0 var(--lp-s-12); text-align: left; }
.lp-section__title { font-size: var(--lp-text-4xl); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; margin: var(--lp-s-3) 0 var(--lp-s-4); color: var(--lp-text); }
.lp-section__sub { font-size: var(--lp-text-lg); line-height: 1.45; color: var(--lp-text-secondary); }

/* ── Comparatif ── */
.lp-compare { border: 1px solid var(--lp-border); border-radius: var(--lp-r-2xl); overflow: hidden; background: var(--lp-surface); }
.lp-compare__row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; }
.lp-compare__row + .lp-compare__row { border-top: 1px solid var(--lp-border); }
.lp-compare__cell { padding: var(--lp-s-4) var(--lp-s-5); font-size: var(--lp-text-sm); display: flex; align-items: center; gap: var(--lp-s-2); }
.lp-compare__cell--label { font-weight: 500; color: var(--lp-text); background: var(--lp-bg-subtle); }
.lp-compare__cell--archiga { background: var(--lp-accent-bg); }
.lp-compare__head { font-weight: 600; font-size: var(--lp-text-sm); }
.lp-compare__head--archiga { color: var(--lp-accent); }
.lp-compare__ico { width: 16px; height: 16px; flex-shrink: 0; }
.lp-compare__ico--no { color: var(--lp-danger); }
.lp-compare__ico--yes { color: var(--lp-success); }
.lp-compare__val { color: var(--lp-text-secondary); }
.lp-compare__val--strong { color: var(--lp-text); font-weight: 500; }

/* ── Fonctionnalités ── */
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--lp-s-6) var(--lp-s-8); }
.lp-feature { position: relative; padding-top: var(--lp-s-5); border-top: 2px solid var(--lp-accent); }
.lp-feature__num { position: absolute; top: var(--lp-s-5); right: 0; font-variant-numeric: tabular-nums; font-size: var(--lp-text-xs); color: var(--lp-text-muted); letter-spacing: 0.02em; }
.lp-feature__icon { width: 36px; height: 36px; border-radius: var(--lp-r-md); background: var(--lp-accent-bg); color: var(--lp-accent); display: flex; align-items: center; justify-content: center; margin-bottom: var(--lp-s-4); }
.lp-feature__icon svg { width: 20px; height: 20px; }
.lp-feature__title { font-size: var(--lp-text-md); font-weight: 600; margin-bottom: var(--lp-s-2); color: var(--lp-text); }
.lp-feature__desc { font-size: var(--lp-text-sm); line-height: 1.6; color: var(--lp-text-secondary); margin: 0; }

/* ── CTA final ── */
.lp-cta { padding: var(--lp-s-20) 0; background: var(--lp-accent); color: #fff; text-align: left; }
.lp-cta__title { font-size: var(--lp-text-4xl); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--lp-s-4); max-width: 18ch; color: #fff; }
.lp-cta__sub { font-size: var(--lp-text-lg); color: var(--lp-accent-bg-strong); max-width: 54ch; margin: 0 0 var(--lp-s-8); }
.lp-cta .lp-cta-form { margin: 0; }
.lp-cta .lp-cta-form__input { border-color: transparent; }
.lp-cta .lp-cta-form__input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.lp-cta__note { margin-top: var(--lp-s-4); font-size: var(--lp-text-sm); color: var(--lp-accent-bg-strong); }

/* ── Footer ── */
.lp-footer { padding: var(--lp-s-16) 0 var(--lp-s-8); background: var(--lp-bg-subtle); border-top: 1px solid var(--lp-border); }
.lp-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--lp-s-8); }
.lp-footer__brand { display: flex; align-items: center; gap: var(--lp-s-2); font-weight: 700; font-size: var(--lp-text-lg); color: var(--lp-text); letter-spacing: -0.02em; margin-bottom: var(--lp-s-3); }
.lp-footer__blurb { font-size: var(--lp-text-sm); color: var(--lp-text-secondary); max-width: 34ch; }
.lp-footer__made { margin-top: var(--lp-s-4); display: inline-flex; align-items: center; gap: var(--lp-s-2); font-size: var(--lp-text-xs); color: var(--lp-text-muted); }
.lp-footer__col-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lp-text-muted); font-weight: 600; margin-bottom: var(--lp-s-4); }
.lp-footer__link { display: block; padding: var(--lp-s-1) 0; font-size: var(--lp-text-sm); color: var(--lp-text-secondary); }
.lp-footer__link:hover { color: var(--lp-text); }
.lp-footer__bottom { display: flex; flex-wrap: wrap; gap: var(--lp-s-3); justify-content: space-between; align-items: center; margin-top: var(--lp-s-12); padding-top: var(--lp-s-6); border-top: 1px solid var(--lp-border); font-size: var(--lp-text-xs); color: var(--lp-text-muted); }

.lp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ════════════════════════ RESPONSIVE ════════════════════════ */
@media (max-width: 1040px) {
  .lp-nav__links { display: none; }
}
@media (max-width: 900px) {
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  .lp-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--lp-s-8); }
  .lp-appshell__side { display: none; }
  .lp-appshell { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .lp-nav__actions { display: none; }
  .lp-nav__burger { display: flex; }
  .lp-hero__grid { grid-template-columns: 1fr; gap: var(--lp-s-10); }
}
@media (max-width: 720px) {
  .lp { --lp-text-5xl: 40px; --lp-text-4xl: 32px; }
  .lp-hero { padding: var(--lp-s-16) 0 var(--lp-s-12); }
  .lp-cta-form { flex-direction: column; }
  .lp-cta-form .lp-btn { width: 100%; }
  .lp-kpi-row { grid-template-columns: 1fr; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-compare__row { grid-template-columns: 1fr; }
  .lp-compare__cell--label { border-bottom: 1px solid var(--lp-border); }
  .lp-footer__grid { grid-template-columns: 1fr; }
}
