﻿:root {
  --bg: #0b1020;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.65);
  --border: rgba(255, 255, 255, 0.15);
  --border-press: rgba(255, 255, 255, 0.42);
  --radius: 12px;
  --panel: rgba(255, 255, 255, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  overflow-x: hidden;
}

a {
  color: #6ee7ff;
  text-decoration: none;
}

.header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container {
  padding: 24px;
  width: min(100%, 1200px);
  margin: 0 auto;
}

.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  font-weight: 500;
  line-height: 1.2;
  touch-action: manipulation;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: #6ee7ff;
  color: #000;
  border: none;
}

.btn-ghost {
  background: transparent;
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn:active:not([disabled]):not([aria-disabled="true"]),
.tab-btn:active:not([disabled]),
.subtab-btn:active:not([disabled]),
.wizard-tab:active:not([disabled]) {
  border-color: var(--border-press);
}

.btn:focus-visible,
.tab-btn:focus-visible,
.subtab-btn:focus-visible,
.wizard-tab:focus-visible {
  outline: 2px solid rgba(110, 231, 255, 0.6);
  outline-offset: 1px;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.forms-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.forms-table th,
.forms-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.forms-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
}

.forms-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* page centering */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* center main content vertically + horizontally */
main.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
}

/* footer stays centered */
.login-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  opacity: 0.7;
}

main.container h1 {
  margin-bottom: 10px;
}

main.container p {
  margin: 6px 0;
}

main.container a {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 18px;
  border-radius: 6px;
  background: #2f6fed;
  color: white;
  text-decoration: none;
  font-weight: 500;
}

main.container a:hover {
  background: #1f55c5;
}

/* index page ribbon and menu */
.index-page {
  position: relative;
}

.index-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 28, 0.85);
}

.index-ribbon-title {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.index-menu {
  position: relative;
}

.index-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1;
  font-size: 1.1rem;
  user-select: none;
}

.index-menu summary::-webkit-details-marker {
  display: none;
}

.index-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: #101933;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 10;
}

