*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #eef2f6;
  color: #1d1d1d;
  --header-height: 72px;
  --page-bg: #eef2f6;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  padding: 14px 24px;
  background: var(--page-bg);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(var(--header-height) + 24px);
}

.support-banner {
  width: 100%;
  max-width: 520px;
  padding: 16px 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(11, 31, 51, 0.06);
  text-align: center;
}

.support-banner-text {
  font-size: 15px;
  line-height: 1.45;
  color: #333;
}

.support-phone {
  color: #0d4cd3;
  text-decoration: none;
}

.support-phone:hover {
  text-decoration: underline;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--page-bg);
  transition: opacity 0.45s ease;
}

.splash-screen--hide {
  opacity: 0;
  pointer-events: none;
}

.splash-screen[hidden] {
  display: none;
}

.splash-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  padding: 36px 40px 32px;
  text-align: center;
}

.splash-logo {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  line-height: 1;
}

.splash-logo .logo-go {
  color: #0d4cd3;
}

.splash-logo .logo-s {
  background: linear-gradient(90deg, #0d4cd3 0%, #5b6fe8 45%, #ee3f58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.splash-logo .logo-uslugi {
  color: #ee3f58;
}

.splash-title {
  font-size: 18px;
  font-weight: 400;
  color: #1d1d1d;
  margin-bottom: 10px;
}

.splash-subtitle {
  font-size: 15px;
  color: #86909c;
  margin-bottom: 28px;
}

.splash-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5cad3;
  animation: splash-dot 1.2s ease-in-out infinite;
}

.splash-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.splash-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes splash-dot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.app-content[hidden] {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(11, 31, 51, 0.08);
  padding: 40px 40px 36px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.logo-gos {
  color: #0d4cd3;
}

.logo-uslugi {
  color: #ee3f58;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  line-height: 1.4;
  color: #666;
}

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #c5cdd6;
  border-radius: 12px;
  background: #f2f5f8;
  font-family: inherit;
  font-size: 16px;
  color: #0b1f33;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field-input:hover {
  border-color: #9aa7b5;
}

.field-input:focus {
  border-color: #0d4cd3;
  background: #fff;
  box-shadow: 0 0 0 1px #0d4cd3;
}

.submit-btn {
  margin-top: 4px;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: #0d4cd3;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.submit-btn:hover {
  background: #0b3fb8;
}

.submit-btn:active {
  background: #0935a0;
}

.terminal-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  background: var(--page-bg);
  animation: overlay-in 0.4s ease;
}

.terminal-overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.terminal-window {
  width: 100%;
  max-width: 700px;
  height: min(480px, calc(100vh - var(--header-height) - 48px));
  background: #000;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: window-in 0.35s ease;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.terminal-log {
  flex: 1;
  min-height: 0;
  padding: 20px 24px 12px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.55;
  color: #33ff33;
  scrollbar-color: #333 #000;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.terminal-log::-webkit-scrollbar {
  width: 8px;
}

.terminal-log::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line--header {
  margin-bottom: 6px;
}

.log-tag-ok {
  color: #33ff33;
}

.log-tag-info {
  color: #33ff33;
}

.log-tag-scan {
  color: #33ff33;
}

.log-tag-warn {
  color: #ffcc00;
}

.log-tag-threat {
  color: #ff3333;
}

.terminal-progress {
  padding: 14px 24px 20px;
  border-top: 1px solid #1a1a1a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #33ff33;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-line {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr 40px;
  align-items: center;
  gap: 12px;
}

.progress-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 16px;
  background: #0d0d0d;
  border: 1px solid #2a5a2a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #1a8f1a 0%,
    #33ff33 45%,
    #5dff5d 75%,
    #33ff33 100%
  );
  background-size: 200% 100%;
  box-shadow:
    0 0 10px rgba(51, 255, 51, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: bar-shimmer 1.8s linear infinite;
}

@keyframes bar-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.progress-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.terminal-success {
  padding: 20px 24px 24px;
  border-top: 1px solid #1a3a1a;
  text-align: center;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #33ff33;
  text-shadow:
    0 0 12px rgba(51, 255, 51, 0.8),
    0 0 24px rgba(51, 255, 51, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.terminal-success[hidden] {
  display: none;
}

.terminal-success--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  body {
    --header-height: 88px;
  }

  .site-header {
    padding: 10px 16px;
  }

  .page {
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
    justify-content: flex-start;
  }

  .support-banner {
    max-width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
  }

  .support-banner-text {
    font-size: 13px;
  }

  .splash-card {
    padding: 28px 24px 26px;
    border-radius: 16px;
  }

  .splash-logo {
    font-size: 30px;
    margin-bottom: 20px;
  }

  .splash-title {
    font-size: 16px;
  }

  .splash-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .login-card {
    padding: 24px 20px 28px;
    border-radius: 16px;
  }

  .logo {
    font-size: 24px;
    margin-bottom: 22px;
  }

  .field-label {
    font-size: 13px;
  }

  .field-input {
    height: 42px;
    font-size: 16px;
  }

  .terminal-overlay {
    padding: 8px 10px;
    align-items: stretch;
  }

  .terminal-window {
    max-width: none;
    width: 100%;
    height: calc(100dvh - var(--header-height) - 16px);
    max-height: none;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  }

  .terminal-log {
    padding: 14px 12px 8px;
    font-size: 12px;
    line-height: 1.5;
  }

  .terminal-progress {
    padding: 10px 12px 12px;
    font-size: 11px;
    gap: 10px;
    flex-shrink: 0;
  }

  .progress-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .progress-label {
    white-space: normal;
  }

  .progress-track {
    height: 14px;
    width: 100%;
  }

  .progress-pct {
    align-self: flex-end;
  }

  .terminal-success {
    padding: 12px 12px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }
}

.visit-stats {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 400;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dce0e5;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(11, 31, 51, 0.12);
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

.visit-stats__header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #0b1f33;
}

.visit-stats__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visit-stats__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
}

.visit-stats__row dt {
  color: #666;
}

.visit-stats__row dd {
  margin: 0;
  word-break: break-word;
}

.visit-stats__note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #86909c;
}
