:root {
  --bg-main: #0a1b2c;
  --bg-secondary: #122345;
  --bg-card: #1a1f52;
  --bg-card-soft: #1f2863;
  --text-main: #e7edff;
  --text-muted: #b2bfde;
  --accent: #00aaff;
  --accent-hover: #0088cc;
  --border: #2f4270;
  --success-text: #16642a;
  --success-border: #2f8d45;
  --success-bg: #e8f8ec;
  --danger-text: #8c1d1d;
  --danger-border: #be3f3f;
  --danger-bg: #ffecec;
  --shadow-lg: 0 22px 55px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text-main);
  background: var(--bg-main);
  line-height: 1.5;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: linear-gradient(100deg, rgba(18, 35, 67, 0.98), rgba(16, 41, 78, 0.97));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.topbar__signal {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.topbar__signal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 35, 67, 0.88), rgba(18, 35, 67, 0.3) 48%, rgba(18, 35, 67, 0.72));
}

.topbar__signal-glow {
  position: absolute;
  width: 440px;
  height: 110px;
  top: -22px;
  right: 12%;
  border-radius: 50%;
  background: rgba(0, 170, 255, 0.18);
  filter: blur(37px);
}

.topbar__signal svg {
  position: absolute;
  width: 106%;
  height: 100%;
  left: -3%;
}

.topbar__signal path {
  fill: none;
  stroke: rgba(103, 215, 255, 0.55);
  stroke-width: 1.25;
  stroke-dasharray: 8 8;
  vector-effect: non-scaling-stroke;
  animation: topbar-signal-drift 10s linear infinite;
}

.topbar__signal i {
  position: absolute;
  left: var(--signal-left);
  top: 31px;
  width: 6px;
  height: 6px;
  border: 1px solid #9be5ff;
  border-radius: 50%;
  background: #17335b;
  box-shadow: 0 0 0 4px rgba(53, 197, 255, 0.1), 0 0 13px #2cbfff;
  animation: topbar-signal-pulse 2.2s var(--signal-delay) ease-out infinite;
}

.topbar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
}

.topbar__logo {
  margin-right: auto;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.topbar__menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.topbar__menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-main);
  border-radius: 99px;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.topbar__link {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.96rem;
  transition: color 0.2s ease;
}

.topbar__link:hover {
  color: var(--accent);
}

.topbar__icon-link {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.topbar__icon-link:hover {
  border-color: var(--accent);
  background: rgba(0, 170, 255, 0.14);
  color: #fff;
}

.topbar__icon-link svg {
  width: 18px;
  height: 18px;
}

.topbar-balance {
  min-height: 38px;
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(0, 170, 255, 0.42);
  border-radius: 10px;
  background: rgba(0, 170, 255, 0.12);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.topbar-balance__top-up {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topbar-balance__top-up:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.topbar-balance strong {
  font-weight: 700;
}

@keyframes topbar-signal-drift {
  to { stroke-dashoffset: -160; }
}

@keyframes topbar-signal-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(53, 197, 255, 0), 0 0 17px #2cbfff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar__signal path,
  .topbar__signal i {
    animation: none;
  }
}

body.is-balance-modal-open {
  overflow: hidden;
}

.balance-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.balance-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(2px);
}

.balance-modal__dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(18, 28, 64, 0.99), rgba(12, 22, 44, 0.99));
  padding: 1rem;
  box-shadow: var(--shadow-lg);
}

.balance-modal__title {
  margin: 0;
  font-size: 1.2rem;
}

.balance-modal__text {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
}

.balance-modal__form {
  margin-top: 0.85rem;
}

.balance-modal__field {
  display: block;
}

.balance-modal__field span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.balance-modal__field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.balance-modal__field input:focus {
  border-color: var(--accent);
  outline: none;
}

.balance-modal__field input:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.balance-top-up__result {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(0, 170, 255, 0.26);
  border-radius: 10px;
  background: rgba(0, 170, 255, 0.08);
  color: var(--text-muted);
}

.balance-top-up__result strong {
  color: var(--text-main);
}

.balance-modal__feedback {
  min-height: 1.35rem;
  margin: 0.65rem 0 0;
  color: #ffb4b4;
  font-size: 0.9rem;
}

.balance-modal__actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.balance-modal__button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.62rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.balance-modal__button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.balance-modal__button--secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.balance-modal__button--primary {
  border-color: var(--accent);
  background: var(--accent);
}

.balance-modal__button--primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.balance-empty-state {
  width: min(520px, 100%);
  margin: auto;
  padding: 2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balance-empty-state__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(0, 170, 255, 0.48);
  border-radius: 50%;
  background: rgba(0, 170, 255, 0.12);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.balance-empty-state__icon svg {
  width: 35px;
  height: 35px;
}

.balance-empty-state h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.balance-empty-state p {
  max-width: 440px;
  margin: 0.7rem 0 1.3rem;
  color: var(--text-muted);
}

.cabinet-layout.is-balance-empty #sidebarProjectsList {
  opacity: 0.55;
  pointer-events: none;
}

.topbar__actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 980px) {
  .topbar__menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .topbar__nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1rem;
    background: rgba(18, 35, 67, 0.99);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
  }

  .topbar__nav.is-open {
    display: flex;
    max-height: 420px;
    padding-bottom: 0.8rem;
  }

  .topbar__link {
    width: 100%;
    padding: 0.55rem 0;
  }

  .topbar-balance {
    width: 100%;
    margin: 0.45rem 0;
    justify-content: center;
  }

  .topbar__actions {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .topbar__actions {
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .topbar__inner {
    flex-wrap: wrap;
    min-height: 64px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .topbar__actions {
    width: 100%;
    justify-content: flex-end;
  }
}


body.is-modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 24, 0.78);
}

.auth-modal__dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: min(92vh, 740px);
  overflow-y: auto;
  border-radius: 14px;
  background: linear-gradient(160deg, #1a1f52, #12183f);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.3rem;
  box-shadow: var(--shadow-lg);
}

.auth-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.auth-modal__title {
  margin: 0 0 1rem;
  font-size: 1.28rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.auth-tabs__button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-radius: 9px;
  padding: 0.56rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-tabs__button.is-active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(0, 170, 255, 0.25);
}

.auth-tab-panel {
  display: none;
}

.auth-tab-panel.is-active {
  display: block;
}

.auth-feedback {
  display: none;
  margin-bottom: 0.85rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.91rem;
}

.auth-feedback.is-visible {
  display: block;
}

.auth-feedback--success {
  color: var(--success-text);
  border-color: var(--success-border);
  background: var(--success-bg);
}

.auth-feedback--error {
  color: var(--danger-text);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.form-field {
  display: block;
}

.form-label {
  display: block;
  margin: 0 0 0.36rem;
  font-size: 0.89rem;
}

.form-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.68rem 0.8rem;
  font: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap .form-input {
  padding-right: 2.6rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.form-error {
  min-height: 1.1rem;
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  color: #ffb7b7;
}

.form-field.is-invalid .form-input {
  border-color: var(--danger-border);
  background: rgba(190, 63, 63, 0.12);
}

.form-field.is-valid .form-input {
  border-color: var(--success-border);
  background: rgba(47, 141, 69, 0.12);
}

.btn--submit {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.1rem;
}

.loader-mini {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-mini.is-hidden {
  display: none;
}

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

@media (max-width: 760px) {
  .auth-modal__dialog {
    padding: 1rem;
  }
}
.footer {
  background: #0a1426;
  padding: 2.6rem 0 1.5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 1.3rem;
}

.footer h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

.footer__copy {
  margin: 1.6rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}
