﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
}

a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--neon-green);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 2px solid var(--border-color);
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 60;
}

.menu-toggle-btn {
  display: none;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 10px;
  background: rgba(2, 10, 34, 0.8);
  color: #e7f7ff;
  width: 42px;
  height: 42px;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.top-actions {
  display: none;
  align-items: center;
  gap: 6px;
  justify-self: end;
}

.lang-mobile-wrap {
  display: none;
}

.lang-mobile-select {
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 6px;
  width: 54px;
  min-height: 40px;
  height: 40px;
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(1, 6, 20, 0.62);
  z-index: 55;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  min-width: 0;
  flex-wrap: wrap;
}

.identity-chip {
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid transparent;
  min-height: 34px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-chip-service {
  color: #ffe9c0;
  border-color: rgba(255, 178, 45, 0.55);
  background: linear-gradient(135deg, rgba(255, 145, 0, 0.18), rgba(255, 58, 58, 0.12));
  box-shadow: 0 0 12px rgba(255, 145, 0, 0.26);
  text-transform: none;
  letter-spacing: 0.01em;
}

.identity-chip-user {
  color: #e8f2ff;
  border-color: rgba(0, 218, 255, 0.62);
  background: linear-gradient(135deg, rgba(0, 188, 255, 0.2), rgba(14, 116, 255, 0.14));
  box-shadow: 0 0 12px rgba(0, 188, 255, 0.2);
  text-transform: none;
}

.menu-user-chip {
  display: none;
}

.menu-ecosystem-chip {
  display: none;
}

.logo-seal {
  position: relative;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-ring {
  position: absolute;
  inset: -7px;
  width: calc(100% + 14px);
  height: calc(100% + 14px);
  animation: ring-spin 20s linear infinite;
}

.logo-ring-text {
  fill: rgba(0, 240, 255, 0.88);
  font-size: 8.4px;
  letter-spacing: 0.4px;
  font-family: "Noto Naskh Arabic", serif;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22), 0 0 26px rgba(0, 240, 255, 0.16);
}

.brand {
  font-size: 34px;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: var(--border-glow);
  letter-spacing: 0.02em;
}

.brand-frame {
  position: relative;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 18px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.9)) padding-box,
    linear-gradient(120deg, rgba(0, 240, 255, 0.8), rgba(255, 0, 110, 0.85), rgba(0, 255, 159, 0.82)) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.22),
    0 0 18px rgba(0, 240, 255, 0.24),
    0 0 30px rgba(255, 0, 110, 0.12);
  overflow: hidden;
}

.brand-frame::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.16), transparent 60%);
  transform: rotate(8deg);
  animation: brand-shine 4s linear infinite;
  pointer-events: none;
}

.brand-ar {
  font-family: "Noto Naskh Arabic", serif;
  direction: rtl;
  line-height: 1;
  transform: perspective(420px) rotateX(13deg);
  background: linear-gradient(90deg, #cbf7ff 0%, #00f0ff 30%, #f8feff 55%, #00ff9f 80%, #cbf7ff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 #063149,
    0 2px 0 #063149,
    0 3px 0 #052235,
    0 4px 0 #031a2a,
    0 8px 18px rgba(0, 240, 255, 0.38),
    0 16px 34px rgba(0, 0, 0, 0.46);
  animation: brand-flow 6s ease-in-out infinite;
}

.header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-self: end;
  min-width: 0;
}

.pref-switchers {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pref-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.pref-switch select {
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  width: fit-content;
  min-width: 0;
}

.pref-switch select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.12);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.65);
}

.lang-btn {
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-btn + .lang-btn {
  border-left: 1px solid rgba(0, 240, 255, 0.2);
}

.lang-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.32), rgba(139, 0, 255, 0.28));
}

.auth-btn {
  border: 2px solid #06080f;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(139, 0, 255, 0.18));
  color: #f4fbff;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(6, 8, 15, 0.8), 0 0 14px rgba(0, 240, 255, 0.16);
  font-size: 13px;
}

.cabinet-chip {
  border: 2px solid #06080f;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 255, 159, 0.22), rgba(0, 166, 106, 0.2));
  color: #eafff8;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(6, 8, 15, 0.8), 0 0 14px rgba(0, 255, 159, 0.18);
  text-decoration: none;
}

.cabinet-chip:hover {
  border-color: rgba(0, 255, 159, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 255, 159, 0.25), 0 0 18px rgba(0, 255, 159, 0.3);
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-strong);
}

.card h1,
.card h2 {
  color: var(--neon-blue);
  margin-bottom: 14px;
}

