/* Critical styles shared by the authentication gate and the modern entry. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("./fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --auth-bg: #f5f7f8;
  --auth-panel: #fff;
  --auth-ink: #1e2528;
  --auth-muted: #687277;
  --auth-line: #dce3e7;
  --auth-blue: #315f9b;
  --auth-shadow: 0 18px 45px rgb(37 48 56 / 8%);
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: "Plus Jakarta Sans", "Geist", "Satoshi", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select { font: inherit; }

button { cursor: pointer; }

.hidden { display: none !important; }

body.auth-pending {
  min-height: 100dvh;
  overflow: hidden;
}

.auth-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(7 26 68 / 96%), rgb(8 42 84 / 92%)),
    #071a44;
  color: #f7fbff;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-bg::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(255 255 255 / 8%);
  content: "";
}

.auth-bg::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.auth-beam {
  position: absolute;
  left: 50%;
  width: min(920px, 84vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(154 203 255 / 8%), rgb(154 203 255 / 72%), rgb(154 203 255 / 8%), transparent);
  opacity: .5;
  transform: translateX(-50%) rotate(var(--auth-beam-rotate));
  transform-origin: 50% 50%;
}

.auth-beam::after {
  position: absolute;
  inset: -20px 0;
  background: linear-gradient(90deg, transparent, rgb(154 203 255 / 12%), transparent);
  content: "";
  opacity: .62;
}

.auth-beam-one { --auth-beam-rotate: -12deg; top: 22%; }

.auth-beam-two {
  --auth-beam-rotate: 16deg;
  bottom: 18%;
  background: linear-gradient(90deg, transparent, rgb(127 221 209 / 8%), rgb(127 221 209 / 56%), rgb(127 221 209 / 8%), transparent);
}

.auth-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .72fr);
  align-items: center;
  gap: 56px;
  width: min(1120px, calc(100% - 40px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 42px 0;
}

.auth-copy { max-width: 660px; }

.auth-kicker {
  margin: 0 0 18px;
  color: #9cc7ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 10ch;
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 6.4vw, 82px);
  letter-spacing: 0;
  line-height: .98;
}

.auth-lede {
  max-width: 540px;
  margin: 22px 0 0;
  color: #c5d2e4;
  font-size: 17px;
  line-height: 1.65;
}

.auth-signal-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 34px;
  border: 1px solid rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 6%);
}

.auth-signal-board div {
  min-height: 102px;
  padding: 18px;
  border-right: 1px solid rgb(255 255 255 / 12%);
}

.auth-signal-board div:last-child { border-right: 0; }

.auth-signal-board span {
  display: block;
  color: #9fb0c7;
  font-size: 12px;
  font-weight: 700;
}

.auth-signal-board strong {
  display: block;
  margin-top: 18px;
  color: #fff;
  font-size: 15px;
}

.auth-panel {
  padding: 26px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 255 255 / 98%), rgb(246 250 253 / 96%)), #fff;
  color: #132027;
  box-shadow: 0 30px 80px rgb(0 0 0 / 32%);
}

.auth-panel-header { margin-bottom: 24px; }

.auth-panel-header p {
  margin: 0 0 7px;
  color: #315f9b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-panel-header h2 {
  margin: 0;
  color: #14202a;
  font-size: 30px;
  line-height: 1.08;
}

.auth-field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
  color: #26333a;
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #c9d4dc;
  border-radius: 6px;
  outline: 0;
  background: #f9fbfc;
  color: #132027;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-field input:focus {
  border-color: #315f9b;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(49 95 155 / 18%);
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: #123a73;
  color: #fff;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.auth-submit:hover { background: #0d3267; }
.auth-submit:active { transform: translateY(1px) scale(.99); }
.auth-submit:disabled { cursor: wait; opacity: .72; }

.auth-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: #687277;
  font-size: 13px;
  line-height: 1.45;
}

.auth-status[data-tone="error"] { color: #a53647; }
.auth-status[data-tone="muted"] { color: #315f9b; }

body:not(.auth-ready) .auth-copy,
body:not(.auth-ready) .auth-panel {
  opacity: 0;
  transform: translateY(14px);
}

body.auth-ready .auth-copy,
body.auth-ready .auth-panel {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease;
}

@media (prefers-reduced-motion: no-preference) {
  body.auth-ready .auth-beam-one { animation: authBeamDrift 14s ease-in-out infinite alternate; }
  body.auth-ready .auth-beam-two { animation: authBeamDrift 18s ease-in-out infinite alternate-reverse; }
}

@keyframes authBeamDrift {
  from { transform: translateX(-50%) translate3d(-18px, 0, 0) rotate(var(--auth-beam-rotate)); }
  to { transform: translateX(-50%) translate3d(18px, 0, 0) rotate(var(--auth-beam-rotate)); }
}

/* Loading progress remains visible while the modern runtime starts. */
.app-shell {
  position: relative;
  min-height: 100dvh;
}

