/* LinkAIG site chrome: header, mobile menu, footer and client-login modal.
 *
 * Shared by every page. The v3 homepages link it next to css/v3.css; inner
 * pages get it injected by js/layout.js. Inner pages also carry Bootstrap 5
 * and the legacy stylesheets, so everything here is scoped under the lx-
 * roots, tokens included (inner pages define their own :root variables), and
 * resets the Bootstrap/legacy defaults it would otherwise inherit:
 *   - styles.css sets `*:not(html):not(body) { max-width: 100% }` and
 *     `header, footer, nav { overflow-x: clip }`, which would squash and clip
 *     the dropdown;
 *   - Bootstrap reboot adds margins/padding to p, ul, h4 and colours links.
 */

.lx-header, .lx-mobile, .lx-footer, .lx-modal {
  --lx-ink: #111613;
  --lx-ink-2: #2f3a33;
  --lx-muted: #55605a;
  --lx-line: #e4e9de;
  --lx-line-2: #d5dccd;
  --lx-soft: #f5f7f0;
  --lx-soft-2: #edf1e6;
  --lx-accent: #4d6a3d;
  --lx-accent-ink: #3c5530;
  --lx-shadow-sm: 0 1px 2px rgba(17, 22, 19, .06), 0 2px 8px rgba(17, 22, 19, .04);
  --lx-shadow-lg: 0 30px 80px -30px rgba(24, 40, 30, .35);
  --lx-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lx-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lx-header-h: 72px;
  --lx-ease: cubic-bezier(.2, .7, .2, 1);
  font-family: var(--lx-text);
  color: var(--lx-ink-2);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  text-align: left;
}
.lx-header *, .lx-mobile *, .lx-footer *, .lx-modal * { box-sizing: border-box; }
.lx-header :is(p, ul, ol, h3, h4, figure), .lx-mobile :is(p, ul, ol), .lx-footer :is(p, ul, ol, h4), .lx-modal :is(p, ul, h3, form, label) { margin: 0; padding: 0; }
.lx-header ul, .lx-footer ul, .lx-mobile ul { list-style: none; }
.lx-header a, .lx-mobile a, .lx-footer a, .lx-modal a { text-decoration: none; }
.lx-header button, .lx-mobile button, .lx-modal button { font: inherit; cursor: pointer; }
/* light-theme.css re-points -webkit-text-fill-color on links, which beats `color`. */
.lx-header *, .lx-mobile *, .lx-footer *, .lx-modal * { -webkit-text-fill-color: currentColor; }
.lx-header img, .lx-footer img { max-width: none; vertical-align: middle; }
.lx-header .ico, .lx-mobile .ico, .lx-footer .ico, .lx-modal .ico { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.lx-footer .ico-fill { fill: currentColor; stroke: none; }
.lx-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: clamp(18px, 4vw, 32px); }