.section-frame-title {
  display: table;
  margin: 0 auto 18px;
  padding: 6px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background:
    linear-gradient(rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.84)) padding-box,
    linear-gradient(120deg, rgba(0, 240, 255, 0.68), rgba(0, 255, 159, 0.52), rgba(0, 118, 255, 0.56)) border-box;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.14),
    0 0 20px rgba(0, 240, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card p {
  color: var(--text-secondary);
}

.core-banner-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 240, 255, 0.45);
  background:
    radial-gradient(circle at 18% -10%, rgba(0, 240, 255, 0.18), transparent 46%),
    radial-gradient(circle at 84% 112%, rgba(0, 255, 159, 0.16), transparent 40%),
    linear-gradient(135deg, rgba(1, 12, 34, 0.96), rgba(5, 14, 40, 0.92));
  padding-top: 28px;
  padding-bottom: 28px;
}

.core-banner-card::after {
  content: "";
  position: absolute;
  inset: -120% -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.08), transparent 58%);
  transform: rotate(5deg);
  animation: coreShine 7s linear infinite;
  pointer-events: none;
}

.core-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0;
  position: relative;
  z-index: 1;
}

.core-step {
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #dff8ff;
  background: rgba(2, 11, 34, 0.72);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
}

.core-step-accent {
  border-color: rgba(0, 255, 159, 0.72);
  color: #e7fffa;
  background: linear-gradient(135deg, rgba(8, 106, 79, 0.44), rgba(0, 119, 92, 0.36));
  box-shadow: 0 0 0 1px rgba(0, 255, 159, 0.2), 0 0 22px rgba(0, 255, 159, 0.28);
}

.core-arrow {
  font-size: 22px;
  font-weight: 700;
  color: rgba(168, 248, 255, 0.86);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.28);
}

.routes-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.route-link {
  border: 1px solid var(--border-color-soft);
  border-radius: 10px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.45);
  color: #e7f7ff;
  display: grid;
  gap: 6px;
}

.route-link span {
  color: var(--text-secondary);
  font-size: 12px;
}

.route-link-disabled {
  opacity: 0.48;
  cursor: default;
  filter: saturate(0.7);
  pointer-events: none;
}

.home-terminal-shell {
  margin-bottom: 14px;
}

.terminal-results {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 14px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(0, 240, 255, 0.12), rgba(2, 8, 30, 0.88) 42%, rgba(1, 6, 20, 0.96) 100%);
  box-shadow: 0 12px 34px rgba(0, 8, 30, 0.45), inset 0 0 0 1px rgba(125, 211, 252, 0.08);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.terminal-result-card {
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 14px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(0, 240, 255, 0.12), rgba(2, 8, 30, 0.88) 42%, rgba(1, 6, 20, 0.96) 100%);
  box-shadow: 0 12px 34px rgba(0, 8, 30, 0.45), inset 0 0 0 1px rgba(125, 211, 252, 0.08);
  padding: 18px;
  display: grid;
  gap: 14px;
  min-height: 390px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.terminal-result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 18px 38px rgba(0, 8, 30, 0.58), 0 0 28px rgba(34, 211, 238, 0.18);
}

.terminal-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.terminal-project-code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  color: var(--text-secondary);
  font-size: 12px;
}

.terminal-result-head h3 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1.25;
}

.terminal-score {
  --match-strength: 1;
  --match-hue: 140;
  --match-sat: 92%;
  --match-light: 54%;
  min-width: 104px;
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  color: hsla(var(--match-hue), var(--match-sat), var(--match-light), calc(0.45 + (var(--match-strength) * 0.55)));
  text-shadow: 0 0 16px hsla(var(--match-hue), var(--match-sat), var(--match-light), calc(0.14 + (var(--match-strength) * 0.34)));
  background: linear-gradient(180deg, rgba(2, 30, 36, 0.8), rgba(2, 14, 24, 0.65));
  border: 1px solid hsla(var(--match-hue), var(--match-sat), calc(var(--match-light) - 8%), calc(0.22 + (var(--match-strength) * 0.38)));
  border-radius: 12px;
  padding: 8px 10px 6px;
}

.terminal-score span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bfece1;
  text-shadow: none;
}

.home-terminal-score {
  --match-strength: 1;
  --match-hue: 140;
  --match-sat: 92%;
  --match-light: 54%;
}

.terminal-answers {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(2, 16, 44, 0.62), rgba(2, 12, 30, 0.52));
}

.terminal-answers > div {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.terminal-answer-value {
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-primary);
}

.terminal-answers > div span.terminal-answer-value.is-good,
.terminal-answers > div span.terminal-answer-value.is-bad {
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
}

.terminal-answers > div span.terminal-answer-value.is-good::before,
.terminal-answers > div span.terminal-answer-value.is-bad::before {
  content: none;
}

