/* ============================================================
   Last Sovereign — NEW WEBSITE shared chrome
   Header / nav / buttons / page frame, desktop + mobile.
   Pairs with tokens.css. Every page loads both.
   ============================================================ */

/* tokens.css paints an opaque background on BOTH html and body. A body
   background is a block-level descendant background, so it paints OVER any
   z-index:-1 child — which hid .ls-bg entirely. html keeps the base colour
   as the fallback; body must be transparent for the hero art to show. */
body { font-family: var(--font-body); background: transparent; }

/* ---------------- Page background (full-bleed hero art) ------------- */
.ls-bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg-deep) url('../img/hero-bg.webp') center/cover no-repeat;
}
.ls-bg::after {              /* deepen the art so text always holds contrast */
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg,  rgba(5,13,24,.82) 0%, rgba(5,13,24,.45) 46%, rgba(5,13,24,0) 72%),
    linear-gradient(180deg, rgba(5,13,24,.55) 0%, rgba(5,13,24,.12) 40%, rgba(5,13,24,.72) 100%);
}
@media (max-width: 900px) {   /* centred text on mobile needs an even wash */
  .ls-bg::after {
    background: linear-gradient(180deg, rgba(5,13,24,.70) 0%, rgba(5,13,24,.55) 45%, rgba(5,13,24,.85) 100%);
  }
}

/* ---------------- Header ------------------------------------------- */
.ls-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 46px 0 87px;                 /* logo x=87 in the 1920 PSD */
  background: rgba(4, 10, 20, .92);
  border-bottom: 1px solid var(--gold-dim);
  backdrop-filter: blur(6px);
}
.ls-logo { display: flex; align-items: center; flex: 0 0 auto; }
.ls-logo img { height: 66px; width: auto; display: block; }

.ls-nav {
  margin-left: auto;
  display: flex; align-items: flex-end; gap: 34px;
  height: 100%; padding-bottom: 10px;
}

/* One nav item = masked icon over label. Mask lets ONE png serve both
   states (the exports are inconsistent: Home is gold, the rest white). */
.ls-nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-decoration: none; color: #FFFFFF;
  font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  letter-spacing: .01em; padding: 6px 4px 12px;
  transition: color .18s ease;
}
.ls-nav .ls-ico {
  width: 30px; height: 30px; display: block;
  background-color: currentColor;
  /* mask-image is set inline by site.js. It must NOT come from a custom
     property consumed here: a relative URL in that case resolves against
     THIS stylesheet (assets/css/), not the page, giving assets/css/assets/... */
  -webkit-mask-repeat: no-repeat;   mask-repeat: no-repeat;
  -webkit-mask-position: center;    mask-position: center;
  -webkit-mask-size: contain;       mask-size: contain;
}
.ls-nav a:hover { color: var(--gold-link); }
.ls-nav a[aria-current="page"] { color: var(--gold); }
.ls-nav a[aria-current="page"]::after {   /* gold selection bar */
  content: ''; position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 68px; height: 8px;
  background: url('../img/nav-active.png') center/contain no-repeat;
}

/* Wrapper for the account items. display:contents so the links stay direct
   flex children of .ls-nav in both the desktop row and the mobile column. */
.ls-account { display: contents; }

.ls-nav-sep {
  width: 1px; height: 46px; align-self: center;
  background: linear-gradient(180deg, transparent, var(--gold-dim), transparent);
}

/* ---------------- Buttons ------------------------------------------ */
/* Red CTA: the PSD ships an ornate frame png; we stretch it as a
   border-image so the label stays live text at any width. */
.ls-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  min-width: 380px; padding: 26px 46px;
  font-family: var(--font-display); font-size: 25px; font-weight: 400;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-on-cta); text-decoration: none;
  background: var(--cta-gradient);
  border: 2px solid var(--gold-border);
  border-radius: var(--radius);
  box-shadow: 0 0 22px rgba(229,176,60,.18), inset 0 1px 0 rgba(255,255,255,.12);
  cursor: pointer;
  transition: filter .18s ease, box-shadow .18s ease, transform .12s ease;
}
.ls-cta:hover { filter: brightness(1.18); box-shadow: 0 0 34px rgba(229,176,60,.34); }
.ls-cta:active { transform: translateY(1px); }
.ls-cta img { width: 26px; height: 24px; }

/* ---------------- Shared bits -------------------------------------- */
.ls-eyebrow {
  font-family: var(--font-display); font-weight: 400;
  font-size: 17px; letter-spacing: .30em; text-transform: uppercase;
  color: var(--gold-pale); margin: 0;
}
.ls-divider { display: block; width: 440px; max-width: 80vw; height: auto; }

