html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ITO360 visual system */
:root {
  --app-bg: #070b14;
  --app-bg-deep: #050811;
  --surface: rgba(16, 24, 39, 0.86);
  --surface-raised: rgba(22, 32, 51, 0.88);
  --surface-muted: rgba(148, 163, 184, 0.08);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #f5f7fb;
  --text-muted: #98a7bd;
  --cyan: #49d7ff;
  --cyan-soft: #93e9ff;
  --violet: #9475ff;
  --amber: #ffc766;
  --danger: #ff8295;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body.app-shell {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 7% -8%, rgba(52, 212, 255, 0.16), transparent 31rem),
    radial-gradient(circle at 96% 14%, rgba(139, 108, 255, 0.16), transparent 29rem),
    linear-gradient(145deg, var(--app-bg) 0%, #0a1020 50%, var(--app-bg-deep) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

body.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.017) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.017) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

body.app-shell a {
  color: var(--cyan-soft);
  text-decoration-color: rgba(147, 233, 255, 0.38);
  text-underline-offset: 0.18em;
}

body.app-shell a:hover {
  color: #ffffff;
  text-decoration-color: currentColor;
}

body.app-shell :focus-visible {
  outline: 3px solid rgba(73, 215, 255, 0.78);
  outline-offset: 3px;
  box-shadow: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
  background: rgba(7, 11, 20, 0.74);
  backdrop-filter: blur(18px);
}

.app-navbar {
  min-height: 76px;
  position: relative;
}