.app-loading-skeleton {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--auth-bg);
  transition: opacity .35s ease, visibility .35s ease;
}

.app-loading .app-loading-skeleton {
  opacity: 1;
  visibility: visible;
}

.app-loading-skeleton {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: min(92%, 720px);
}

.skeleton-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 12px;
  background: var(--auth-panel);
  box-shadow: var(--auth-shadow);
}

.skeleton-heading {
  width: 55%;
  height: 18px;
  border-radius: 6px;
  background: var(--auth-line);
}

.skeleton-row {
  width: 100%;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--auth-line) 25%, var(--auth-panel) 50%, var(--auth-line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-row-short { width: 65%; }

.skeleton-message {
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--auth-line) 25%, var(--auth-panel) 50%, var(--auth-line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-message-alt { align-self: flex-end; width: 75%; }
.skeleton-input { height: 40px; margin-top: 6px; border-radius: 8px; background: var(--auth-line); }

.skeleton-status {
  margin: 0;
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.skeleton-progress { display: grid; gap: 9px; width: min(88%, 440px); }

.skeleton-progress-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
}

.skeleton-progress-percent { color: var(--auth-blue); font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1; }

.skeleton-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--auth-line);
  box-shadow: inset 0 1px 2px rgb(37 48 56 / 8%);
}

.skeleton-progress-value {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--auth-blue);
  transform: scaleX(.08);
  transform-origin: left center;
  transition: transform 520ms cubic-bezier(.32, .72, 0, 1);
}

.skeleton-progress-note {
  min-height: 15px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modern-app-error {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  color: #172b46;
  background: #f4f7fb;
}

.modern-app-error-card {
  width: min(100%, 520px);
  padding: 30px;
  border: 1px solid #d8e1ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 54px rgb(28 53 88 / 12%);
}

.modern-app-error-kicker {
  margin: 0 0 8px;
  color: #2468c7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.modern-app-error h2 { margin: 0; font-size: 24px; line-height: 1.2; }
.modern-app-error p:not(.modern-app-error-kicker) { color: #53667c; line-height: 1.55; }

.modern-app-error button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: #175fc3;
  color: #fff;
  font-weight: 800;
}

.modern-app-error button:focus-visible {
  outline: 3px solid #65b7ff;
  outline-offset: 3px;
}

@media (max-width: 860px) {
  body.auth-pending { overflow: auto; }
  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    width: min(100% - 28px, 520px);
    padding: 30px 0;
  }
  .auth-copy h1 { max-width: 11ch; font-size: clamp(36px, 12vw, 56px); }
  .auth-lede { font-size: 15px; line-height: 1.55; }
  .auth-signal-board { grid-template-columns: minmax(0, 1fr); }
  .auth-signal-board div { min-height: auto; border-right: 0; border-bottom: 1px solid rgb(255 255 255 / 12%); }
  .auth-signal-board div:last-child { border-bottom: 0; }
  .auth-panel { padding: 22px; }
}

@media (max-width: 640px) {
  .app-loading-skeleton { gap: 18px; padding: 20px 0; }
  .skeleton-grid { grid-template-columns: minmax(0, 1fr); width: min(92%, 440px); }
  .skeleton-section { padding: 20px; }
  .skeleton-progress { width: min(92%, 440px); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-skeleton,
  .skeleton-progress-value { transition: none; }
  .skeleton-row,
  .skeleton-message { animation: none; }
}