.lx-btn {
  --b-bg: var(--lx-ink); --b-fg: #fff; --b-bd: var(--lx-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 16px; border-radius: 999px !important;
  font: 600 .9375rem/1 var(--lx-text); letter-spacing: -.005em;
  background: var(--b-bg); color: var(--b-fg) !important; border: 1px solid var(--b-bd);
  transition: transform .2s var(--lx-ease), box-shadow .2s var(--lx-ease);
  white-space: nowrap;
}
.lx-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(17, 22, 19, .55); text-decoration: none; }
.lx-btn--ghost { --b-bg: #fff; --b-fg: var(--lx-ink); --b-bd: var(--lx-line-2); }
.lx-btn--lg { min-height: 48px; padding: 0 22px; font-size: 1rem; }

/* ---------- Header ---------- */
.lx-header {
  position: sticky; top: 0; z-index: 1000;
  overflow: visible !important; max-width: none !important;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
/* Inner pages were laid out for the legacy fixed header; keep that contract. */
.lx-header--fixed { position: fixed; left: 0; right: 0; }
.lx-header.is-scrolled, .lx-header--fixed { border-bottom-color: var(--lx-line); }
.lx-header.is-scrolled { box-shadow: 0 6px 24px -18px rgba(17, 22, 19, .35); }
.lx-header__bar { height: var(--lx-header-h); display: flex; align-items: center; gap: 28px; }
.lx-logo { display: inline-flex; align-items: center; flex: none; }
.lx-logo img { height: 30px; width: auto; }
.lx-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; overflow: visible !important; max-width: none !important; }
.lx-nav > a, .lx-nav__drop > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 10px; border: 0; background: none;
  font: 500 .9625rem/1 var(--lx-text); color: var(--lx-ink-2);
}
.lx-nav > a:hover, .lx-nav__drop > button:hover, .lx-nav__drop.is-open > button, .lx-nav > a.is-active { background: var(--lx-soft-2); color: var(--lx-ink); }
.lx-nav__drop { position: relative; max-width: none !important; }
.lx-nav__drop > button .ico { width: 14px; height: 14px; transition: transform .2s; }
.lx-nav__drop.is-open > button .ico { transform: rotate(180deg); }
.lx-menu {
  position: absolute; top: calc(100% + 10px); left: -8px; width: 560px; max-width: none !important;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px;
  background: #fff; border: 1px solid var(--lx-line); border-radius: 16px; box-shadow: var(--lx-shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s var(--lx-ease);
}
.lx-nav__drop.is-open .lx-menu { opacity: 1; visibility: visible; transform: none; }
.lx-menu a { display: flex; gap: 12px; padding: 12px; border-radius: 12px; color: var(--lx-ink); }
.lx-menu a:hover { background: var(--lx-soft); }
.lx-menu a .ico { width: 20px; height: 20px; margin-top: 2px; color: var(--lx-accent-ink); }
.lx-menu b { display: block; font: 600 .9375rem/1.3 var(--lx-text); color: var(--lx-ink); }
.lx-menu small { display: block; margin-top: 3px; font-size: .8125rem; line-height: 1.4; color: var(--lx-muted); }
.lx-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lx-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--lx-soft-2); }
.lx-lang a { padding: 6px 10px; border-radius: 999px; font: 600 .78rem/1 var(--lx-text); letter-spacing: .04em; color: var(--lx-muted); }
.lx-lang a:hover { color: var(--lx-ink); }
.lx-lang a[aria-current="true"] { background: #fff; color: var(--lx-ink); box-shadow: var(--lx-shadow-sm); }
.lx-login { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 0; background: none; border-radius: 10px !important; font: 500 .9375rem/1 var(--lx-text); color: var(--lx-ink-2); }
.lx-login:hover { background: var(--lx-soft-2); color: var(--lx-ink); }
.lx-burger { display: none; width: 44px; height: 44px; border: 1px solid var(--lx-line); border-radius: 12px !important; background: #fff; align-items: center; justify-content: center; color: var(--lx-ink); }
.lx-burger .ico { width: 22px; height: 22px; }
.lx-header :focus-visible, .lx-mobile :focus-visible, .lx-footer :focus-visible, .lx-modal :focus-visible { outline: 3px solid rgba(77, 106, 61, .5); outline-offset: 3px; border-radius: 6px; }

.lx-mobile { display: none; }
@media (max-width: 1040px) {
  .lx-nav, .lx-header__actions .lx-login, .lx-header__actions .lx-btn { display: none; }
  .lx-burger { display: inline-flex; }
  .lx-mobile {
    display: block; position: fixed; inset: var(--lx-header-h) 0 0 0; z-index: 999;
    background: #fff; overflow-y: auto; padding: 12px clamp(18px, 4vw, 32px) 32px;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .2s var(--lx-ease);
    max-width: none !important;
  }
  .lx-mobile.is-open { opacity: 1; visibility: visible; transform: none; }
  .lx-mobile > a, .lx-mobile .lx-m-sub a { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 4px; border-bottom: 1px solid var(--lx-line); font: 600 1.125rem/1.2 var(--lx-display); color: var(--lx-ink); }
  .lx-mobile .lx-m-sub a { font: 500 1rem/1.3 var(--lx-text); color: var(--lx-ink-2); padding: 12px 4px 12px 14px; }
  .lx-mobile .lx-m-label { margin: 22px 4px 4px; font: 600 .75rem/1 var(--lx-text); letter-spacing: .08em; text-transform: uppercase; color: var(--lx-muted); }
  .lx-mobile .lx-m-cta { display: grid; gap: 10px; margin-top: 24px; }
  .lx-mobile .lx-m-cta .lx-btn { width: 100%; min-height: 48px; font-size: 1rem; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 640px) {
  .lx-header__actions .lx-lang { display: none; }
}

/* ---------- Footer ---------- */
.lx-footer { margin: 0; border-top: 1px solid var(--lx-line); background: var(--lx-soft); padding: clamp(48px, 7vw, 72px) 0 28px !important; font-size: .9375rem; max-width: none !important; }
.lx-footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.lx-footer__brand img { height: 30px; width: auto; }
.lx-footer__brand p { margin-top: 16px; max-width: 320px; color: var(--lx-muted); }
.lx-social { display: flex; gap: 8px; margin-top: 20px; }
.lx-social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 1px solid var(--lx-line); color: var(--lx-ink-2); transition: .2s; }
.lx-social a:hover { color: var(--lx-accent-ink); border-color: var(--lx-line-2); transform: translateY(-2px); }
.lx-social .ico { width: 18px; height: 18px; }
.lx-footer h4 { font: 600 .78rem/1 var(--lx-text); letter-spacing: .08em; text-transform: uppercase; color: var(--lx-muted); }
.lx-footer ul { margin-top: 16px; display: grid; gap: 10px; }
.lx-footer ul a { color: var(--lx-ink-2); }
.lx-footer ul a:hover { color: var(--lx-accent-ink); }
.lx-footer__bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--lx-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--lx-muted); font-size: .875rem; }
.lx-footer__bottom nav { display: flex; flex-wrap: wrap; gap: 8px 18px; overflow: visible !important; }
.lx-footer__bottom a { color: var(--lx-muted); }
.lx-footer__bottom a:hover { color: var(--lx-ink); }
@media (max-width: 960px) {
  .lx-footer__top { grid-template-columns: 1fr 1fr; }
  .lx-footer__brand { grid-column: 1 / -1; }
}