.app-navbar::after {
  content: "";
  position: absolute;
  inset: auto 1.25rem -1px;
  height: 1px;
  opacity: 0.7;
  background: linear-gradient(90deg, transparent, rgba(73, 215, 255, 0.48), rgba(148, 117, 255, 0.44), transparent);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: var(--text) !important;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(147, 233, 255, 0.45);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(73, 215, 255, 0.22), rgba(148, 117, 255, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px rgba(45, 194, 255, 0.12);
}

.brand-mark span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f8fbff;
  box-shadow: 0 0 0 4px rgba(248, 251, 255, 0.1), 0 0 18px rgba(73, 215, 255, 0.9);
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy small {
  margin-top: 0.32rem;
  color: var(--cyan-soft);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.app-navbar .nav-link {
  margin: 0.3rem 0;
  padding: 0.48rem 0.7rem !important;
  border-radius: 9px;
  color: var(--text-muted) !important;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.07);
}

.app-navbar .nav-history-link {
  color: var(--cyan-soft) !important;
}

.navbar-toggler {
  border-color: rgba(147, 233, 255, 0.34);
}

.app-main {
  flex: 1;
  padding-top: clamp(2.5rem, 5vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
}

.app-footer {
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.app-footer .container {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.app-footer a {
  margin-left: auto;
  color: var(--text-muted) !important;
  text-decoration: none;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--cyan-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-shell {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(19, 30, 49, 0.93), rgba(10, 16, 31, 0.9));
  box-shadow: var(--shadow);
}

.hero-shell::before {
  content: "";
  position: absolute;
  width: 28rem;
  height: 28rem;
  top: -19rem;
  right: -8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 215, 255, 0.2), transparent 68%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero-title {
  max-width: 12ch;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.45rem, 5vw, 4.9rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-title .gradient-word {
  color: transparent;
  background: linear-gradient(105deg, var(--cyan-soft), #d9d0ff 66%, var(--violet));
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-lead {
  max-width: 56ch;
  margin: 1.45rem 0 0;
  color: var(--text-muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.endpoint-card {
  padding: 1.25rem;
  border: 1px solid rgba(147, 233, 255, 0.24);
  border-radius: 18px;
  background: rgba(4, 8, 17, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.endpoint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #b6ffd4;
  letter-spacing: 0.09em;
}

.live-indicator::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64e99a;
  box-shadow: 0 0 12px rgba(100, 233, 154, 0.9);
  content: "";
}

.endpoint-url {
  display: block;
  margin: 1.1rem 0;
  padding: 1rem;
  overflow-wrap: anywhere;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.045);
  font-size: clamp(0.9rem, 1.7vw, 1.08rem);
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.status-chip,
.operator-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.38rem 0.66rem;
  border: 1px solid rgba(147, 233, 255, 0.2);
  border-radius: 999px;
  color: var(--cyan-soft);
  background: rgba(73, 215, 255, 0.07);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-chip::before,
.operator-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.65rem;
}

.btn {
  border-radius: 10px;
  padding: 0.66rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  border: 0;
  color: #06111b !important;
  background: linear-gradient(105deg, var(--cyan), #92ddff 48%, #c5b2ff);
  box-shadow: 0 10px 24px rgba(73, 215, 255, 0.2);
}

.btn-primary:hover {
  color: #06111b !important;
  box-shadow: 0 14px 30px rgba(73, 215, 255, 0.3);
}

.btn-outline-primary,
.btn-outline-secondary {
  border-color: var(--line-strong);
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.025);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  border-color: rgba(147, 233, 255, 0.52);
  color: #ffffff !important;
  background: rgba(73, 215, 255, 0.1);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.quick-stat {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.quick-stat strong,
.quick-stat span {
  display: block;
}

.quick-stat strong {
  color: #ffffff;
  font-size: 0.9rem;
}

.quick-stat span {
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.docs-page > div,
.content-card,
.history-surface,
.metadata-surface,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.16);
}

.docs-page > div {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.docs-page h1,
.page-title,
.content-card h1,
.error-title {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.docs-page h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.35rem 0 0.8rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 16, 33, 0.58);
}

.language-switcher-label {
  padding: 0 0.42rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.language-option {
  padding: 0.4rem 0.68rem;
  border-radius: 8px;
  color: #c8d2e1;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.language-option:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.language-option.active {
  color: #06111f;
  background: linear-gradient(120deg, #55d9ff, #bb9cff);
  box-shadow: 0 5px 16px rgba(73, 215, 255, 0.18);
}

.docs-page h2 {
  margin-top: 2.25rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: #ffffff;
  font-size: 1.16rem;
  font-weight: 750;
}

.docs-page .lead,
.page-subtitle {
  color: var(--text-muted) !important;
  line-height: 1.7;
}

.docs-page p,
.docs-page li {
  color: #c8d2e1;
  line-height: 1.72;
}

.docs-page ul {
  padding-left: 1.25rem;
}

code {
  color: #d9f5ff;
}

.docs-page :not(pre) > code,
.metadata-surface code,
.history-surface code {
  padding: 0.15rem 0.38rem;
  border: 1px solid rgba(147, 233, 255, 0.13);
  border-radius: 6px;
  background: rgba(73, 215, 255, 0.08);
}

pre,
.json-console {
  max-width: 100%;
  overflow: auto;
  margin: 1.1rem 0;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(147, 233, 255, 0.14);
  border-radius: 13px;
  color: #dff8ff;
  background: #070c16;
  box-shadow: inset 0 1px 20px rgba(0, 0, 0, 0.28);
  font-size: 0.84rem;
  line-height: 1.65;
}

pre code,
.json-console code {
  color: inherit;
  white-space: pre;
}

.alert {
  border-width: 1px;
  border-radius: 13px;
  color: #dbeafe;
}

.alert-primary {
  border-color: rgba(73, 215, 255, 0.3);
  background: rgba(73, 215, 255, 0.1);
}

.alert-warning {
  border-color: rgba(255, 199, 102, 0.32);
  background: rgba(255, 199, 102, 0.1);
  color: #ffe9bc;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.45rem;
}

.page-title {
  margin: 0.2rem 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.history-surface {
  overflow: hidden;
}

.history-surface .table-responsive {
  margin: 0;
}

.table {
  --bs-table-color: #dbe5f2;
  --bs-table-bg: transparent;
  --bs-table-striped-color: #edf5ff;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.035);
  --bs-table-hover-color: #ffffff;
  --bs-table-hover-bg: rgba(73, 215, 255, 0.055);
  margin-bottom: 0;
}

.table > :not(caption) > * > * {
  padding: 1rem 1.15rem;
  border-bottom-color: var(--line);
  box-shadow: none;
}

.table thead th {
  border-bottom-color: var(--line-strong);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.028);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-action {
  white-space: nowrap;
  color: var(--cyan-soft) !important;
  font-weight: 750;
  text-decoration: none;
}

.empty-state {
  padding: 2.8rem 1.5rem;
  text-align: center;
}

.empty-state h2 {
  color: #ffffff;
  font-size: 1.2rem;
}

.empty-state p {
  max-width: 38rem;
  margin: 0.65rem auto 0;
  color: var(--text-muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted) !important;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.metadata-surface {
  padding: 1.25rem;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
}

.metadata-grid > div {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.metadata-grid dt {
  margin-bottom: 0.38rem;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metadata-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #f4f8ff;
}

.content-card,
.error-card {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.error-card {
  max-width: 760px;
  border: 1px solid rgba(255, 130, 149, 0.25);
  border-radius: 18px;
  color: #ffdce3;
  background: rgba(255, 130, 149, 0.06);
}

.error-card h2,
.error-card h3 {
  color: #ffffff;
}

.text-muted {
  color: var(--text-muted) !important;
}

@media (max-width: 991.98px) {
  .app-navbar {
    min-height: 68px;
  }

  .app-navbar .navbar-collapse {
    padding: 0.65rem 0 0.8rem;
  }

  .app-navbar .nav-link {
    padding-left: 0 !important;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: 14ch;
  }
}

@media (max-width: 767.98px) {
  .app-main {
    padding-top: 1.75rem;
  }

  .hero-shell {
    border-radius: 20px;
  }

  .endpoint-url {
    font-size: 0.75rem;
    letter-spacing: -0.025em;
  }

  .quick-stats,
  .metadata-grid {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer a {
    width: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
