/*
  Libya Business — sign-in.
  Idea: the country itself as the product. Libya drawn as a stippled map, its cities
  joined by delivery routes that light up when the page opens, parcels travelling on them.
  Palette from the LY-BIZ logo: its orange (#F8941D) is the one signal colour and its
  cream (#FFFAF4) is the light paper; deep night blue is orange's complement for the
  map and the dark mode. Type: Noto Kufi Arabic for the voice, Almarai for reading.
*/
:root {
  --ink: #0b2433;
  --ink-2: #12394a;
  --dune: #e8cfa0;
  --signal: #f8941d;
  --signal-deep: #df7f0b;
  --paper: #fffaf4;
  --field: #ffffff;
  --text: #10222c;
  --title: #0b2433;
  --muted: #5e6a70;
  --line: #e7dccd;
  --chip: #f4ebdf;
  --chip-hover: #ecdfcd;
  --danger: #a3330c;
  --danger-bg: #fdeee6;
  --kufi: "LB Kufi", "LB Text", "Segoe UI", sans-serif;
  --body: "LB Text", "Segoe UI", "Helvetica Neue", sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --paper: #0d1f2a;
  --field: #0a1922;
  --text: #e9eef0;
  --title: #fffaf4;
  --muted: #9aabb3;
  --line: #24404f;
  --chip: #16303e;
  --chip-hover: #1d3b4b;
  --danger: #ff9b74;
  --danger-bg: rgba(255, 120, 80, .12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.lb-login {
  font-family: var(--body);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.lb-shell {
  display: grid;
  grid-template-columns: minmax(400px, 41%) 1fr;
  min-height: 100vh;
}

/* ── Sign-in panel ─────────────────────────────────────────────────────────── */
.lb-panel {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vw, 56px) clamp(24px, 5vw, 72px);
  background: var(--paper);
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lb-top form { margin: 0; }
.lb-tools { display: flex; align-items: center; gap: 8px; }
.lb-logo { height: 52px; width: auto; border-radius: 12px; }
html[data-theme="dark"] .lb-logo { box-shadow: 0 0 0 1px rgba(255, 250, 244, .12); }
.lb-theme {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--title);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.lb-theme:hover { border-color: var(--title); }
.lb-theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lb-icon-moon { fill: currentColor !important; stroke: none !important; }
html[data-theme="dark"] .lb-icon-moon, html:not([data-theme="dark"]) .lb-icon-sun { display: none; }
.lb-lang {
  font: 700 14px var(--body);
  color: var(--title);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.lb-lang:hover { border-color: var(--title); }

.lb-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  padding: 40px 0;
}
.lb-title {
  font-family: var(--kufi);
  font-weight: 700;
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--title);
}
html[lang="en"] .lb-title { line-height: 1.15; letter-spacing: -0.01em; }
.lb-lede { font-size: 16px; line-height: 1.75; color: var(--muted); margin: 0 0 36px; max-width: 38ch; }

.lb-form { display: grid; gap: 20px; }
.lb-field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}
.lb-field input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  font: 400 17px var(--body);
  color: var(--text);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lb-field input::placeholder { color: #9aa7ad; }
.lb-field input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 4px rgba(247, 147, 30, .25);
}
.lb-field input[aria-invalid="true"] { border-color: var(--danger); }

.lb-secret { position: relative; }
.lb-secret input { padding-inline-end: 84px; }
.lb-reveal {
  position: absolute;
  inset-block: 8px;
  inset-inline-end: 8px;
  padding: 0 14px;
  font: 700 13px var(--body);
  color: var(--title);
  background: var(--chip);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.lb-reveal:hover { background: var(--chip-hover); }

.lb-submit {
  margin-top: 8px;
  height: 58px;
  font: 700 18px var(--kufi);
  color: var(--ink);
  background: var(--signal);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.lb-submit:hover { background: #ffa33a; }
.lb-submit:active { transform: translateY(1px); background: var(--signal-deep); }
.lb-submit.is-busy { opacity: .75; cursor: progress; }

.lb-lang:focus-visible, .lb-reveal:focus-visible, .lb-submit:focus-visible, .lb-theme:focus-visible {
  outline: 3px solid var(--title);
  outline-offset: 3px;
}

.lb-alert {
  padding: 14px 16px;
  border-radius: 12px;
  border-inline-start: 4px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  font-size: 15px;
}
.lb-alert p { margin: 0; }

.lb-foot { font-size: 13px; color: var(--muted); }

/* ── The map stage ─────────────────────────────────────────────────────────── */
.lb-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 4vw, 64px);
  background:
    radial-gradient(90% 70% at 70% 8%, rgba(30, 90, 107, .55) 0%, rgba(30, 90, 107, 0) 60%),
    linear-gradient(180deg, #0e2d3e 0%, var(--ink) 55%, #081b26 100%);
  color: var(--dune);
}
.lb-sea {
  margin: 0;
  text-align: center;
  font-family: var(--kufi);
  font-size: 15px;
  color: rgba(232, 207, 160, .38);
}
html[lang="en"] .lb-sea { letter-spacing: .3em; font-family: var(--body); font-size: 13px; }
.lb-motto {
  align-self: stretch;
  margin: 0;
  max-width: 28ch;
  font-family: var(--kufi);
  font-weight: 700;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.6;
  color: #f6ecdc;
}
html[lang="en"] .lb-motto { line-height: 1.25; max-width: 22ch; }

.ln-map { flex: 1; width: min(100%, 820px); min-height: 0; max-height: 70vh; overflow: visible; }

#ln-dots circle { fill: var(--dune); opacity: .34; }
.ln-border { fill: none; stroke: var(--dune); stroke-opacity: .55; stroke-width: 1.3; stroke-linejoin: round; }
.ln-route { fill: none; stroke: var(--signal); stroke-width: 1.7; stroke-linecap: round; }
.ln-routes-glow use { fill: none; stroke: var(--signal); stroke-width: 6; stroke-opacity: .32; }
.ln-parcels circle { fill: #fff6e6; }
.ln-dot { fill: #fff3df; }
.ln-hub .ln-dot { fill: var(--signal); stroke: #fff3df; stroke-width: 1.5; }
.ln-ring { fill: none; stroke: var(--signal); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; }
.ln-city text {
  font: 700 13px var(--body);
  fill: rgba(246, 236, 220, .88);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--ink);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ln-hub text { font-size: 15px; fill: #fff6e6; }
.ln-home .ln-dot { r: 5.5px; }
.ln-home text { font-size: 18px; fill: var(--signal); }

/* One orchestrated opening: the coast is traced, then the routes light up city by city. */
@media (prefers-reduced-motion: no-preference) {
  .ln-border { stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: ln-trace 2.2s cubic-bezier(.6, 0, .2, 1) .1s forwards; }
  .ln-land rect { opacity: 0; animation: ln-fade 1.4s ease .5s forwards; }
  .ln-route, .ln-routes-glow use {
    stroke-dasharray: 100; stroke-dashoffset: 100;
    animation: ln-draw .9s cubic-bezier(.5, 0, .3, 1) forwards;
    animation-delay: calc(1.1s + var(--i) * .11s);
  }
  .ln-city { opacity: 0; animation: ln-fade .6s ease forwards; animation-delay: 1s; }
  .ln-hub { animation-delay: .9s; }
  .ln-home { animation-delay: .2s; }
  .ln-ring { animation: ln-pulse 2.8s ease-out 3s infinite; }
  .ln-parcels { opacity: 0; animation: ln-fade .8s ease 2.6s forwards; }
  .lb-motto { opacity: 0; animation: ln-fade 1s ease 2.4s forwards; }
}
@media (prefers-reduced-motion: reduce) {
  .ln-parcels { display: none; }
}
@keyframes ln-trace { to { stroke-dashoffset: 0; } }
@keyframes ln-draw { to { stroke-dashoffset: 0; } }
@keyframes ln-fade { to { opacity: 1; } }
@keyframes ln-pulse {
  0% { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}

/* ── Small screens: the map becomes a band above the form ──────────────────── */
@media (max-width: 960px) {
  .lb-shell { grid-template-columns: 1fr; }
  .lb-stage { order: -1; min-height: 36vh; padding: 24px 16px 12px; justify-content: center; }
  .ln-map { width: min(80%, 420px); max-height: 32vh; }
  .lb-sea, .lb-motto { display: none; }
  .lb-body { max-width: none; padding: 28px 0; }
  .lb-panel { padding-top: 20px; }
}