.ls-main { min-height: calc(100vh - var(--header-h) - var(--footer-h)); }

/* ---------------- Footer ----------------
   Injected on every page by site.js, so the copyright line and the legal
   links exist once rather than in eleven files. */
.ls-footer {
  position: relative;
  min-height: var(--footer-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px 30px; flex-wrap: wrap;
  padding: 16px 87px;
  background: rgba(4, 10, 20, .92);
}
/* Centred separator that fades out before the edges, matching the dividers
   used elsewhere on the site. A full-width rule ran straight into the
   vertical scroll rail on the right, which read as a collision. */
.ls-footer::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(900px, 74%); height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, var(--gold-dim) 22%, var(--gold-dim) 78%, transparent 100%);
}
.ls-footer .copy {
  font-family: var(--font-ui); font-size: 13px; color: var(--text-dim);
}
.ls-footer nav { display: flex; gap: 26px; flex-wrap: wrap; }
.ls-footer a {
  font-family: var(--font-ui); font-size: 13px;
  color: var(--text); text-decoration: none;
}
.ls-footer a:hover { color: var(--gold-link); text-decoration: underline; }

/* ============================================================
   MOBILE  —  the PSDs are desktop-only (1920x1080), so the
   phone layout is our design: header collapses to logo + menu,
   hero type scales down, everything centres.
   ============================================================ */
.ls-navtoggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--gold-dim);
  border-radius: var(--radius); cursor: pointer;
}
.ls-navtoggle span, .ls-navtoggle span::before, .ls-navtoggle span::after {
  display: block; width: 20px; height: 2px; background: var(--gold); content: '';
  margin: 0 auto; position: relative;
}
.ls-navtoggle span::before { top: -6px; } .ls-navtoggle span::after { top: 4px; }

@media (max-width: 900px) {
  .ls-header { padding: 0 16px; height: 72px; }
  .ls-logo img { height: 42px; }
  .ls-navtoggle { display: block; }

  .ls-nav {
    position: fixed; inset: 72px 0 auto 0;
    margin: 0; height: auto; padding: 10px 0 18px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(4, 10, 20, .98);
    border-bottom: 1px solid var(--gold-dim);
    display: none;
  }
  .ls-nav.is-open { display: flex; }
  .ls-nav a {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 15px 22px; font-size: 16px;
    border-bottom: 1px solid rgba(158,131,84,.18);
  }
  .ls-nav a[aria-current="page"]::after { display: none; }
  .ls-nav a[aria-current="page"] { background: rgba(229,176,60,.07); }
  .ls-nav-sep { display: none; }

  .ls-bg { background-image: url('../img/hero-bg-sm.webp'); }
  .ls-cta { min-width: 0; width: 100%; max-width: 360px; padding: 18px 24px; font-size: 19px; }
  .ls-eyebrow { font-size: 12px; letter-spacing: .22em; }
}

/* ============================================================
   PANEL + FORM components
   Shared by Login, Create Account, Profile and the Logout modal.
   ============================================================ */

/* Ornate gold frame. The corner flourishes are 76px in the source art,
   so border-image-slice is 76 and the edges repeat ("round") — which is
   why the panel can be any width/height and still look hand-drawn. */
.ls-panel {
  position: relative;
  border: 38px solid transparent;
  border-image: url('../img/panel-frame.png') 76 round;
  background: rgba(8, 20, 28, .90);
  background-clip: padding-box;
  padding: 10px 44px 40px;
}
.ls-crest {                       /* lion medallion straddling the top edge */
  position: absolute; top: -78px; left: 50%; transform: translateX(-50%);
  width: 178px; height: 141px; pointer-events: none;
}
.ls-panel-head { text-align: center; padding-top: 74px; }
.ls-panel-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(30px, 3.2vw, 44px); margin: 0; letter-spacing: .01em;
  background: linear-gradient(180deg, #FFF3C0 0%, #E5B03C 52%, #B9812A 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ls-panel-head .sub {
  font-family: var(--font-display); font-size: 13px; font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--text); margin: 8px 0 0;
}
.ls-panel-head .note {
  font-family: var(--font-body); font-size: 17px; color: var(--text-dim);
  margin: 12px 0 0;
}

/* ---------------- Fields ---------------- */
.ls-field { margin-top: 20px; }
.ls-field > label {
  display: block; font-family: var(--font-display); font-weight: 400;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); margin-bottom: 7px;
}
.ls-input {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid rgba(158,131,84,.55);
  border-radius: var(--radius); padding: 0 14px; height: 54px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ls-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(229,176,60,.12); }
