/* Tip X — login page. Uses tokens.css (light/dark). Fallbacks keep it usable if tokens fail. */

*, *::before, *::after { box-sizing: border-box; }
:root { --lg-font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg, #F5F3EE);
  color: var(--ink, #15171C);
  font-family: var(--lg-font);
  font-size: var(--fs-base, 15px);
  line-height: var(--lh, 1.6);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.lg {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}

/* ---------- form side ---------- */
.lg-main {
  display: grid;
  place-items: center;
  padding: var(--s-8, 40px) var(--s-6, 24px);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
.lg-wrap { width: 100%; max-width: 640px; }
.lg-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--s-7, 32px); }
.lg-brand { display: flex; align-items: center; gap: var(--s-3, 12px); color: inherit; text-decoration: none; border-radius: 10px; }
.lg-brand:focus-visible, .lg-back:focus-visible { outline: 2px solid var(--focus, #0E5A63); outline-offset: 3px; }
.lg-back { font-size: var(--fs-sm, 13.5px); font-weight: 500; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.lg-back:hover { color: var(--accent); text-decoration-color: currentColor; }
.lg-brand img { border-radius: 10px; display: block; }
.lg-word { font-family: var(--lg-font); font-weight: 800; font-size: 22px; letter-spacing: .01em; }

.lg-title {
  font-family: var(--lg-font);
  font-weight: 700;
  font-size: var(--fs-3xl, 38px);
  line-height: var(--lh-tight, 1.2);
  margin: 0 0 var(--s-2, 8px);
}
.lg-lead { margin: 0 0 var(--s-7, 32px); color: var(--ink-2, #4A4F5A); font-size: var(--fs-md, 16.5px); max-width: 52ch; }

.lg-form { margin: 0; }
.lg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4, 16px); }

.lg-role {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  gap: var(--s-3, 12px) var(--s-4, 16px);
  align-items: start;
  min-height: 168px;
  padding: var(--s-6, 24px) var(--s-5, 20px) var(--s-5, 20px);
  text-align: right;
  font: inherit;
  color: var(--ink, #15171C);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #E5E0D6);
  border-radius: var(--r-card, 14px);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--t-fast, 140ms) var(--ease), transform var(--t, 220ms) var(--ease-out), box-shadow var(--t, 220ms) var(--ease-out);
}
.lg-role::before {               /* the one brass line, revealed on hover/focus */
  content: "";
  position: absolute;
  inset-inline: var(--s-5, 20px);
  top: 0;
  height: 2px;
  background: var(--brass, #A97B2F);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t, 220ms) var(--ease-out);
}
.lg-role:hover { border-color: var(--line-2, #D6CFC2); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.lg-role:hover::before, .lg-role:focus-visible::before, .lg-role.is-busy::before { transform: scaleX(1); }
.lg-role:focus-visible { outline: 3px solid var(--focus, #0E5A63); outline-offset: 2px; }
.lg-role:active { transform: translateY(0); }
.lg-role[disabled] { opacity: .45; cursor: default; transform: none; box-shadow: var(--shadow); }
.lg-role.is-busy { border-color: var(--accent); cursor: progress; }

.lg-ico {
  grid-row: 1 / span 2;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft, #E3EEEE);
  color: var(--accent, #0E5A63);
}
.lg-role-body { display: grid; gap: 4px; grid-row: 1 / span 2; }
.lg-role-name { font-family: var(--lg-font); font-weight: 700; font-size: var(--fs-lg, 19px); line-height: 1.25; }
.lg-role-person { font-size: var(--fs-sm, 13.5px); color: var(--brass-ink, #7D5A1E); font-weight: 500; }
.lg-role-what { margin-top: 6px; font-size: var(--fs-sm, 13.5px); color: var(--ink-2, #4A4F5A); line-height: 1.55; }
.lg-role-what b { font-weight: 600; color: var(--ink); }
.lg-go {
  position: absolute;
  left: var(--s-4, 16px);
  top: var(--s-5, 20px);
  color: var(--muted);
  transition: transform var(--t, 220ms) var(--ease-out), color var(--t-fast) var(--ease);
}
.lg-role:hover .lg-go, .lg-role:focus-visible .lg-go { color: var(--accent); transform: translateX(-3px); }
.lg-role.is-busy .lg-go { animation: lg-pulse 900ms var(--ease) infinite alternate; color: var(--accent); }
@keyframes lg-pulse { to { transform: translateX(-6px); opacity: .5; } }

.lg-status {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: var(--s-4, 16px);
  padding: 10px 12px;
  border-radius: var(--r-ctl, 10px);
  background: var(--accent-tint, #F0F6F5);
  border: 1px solid var(--accent-soft, #E3EEEE);
  color: var(--accent-ink, #0A434A);
  font-size: var(--fs-sm, 13.5px);
  font-weight: 500;
}
.lg-status::before { content: "›"; font-weight: 700; }
.lg-status.is-error { background: var(--crit-bg, #FCEBE9); border-color: var(--crit-line, #F2C7C2); color: var(--crit, #B42318); }
.lg-status.is-error::before { content: "✕"; }   /* icon + words, never colour alone */
.lg-status[hidden] { display: none; }

.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; }

.lg-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: var(--s-6, 24px) 0 0;
  padding-top: var(--s-4, 16px);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs, 12px);
  color: var(--muted);
}
.lg-note svg { flex: none; margin-top: 1px; }

/* ---------- editorial side ---------- */
.lg-aside {
  background: #15171C;
  color: #ECEDEF;
  display: grid;
  align-items: center;
  padding: var(--s-9, 56px);
  position: relative;
  overflow: hidden;
}
.lg-aside::after {               /* faint blueprint on ink */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(216,174,98,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,174,98,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}
.lg-aside-inner { position: relative; z-index: 1; max-width: 520px; }
.lg-kicker { margin: 0 0 var(--s-5, 20px); font-size: var(--fs-sm); letter-spacing: .02em; color: #D8AE62; font-weight: 500; }
.lg-quote {
  font-family: var(--lg-font);
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.15;
  margin: 0 0 var(--s-5, 20px);
}
.lg-sub { margin: 0 0 var(--s-8, 40px); color: #C3C7CE; font-size: var(--fs-md); max-width: 40ch; }

.lg-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: relative;
}
.lg-rail::before {
  content: "";
  position: absolute;
  top: 17px;
  inset-inline: 10%;
  height: 2px;
  background: linear-gradient(to left, #4FB3BC 0 62%, #D8AE62 62% 100%);
  opacity: .55;
}
.lg-rail li { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; font-size: var(--fs-sm); color: #ECEDEF; }
.lg-rail li em { display: block; font-style: normal; font-size: 12px; color: #959BA5; }
.lg-rail .dot {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700;
  background: #161A1F;
  border: 2px solid #4FB3BC;
  color: #4FB3BC;
}
.lg-rail .is-warn .dot { border-color: #D8AE62; color: #D8AE62; background: #2A2214; }
.lg-rail .is-wait .dot { border-color: #343A44; color: #959BA5; }
.lg-rail .is-warn em { color: #D8AE62; }

/* ---------- responsive ---------- */
@media (max-width: 1199px) and (min-width: 960px) {
  .lg { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .lg-aside { padding: var(--s-8, 40px); }
}
@media (max-width: 959px) {
  .lg { grid-template-columns: 1fr; }
  .lg-aside { display: none; }
}
@media (max-width: 759px) {
  .lg-main {
    place-items: start center;
    padding: max(var(--s-6, 24px), env(safe-area-inset-top)) 16px max(var(--s-6, 24px), env(safe-area-inset-bottom));
  }
  .lg-topline { margin-bottom: var(--s-5, 20px); }
  .lg-title { font-size: 30px; }
  .lg-lead { margin-bottom: var(--s-5, 20px); font-size: var(--fs-base); }
  .lg-cards { grid-template-columns: 1fr; gap: var(--s-3, 12px); }
  .lg-role { min-height: 0; padding: var(--s-4, 16px); }
  .lg-ico { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { transition: none !important; animation: none !important; }
  .lg-role:hover { transform: none; }
}