.index-menu-panel a {
  display: block;
  margin: 0;
  padding: 10px 12px;
  background: transparent;
  border-radius: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.index-menu-panel a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.index-hero {
  gap: 8px;
  padding-top: 36px;
}

.index-hero p {
  max-width: 720px;
}

.index-copyright {
  opacity: 0.7;
  margin-top: 10px;
  font-size: 0.95rem;
}

/* index animated stage */
.index-page {
  --index-bg: #0b0f14;
  --index-fg: #e9eef5;
  --index-cycle: 12s;
  --index-brand-overhead: clamp(-238px, -28vh, -188px);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: radial-gradient(1200px 700px at 50% 35%, #121a24 0%, var(--index-bg) 55%, #070a0e 100%);
}

.index-ribbon {
  z-index: 2;
}

.index-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.index-frame {
  width: min(980px, 92vw);
  min-height: 440px;
  position: relative;
}

.index-text {
  color: var(--index-fg);
}

.index-brand {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: clamp(46px, 7vw, 84px);
  letter-spacing: 0.04em;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: indexBrandPhase var(--index-cycle) infinite linear;
}

@keyframes indexBrandPhase {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  7.5% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  10% {
    transform: translateY(-26px) scale(0.92);
    opacity: 0;
  }
  54.9% {
    transform: translateY(-26px) scale(0.92);
    opacity: 0;
  }
  55% {
    transform: translateY(var(--index-brand-overhead)) scale(0.62);
    opacity: 0;
  }
  63% {
    transform: translateY(var(--index-brand-overhead)) scale(0.62);
    opacity: 1;
  }
  90.6% {
    transform: translateY(var(--index-brand-overhead)) scale(0.62);
    opacity: 1;
  }
  100% {
    transform: translateY(var(--index-brand-overhead)) scale(0.62);
    opacity: 0;
  }
}

.index-split {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: indexSplitPhase var(--index-cycle) infinite linear;
}

@keyframes indexSplitPhase {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  12.5% {
    opacity: 0;
    transform: translateY(8px);
  }
  25% {
    opacity: 1;
    transform: translateY(0);
  }
  99.9% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

.index-seg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(320px, 92vw);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  padding: 20px 18px 18px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  animation: indexFanOut var(--index-cycle) infinite cubic-bezier(0.22, 0.9, 0.22, 1);
}

.index-seg-left {
  --x0: -360px;
  --y0: 0px;
  --x1: -180px;
  --y1: -130px;
  --x2: 0px;
  --y2: -130px;
  text-align: left;
}

.index-seg-mid {
  --x0: 0px;
  --y0: 0px;
  --x1: 0px;
  --y1: 0px;
  --x2: 0px;
  --y2: 0px;
  text-align: center;
}

.index-seg-right {
  --x0: 360px;
  --y0: 0px;
  --x1: 180px;
  --y1: 130px;
  --x2: 0px;
  --y2: 130px;
  text-align: right;
}

@keyframes indexFanOut {
  0% {
    transform: translate(-50%, -50%) translate(var(--x0), var(--y0));
    opacity: 1;
  }
  25% {
    transform: translate(-50%, -50%) translate(var(--x0), var(--y0));
    opacity: 1;
  }
  40% {
    transform: translate(-50%, -50%) translate(var(--x1), var(--y1));
    opacity: 1;
  }
  55% {
    transform: translate(-50%, -50%) translate(var(--x1), var(--y1));
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
    opacity: 1;
  }
  90.6% {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
    opacity: 0;
  }
}

.index-word {
  font-weight: 600;
  font-size: clamp(18px, 2.1vw, 24px);
  margin: 0 0 6px;
}

.index-word .index-lat {
  font-weight: 900;
  font-size: 1.18em;
  letter-spacing: 0.02em;
}

.index-desc {
  margin: 0;
  line-height: 1.55;
  font-size: 14.5px;
}

.index-seg,
.index-seg * {
  color: var(--index-fg) !important;
}

.index-seg::before {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 65%
  );
  transform: translateX(-45%) rotate(8deg);
  opacity: 0;
  pointer-events: none;
  animation: indexGlisten var(--index-cycle) infinite linear;
}

@keyframes indexGlisten {
  0% {
    opacity: 0.6;
    transform: translateX(-45%) rotate(8deg);
  }
  50% {
    opacity: 0.6;
    transform: translateX(70%) rotate(8deg);
  }
  100% {
    transform: translateX(-45%) rotate(8deg);
    opacity: 0.6;
  }
}

.index-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* About page should scroll naturally and read as long-form content. */
.about-page {
  overflow-y: auto;
}

.about-page main.container.index-hero {
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  max-width: 900px;
  width: 100%;
  padding-top: 28px;
  padding-bottom: 40px;
}

.about-page main.container.index-hero ul {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

@media (max-width: 900px) {
  .index-seg-left {
    --x0: -120px;
    --x1: -70px;
    --y1: -110px;
    --y2: -110px;
  }

  .index-seg-mid {
    --x0: 0px;
  }

  .index-seg-right {
    --x0: 120px;
    --x1: 70px;
    --y1: 110px;
    --y2: 110px;
  }

  .index-seg {
    width: min(420px, 92vw);
  }
}

/* shared app ribbon + hamburger menu */
.app-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 28, 0.85);
}

.app-ribbon-title {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.app-menu {
  position: relative;
}

.app-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1;
  font-size: 1.1rem;
  user-select: none;
}

.app-menu summary::-webkit-details-marker {
  display: none;
}

.app-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #101933;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 10;
}

.app-menu-panel a {
  display: block;
  margin: 0;
  padding: 10px 12px;
  background: transparent;
  border-radius: 0;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.app-menu-panel a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.is-hidden {
  display: none !important;
}

.loading-indicator {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #6ee7ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header,
  .app-ribbon,
  .index-ribbon {
    padding: 10px 12px;
  }

  .app-menu-panel,
  .index-menu-panel {
    min-width: 150px;
  }

  .app-ribbon-title,
  .index-ribbon-title {
    max-width: calc(100vw - 86px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 820px) {
  .index-brand {
    opacity: 1;
    animation: none;
    inset: auto 0 auto 0;
    top: 10px;
    display: block;
    text-align: center;
    transform: none;
    font-size: clamp(34px, 8vw, 50px);
  }

  .index-split {
    opacity: 1;
    animation: none;
    transform: translateY(0);
    inset: 72px 0 0 0;
  }

  .index-seg {
    animation: none;
  }

  .index-seg-left {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
  }

  .index-seg-mid {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
  }

  .index-seg-right {
    transform: translate(-50%, -50%) translate(var(--x2), var(--y2));
  }

  .index-seg::before {
    animation: indexGlisten var(--index-cycle) infinite linear;
    opacity: 0.6;
  }

  .index-foot {
    opacity: 0.8;
    animation: none;
  }
}