.ls-input img { width: 20px; height: auto; opacity: .85; flex: 0 0 auto; }
.ls-input input {
  flex: 1 1 auto; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font-family: var(--font-ui); font-size: 15px;
}
.ls-input input::placeholder { color: #7F8A95; }
.ls-eye {
  background: none; border: 0; padding: 4px; cursor: pointer; opacity: .7;
  flex: 0 0 auto; line-height: 0;
}
.ls-eye:hover { opacity: 1; }
.ls-eye img { width: 20px; }

.ls-fieldnote { text-align: right; margin: 9px 0 0; }
.ls-fieldnote a { font-family: var(--font-ui); font-size: 13.5px; color: var(--gold-link); text-decoration: none; }
.ls-fieldnote a:hover { text-decoration: underline; }

/* Checkbox row (terms) */
.ls-check { display: flex; align-items: flex-start; gap: 11px; margin-top: 22px; }
.ls-check input { width: 19px; height: 19px; accent-color: var(--gold); margin: 1px 0 0; flex: 0 0 auto; cursor: pointer; }
.ls-check label { font-family: var(--font-ui); font-size: 14px; color: var(--text); line-height: 1.45; }
.ls-check a { color: var(--gold-link); text-decoration: none; }
.ls-check a:hover { text-decoration: underline; }

/* ---------------- "or continue with" + socials ---------------- */
.ls-or {
  display: flex; align-items: center; gap: 16px; margin: 26px 0 20px;
  font-family: var(--font-display); font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-dim);
}
.ls-or::before, .ls-or::after {
  content: ''; flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.ls-socials { display: flex; justify-content: center; gap: 14px; }
.ls-social {
  width: 72px; height: 64px; display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid rgba(158,131,84,.55);
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: border-color .18s ease, background .18s ease;
}
.ls-social:hover { border-color: var(--gold); background: rgba(229,176,60,.08); }
.ls-social img, .ls-social svg { width: 28px; height: 28px; display: block; }
/* Providers the API cannot do yet — visible but clearly not usable. */
.ls-social[aria-disabled="true"] {
  opacity: .38; cursor: not-allowed; position: relative;
}
.ls-social[aria-disabled="true"]:hover { border-color: rgba(158,131,84,.55); background: var(--panel); }

.ls-panel-foot {
  margin-top: 26px; padding-top: 20px; text-align: center;
  border-top: 1px solid rgba(158,131,84,.30);
  font-family: var(--font-ui); font-size: 14px; color: var(--text);
}
.ls-panel-foot a {
  font-family: var(--font-display); letter-spacing: .06em;
  color: var(--gold-link); text-decoration: none; margin-left: 4px;
}
.ls-panel-foot a:hover { text-decoration: underline; }

/* Centre a panel in the page */
.ls-panel-page {
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  display: flex; align-items: center; justify-content: center;
  padding: 96px 20px 60px;
}
.ls-panel-page .ls-panel { width: 100%; max-width: 684px; }

/* ---------------- Language picker (login header) ---------------- */
.ls-lang {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
  height: 50px; padding: 0 16px;
  background: transparent; border: 1px solid rgba(158,131,84,.55);
  border-radius: 26px; color: var(--text);
  font-family: var(--font-ui); font-size: 14px; cursor: pointer;
}
.ls-lang:hover { border-color: var(--gold); }
.ls-lang img.g { width: 22px; } .ls-lang img.c { width: 14px; opacity: .8; }

@media (max-width: 900px) {
  .ls-panel { border-width: 22px; border-image-slice: 76; padding: 6px 18px 28px; }
  .ls-crest { width: 120px; height: 95px; top: -54px; }
  .ls-panel-head { padding-top: 48px; }
  .ls-panel-page { padding: 70px 22px 44px; min-height: calc(100vh - 72px - var(--footer-h)); }
  .ls-social { width: 64px; height: 58px; }
  .ls-or { margin: 20px 0 16px; font-size: 11.5px; letter-spacing: .12em; }
}

/* ---------------- Form feedback ---------------- */
.ls-formmsg {
  display: none; margin-top: 18px; padding: 12px 16px;
  border-radius: var(--radius); font-family: var(--font-ui); font-size: 14px;
  line-height: 1.5; text-align: left;
}
.ls-formmsg.is-on { display: block; }
.ls-formmsg.err  { background: rgba(120,16,16,.30); border: 1px solid rgba(214,78,78,.55); color: #F3C9C4; }
.ls-formmsg.ok   { background: rgba(20,80,48,.30);  border: 1px solid rgba(80,180,120,.45); color: #C6EBD4; }
.ls-formmsg.warn { background: rgba(96,70,12,.30);  border: 1px solid rgba(229,176,60,.45); color: #F0DCAE; }
.ls-formmsg a { color: var(--gold-link); }

.ls-cta[disabled], .ls-cta.is-busy { opacity: .6; pointer-events: none; }

@media (max-width: 900px) {
  .ls-footer { padding: 16px 22px; justify-content: center; text-align: center; }
  .ls-footer::before { width: 68%; }
  .ls-footer nav { justify-content: center; gap: 18px; }
}

/* ---------------- Textarea (contact form) ---------------- */
.ls-input.area { height: auto; align-items: flex-start; padding: 12px 14px; }
.ls-input.area img { margin-top: 4px; }
.ls-input textarea {
  flex: 1 1 auto; min-width: 0; min-height: 132px; resize: vertical;
  background: none; border: 0; outline: none; color: var(--text);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.6;
}
.ls-input textarea::placeholder { color: #7F8A95; }

/* ============================================================
   SCROLL RAIL — a thin gold line with a FIXED-LENGTH slider button.

   A native scrollbar thumb is sized by the browser in proportion to how
   much content there is; min-height only sets a floor. There is no way to
   pin it to one length. So the native bar is hidden and site.js renders
   this rail instead: the line stays 1px (the same weight as the panel and
   card borders) and the button is always --rail-thumb-h tall, wherever the
   page is and however long it gets.

   Native scrolling is untouched — wheel, touch, keyboard and find-on-page
   all behave normally; this only replaces the visuals and adds dragging.
   ============================================================ */
:root {
  --rail-w: 14px;        /* button thickness */
  --rail-thumb-h: 96px;  /* FIXED button length */
}

/* Hide the native bar (the rail replaces it). */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; }

.ls-rail {
  position: fixed; z-index: 60;
  top: calc(var(--header-h) + 10px); right: 8px; bottom: 10px;
  width: var(--rail-w);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.ls-rail.is-on { opacity: 1; visibility: visible; }

/* The line itself: 1px, same weight as the box borders. */
.ls-rail::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px; background: var(--gold-dim);
}

.ls-rail-thumb {
  position: absolute; left: 0; top: 0;
  width: var(--rail-w); height: var(--rail-thumb-h);
  padding: 0; border-radius: calc(var(--rail-w) / 2);
  background: linear-gradient(180deg, #F6DFA4 0%, #E0B65C 52%, #C79A3F 100%);
  border: 1px solid #6E5520;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 4px rgba(0,0,0,.45);
  cursor: grab; touch-action: none;
}
/* Three grip lines, so it reads as a button rather than a bar. */
.ls-rail-thumb::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 9px;
  background:
    linear-gradient(#6E5520, #6E5520) 0 0 / 6px 1px no-repeat,
    linear-gradient(#6E5520, #6E5520) 0 4px / 6px 1px no-repeat,
    linear-gradient(#6E5520, #6E5520) 0 8px / 6px 1px no-repeat;
  opacity: .65;
}
.ls-rail-thumb:hover { filter: brightness(1.08); }
.ls-rail-thumb.is-drag { cursor: grabbing; filter: brightness(.96); }
.ls-rail-thumb:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

@media (max-width: 900px) {
  /* right:0 so the 14px rail sits inside the page's 14px side padding and
     never overlaps the panels. */
  .ls-rail { top: 82px; right: 0; }
  :root { --rail-thumb-h: 76px; }
}

/* ---------------- Already-signed-in notice + secondary actions ----------
   Shared computers and second devices need an obvious way to leave someone
   else's session, and a new visitor needs a real Create Account choice
   rather than a footnote. */
.ls-whoami {
  margin-top: 20px; padding: 14px 16px;
  background: rgba(229,176,60,.07);
  border: 1px solid rgba(158,131,84,.45);
  border-radius: var(--radius); text-align: center;
}
.ls-whoami .who {
  font-family: var(--font-ui); font-size: 14px; color: var(--text); margin: 0 0 12px;
}
.ls-whoami .who strong { color: var(--gold); font-weight: 600; }
.ls-whoami .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Outlined secondary action, used for Continue / switch user / create account */
.ls-alt {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; cursor: pointer; text-decoration: none;
  font-family: var(--font-display); font-size: 14px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-pale);
  background: rgba(11,22,28,.55); border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.ls-alt:hover { border-color: var(--gold); color: var(--gold); background: rgba(229,176,60,.09); }
.ls-alt.block { display: flex; width: 100%; padding: 14px 18px; }