.terminal-answers > div span.terminal-answer-value.is-good::after,
.terminal-answers > div span.terminal-answer-value.is-bad::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
}

.terminal-answers > div span.terminal-answer-value.is-good::after {
  content: "✓";
  color: #63f6b2;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(6, 78, 59, 0.25);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.22);
}

.terminal-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 12px;
  min-height: 0;
  padding: 12px 14px;
  color: #f4fbff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(0, 255, 159, 0.22));
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 16px rgba(0, 8, 30, 0.24);
}

.footer-min {
  margin-top: 18px;
  border-top: 1px solid rgba(0, 240, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(1, 4, 12, 0.96), rgba(0, 0, 0, 0.98));
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.28);
}

.footer-min-inner {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 16px 22px;
  color: var(--text-secondary);
  font-size: 13px;
  min-height: 72px;
}

@keyframes brand-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes brand-shine {
  0% { transform: translateX(-140%) rotate(8deg); }
  100% { transform: translateX(140%) rotate(8deg); }
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes coreShine {
  0% { transform: translateX(-46%) rotate(5deg); opacity: 0; }
  16% { opacity: 0.3; }
  45% { opacity: 0.14; }
  70% { transform: translateX(42%) rotate(5deg); opacity: 0; }
  100% { transform: translateX(42%) rotate(5deg); opacity: 0; }
}

@media (max-width: 900px) {
  :root {
    --mobile-pref-select-width: 124px;
  }

  .topbar {
    grid-template-columns: auto 1fr auto;
    justify-items: stretch;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    position: sticky;
    position: -webkit-sticky;
    top: 0;
  }

  .brand-wrap {
    justify-self: start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .brand-wrap .identity-chip {
    display: none;
  }

  .brand-frame {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    justify-self: center;
    padding: 8px 12px;
    z-index: 1;
    pointer-events: none;
  }

  .brand {
    font-size: 28px;
  }

  .top-actions {
    display: inline-flex;
  }

  .menu-toggle-btn {
    display: inline-flex;
    width: 40px;
    height: 40px;
  }

  .header-meta {
    position: fixed;
    top: 0;
    right: -100vw;
    height: 100vh;
    width: min(340px, 88vw);
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 11px;
    padding: 16px 14px 18px;
    background: linear-gradient(160deg, rgba(2, 10, 34, 0.98), rgba(4, 14, 44, 0.98));
    border-left: 1px solid rgba(0, 240, 255, 0.22);
    transform: none;
    transition: right 0.24s ease;
  }

  .menu-user-chip {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    justify-content: center;
    align-self: stretch;
    text-align: center;
  }

  .menu-ecosystem-chip {
    display: inline-flex;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    justify-content: center;
    align-self: stretch;
    text-align: center;
  }

  .pref-switchers {
    width: 100%;
    display: grid;
    gap: 10px;
  }

  .header-meta > .lang-switch {
    display: none;
  }

  .pref-switch {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--mobile-pref-select-width);
    align-items: center;
    font-size: 12px;
    column-gap: 8px;
  }

  .pref-switch select {
    width: var(--mobile-pref-select-width);
    min-width: var(--mobile-pref-select-width);
    min-height: 38px;
    margin-left: auto;
    font-size: 12px;
    padding: 9px 10px;
  }

  .lang-mobile-wrap {
    display: inline-flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 61;
  }

  .lang-switch {
    width: 100%;
  }

  .lang-btn {
    flex: 1;
    padding: 10px 10px;
  }

  .cabinet-chip,
  .auth-btn {
    width: 100%;
    min-height: 42px;
  }

  body.menu-open .header-meta {
    right: 0;
  }

  body.menu-open .menu-backdrop {
    display: block;
  }

  .core-steps {
    gap: 8px;
  }

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

  .terminal-results {
    grid-template-columns: 1fr;
  }

  .terminal-result-card {
    min-height: 0;
  }

  .terminal-result-head h3 {
    font-size: 18px;
  }

  .core-step {
    font-size: 14px;
    padding: 9px 12px;
  }

  .core-arrow {
    font-size: 18px;
  }
}

@media (max-width: 560px) {
  .brand { font-size: 28px; }
  .brand-logo,
  .logo-seal { width: 44px; height: 44px; }
  .footer-min-inner { flex-wrap: wrap; }

  .core-banner-card {
    overflow: hidden;
    padding-left: 12px;
    padding-right: 12px;
  }

  .core-steps {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    width: max-content;
    animation: coreTicker 24s linear infinite;
    will-change: transform;
    padding-right: 36px;
  }

  .core-step {
    font-size: 13px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .core-arrow {
    font-size: 16px;
    white-space: nowrap;
  }
}

@keyframes coreTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-55%); }
}
