/* Layang Layang — sign-in page. Self-hosted, CSP-safe (no inline styles).
   Palette and type mirror the tokens at the top of app.css. */

:root {
  --navy-950: #0B1628;
  --navy-900: #10213A;
  --navy-800: #172A45;
  --navy-700: #1E3A66;
  --gold-700: #7A5A1E;
  --gold-500: #C49A45;
  --gold-400: #D6B46E;
  --gold-300: #E8D7B0;
  --gold-50:  #FBF7EE;
  --ink: #172033;
  --ink-2: #3A4558;
  --muted: #526173;
  --line: #E3E5E8;
  --line-strong: #CDD1D7;
  --canvas: #F6F5F1;
  --danger-bg: #FCECEA; --danger-fg: #8E1B10; --danger-line: #F1B9B2;
  --success-bg: #E8F5EC; --success-fg: #155C2B; --success-line: #A8D8B5;
  --warning-bg: #FFF6E3; --warning-fg: #7A4A00; --warning-line: #EFCF8C;
  --info-bg: #EEF2F8;    --info-fg: #1E3A66;    --info-line: #C5CEDB;
  --ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #1E3A66;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.portal-body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
a { color: var(--navy-700); }
code {
  padding: .05rem .35rem;
  border-radius: 5px;
  background: rgba(15, 29, 53, .07);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
}

/* ---------------------------------------------------------------- layout */
.portal {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr);
}

/* ---------------------------------------------------------------- brand side */
.showcase {
  position: relative;
  overflow: hidden;
  color: #FFF;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(196, 154, 69, .20) 0%, rgba(196, 154, 69, 0) 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(43, 76, 128, .55) 0%, rgba(43, 76, 128, 0) 60%),
    linear-gradient(160deg, #13243F 0%, #10213A 45%, #0B1628 100%);
}
.showcase-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.showcase-inner {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(2rem, 4.5vw, 4rem);
}
.brand { display: inline-block; width: clamp(220px, 22vw, 300px); }
.ll-logo, .ll-logo img { display: block; width: 100%; height: auto; }

.showcase-copy { max-width: 34rem; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--gold-400);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--gold-400); }
.showcase-title {
  margin: 1rem 0 1.1rem;
  font-family: var(--display);
  font-size: clamp(2.75rem, 5.2vw, 4.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.01em;
}
.showcase-title em {
  font-style: italic;
  background: linear-gradient(100deg, #EBDDB9 0%, #D6B46E 45%, #C49A45 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.showcase-lede { max-width: 30rem; margin: 0 0 2rem; color: rgba(255, 255, 255, .74); font-size: 1.02rem; }
.trust { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.trust li { display: flex; align-items: center; gap: .75rem; color: rgba(255, 255, 255, .86); font-size: .92rem; }
.trust svg {
  width: 34px; height: 34px; padding: 8px; flex: none;
  border: 1px solid rgba(205, 184, 142, .35);
  border-radius: 10px;
  color: var(--gold-400);
  background: rgba(255, 255, 255, .04);
}
.showcase-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .62);
  font-size: .8rem;
}
.showcase-foot a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.showcase-foot a:hover { color: #FFF; text-decoration: underline; }

/* ---------------------------------------------------------------- form side */
.panel {
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: #F6F5F1;
}
.panel-inner { width: min(100%, 420px); }
.panel-brand { display: none; width: 210px; margin: 0 auto 1.75rem; }

.switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.switch-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  background: #FFF;
  box-shadow: 0 1px 2px rgba(15, 29, 53, .08), 0 4px 12px -4px rgba(15, 29, 53, .16);
  transition: transform .22s ease;
}
.switch[data-mode="admin"] .switch-thumb { transform: translateX(100%); }
.switch-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: 600 .9rem var(--font);
  cursor: pointer;
}
.switch-btn svg { width: 17px; height: 17px; }
.switch-btn.is-active { color: var(--navy-900); }
.switch-btn:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; }

.head { margin: 2rem 0 1.5rem; }
.head h1 {
  margin: 0 0 .4rem;
  color: var(--navy-900);
  font-family: var(--display);
  font-size: 2.35rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.005em;
}
.head p { margin: 0; color: var(--muted); }