/* ---------- Client-login modal ---------- */
.lx-modal { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 20px; visibility: hidden; opacity: 0; transition: .2s; max-width: none !important; }
.lx-modal.is-open { visibility: visible; opacity: 1; }
.lx-modal__scrim { position: absolute; inset: 0; background: rgba(18, 27, 23, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lx-modal__box { position: relative; width: min(100%, 420px); background: #fff; border-radius: 24px; padding: 30px; box-shadow: var(--lx-shadow-lg); transform: translateY(10px) scale(.98); transition: transform .25s var(--lx-ease); }
.lx-modal.is-open .lx-modal__box { transform: none; }
.lx-modal__x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 10px !important; border: 0; background: var(--lx-soft-2); display: grid; place-items: center; color: var(--lx-ink); }
.lx-modal__x .ico { width: 18px; height: 18px; }
.lx-modal h3 { font: 800 1.5rem/1.15 var(--lx-display); letter-spacing: -.02em; color: var(--lx-ink); }
.lx-modal__box > p { margin-top: 6px; color: var(--lx-muted); font-size: .9375rem; }
.lx-modal .lx-login-form { display: grid; gap: 14px; margin-top: 20px; }
.lx-login-form label { display: grid; gap: 6px; font: 600 .875rem/1.2 var(--lx-text); color: var(--lx-ink); }
.lx-login-form input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--lx-line-2); background: #fff; font: 400 1rem/1.4 var(--lx-text); color: var(--lx-ink); }
.lx-login-form input:focus { outline: none; border-color: var(--lx-accent); box-shadow: 0 0 0 4px rgba(77, 106, 61, .15); }
.lx-login-form .lx-btn { width: 100%; min-height: 48px; font-size: 1rem; margin-top: 4px; }
.lx-login-form .lx-btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.lx-login-form__err { display: none; padding: 10px 12px; border-radius: 10px; background: #fdecec; color: #b42318; font-size: .875rem; }
.lx-login-form__err.is-on { display: block; }
.lx-login-form__fine { font-size: .8125rem; color: var(--lx-muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .lx-header *, .lx-mobile, .lx-modal, .lx-modal__box, .lx-menu { transition-duration: .001ms !important; }
}