.alert {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: .8rem .95rem;
  border: 1px solid var(--danger-line);
  border-radius: 10px;
  color: var(--danger-fg);
  background: var(--danger-bg);
  font-size: .9rem;
}
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-line); }
.alert-warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-line); }
.alert-info    { color: var(--info-fg);    background: var(--info-bg);    border-color: var(--info-line); }

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: .4rem; color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.link { color: var(--navy-700); font-size: .85rem; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 2px; border-radius: 4px; }
.control { position: relative; }
.control .lead {
  position: absolute; left: 14px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: #8A94A6;
  pointer-events: none;
}
.control input {
  width: 100%;
  min-height: 50px;
  padding: .75rem 2.9rem .75rem 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: #FFF;
  font: 400 1rem var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.control input::placeholder { color: #98A1B0; }
.control input:hover { border-color: #AEB8C7; }
.control input:focus { outline: 0; border-color: var(--navy-700); box-shadow: var(--ring); }
.control input:focus ~ .lead,
.control:focus-within .lead { color: var(--navy-700); }
.pw-toggle {
  position: absolute; right: 6px; top: 50%;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  transform: translateY(-50%);
  border: 0; border-radius: 8px;
  color: #8A94A6; background: transparent;
  cursor: pointer;
}
.pw-toggle svg { width: 19px; height: 19px; }
.pw-toggle:hover { color: var(--navy-700); background: var(--canvas); }
.pw-toggle:focus-visible { outline: 2px solid var(--navy-700); outline-offset: 0; }

.btn-primary {
  position: relative;
  width: 100%;
  min-height: 50px;
  margin-top: .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  border: 1px solid #A57F33;
  border-radius: 8px;
  color: #172033;
  background: linear-gradient(180deg, #D2AB58 0%, #C49A45 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(16, 33, 58, .12);
  font: 600 .98rem var(--font);
  cursor: pointer;
  transition: filter .15s ease, box-shadow .15s ease
}
.btn-primary::after {
  content: none
}
.btn-primary:hover {
  border-color: #8C6A27;
  background: linear-gradient(180deg, #C9A04D 0%, #B88C38 100%)
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #1E3A66
}
.btn-primary .arrow { width: 18px; height: 18px; transition: transform .15s ease; }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-primary .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(23, 32, 51, .25);
  border-top-color: #172033;
  border-radius: 50%;
  animation: spin .7s linear infinite
}
.btn-primary.is-loading { cursor: progress; filter: saturate(.8); }
.btn-primary.is-loading .spinner { display: inline-block; }
.btn-primary.is-loading .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  display: flex;
  gap: .65rem;
  margin-top: 1.5rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-2);
  background: var(--canvas);
  font-size: .86rem;
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--navy-700); }
.notice--admin { border-color: #E9DFC9; background: var(--gold-50); }
.notice--admin svg { color: var(--gold-700); }
.notice--demo { margin-top: .75rem; border-color: var(--warning-line); background: var(--warning-bg); color: var(--warning-fg); }
.notice--demo svg { color: var(--warning-fg); }

.foot-links { margin: 1.25rem 0 0; color: var(--muted); font-size: .86rem; text-align: center; }
.foot-links a { font-weight: 600; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.credit { margin: 2rem 0 0; color: #8A94A6; font-size: .78rem; text-align: center; }
.credit a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.credit a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .portal { grid-template-columns: minmax(0, 1fr) minmax(400px, 1fr); }
  .showcase-title { font-size: clamp(2.4rem, 5vw, 3.4rem); }
}
@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; }
  .showcase-inner { gap: 1.5rem; padding: 1.5rem 1.25rem 1.75rem; }
  .brand { width: 210px; }
  .showcase-title { margin: .6rem 0 .5rem; font-size: 2.3rem; }
  .showcase-lede { margin-bottom: 0; font-size: .95rem; }
  .trust, .showcase-foot { display: none; }
  .panel { place-items: start center; padding: 2rem 1rem 2.5rem; }
  .head { margin-top: 1.5rem; }
  .head h1 { font-size: 2rem; }
}
@media (max-width: 420px) {
  .showcase-copy .eyebrow, .showcase-lede { display: none; }
  .showcase-title { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Executive refinement: the form sits on a white card on the warm workspace. */
.panel-inner {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FFF;
  box-shadow: 0 1px 2px rgba(16, 33, 58, .04), 0 12px 28px -14px rgba(16, 33, 58, .16);
}
.switch { background: #F1F0EB; }
.head h1 { font-size: 2.1rem; }
@media (max-width: 860px) {
  .panel { padding: 1.25rem 1rem 2rem; }
  .panel-inner { padding: 22px 18px; }
}
