@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f9fafb;
  color: #1e293b;
  line-height: 1.6;
  padding: 0 1.5rem;  /* ← увеличенные боковые отступы */
}



/* ===== BOOTSTRAP ICONS OVERRIDES ===== */
.bi {
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
  width: 1em;
/* height: 1em;*/
}

/* ===== NAVIGATION ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 2rem auto 1.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border-radius: 60px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

nav a {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 40px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

nav a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

nav span {
  color: #64748b;
  /*font-size: 0.95rem;*/
  background: #f8fafc;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

nav a i,
nav span i {
  line-height: 1;   /* убираем лишнюю высоту */
  font-size: 0.95em; /* при необходимости подкорректируйте размер */
}

/* ===== CONTAINERS ===== */
.container,
main,
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 0.5rem 3rem;  /* ← добавлены горизонтальные отступы */
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login_title {
  justify-content: center;
}


h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== CARDS & LISTS ===== */
.category-grid,
.artifact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.8rem;
  margin-top: 2rem;
}

.card {
  background: white;
  border-radius: 24px;
  padding: 1.8rem 1.5rem;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 36px -12px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.card-icon {
  background: #f8fafc;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  border: 1px solid #eef2f6;
}

.card-icon i {
  font-size: 2.2rem;
  color: #0f172a;
}

.card-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #0f172a;
  text-transform: capitalize;
}

.card-content .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: #64748b;
  font-size: 0.9rem;
}

.card .badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.25rem 0.9rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;        /* убираем подчёркивание */
  pointer-events: none;         /* предотвращаем кликабельность внутри ссылки */
  display: inline-block;
}

/* Адаптив для карточек */
@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem;
  }
}

/* ===== VERSION HISTORY ===== */
.version-list {
  list-style: none;
  margin: 1.5rem 0;
}

.version-item {
  background: white;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #eef2f6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.version-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.version-name {
  font-weight: 700;
  font-size: 1.2rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.version-date {
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.changelog {
  margin-top: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9rem;
  color: #334155;
  border-left: 4px solid #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
}

.download-btn {
  background: #0f172a;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 40px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.download-btn:hover {
  background: #1e293b;
}

/* ===== FORMS ===== */
form {
  background: white;
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  max-width: 480px;
  margin: 2rem auto;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  font-size: 1rem;
  transition: border 0.2s;
}

input:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

button {
  background: #0f172a;
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  background: #1e293b;
  transform: scale(1.02);
}

hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

.error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== REMARK42 INTEGRATION ===== */
#remark42 {
  margin-top: 3rem;
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.05);
}

/* ===== UTILITIES ===== */
.text-muted {
  color: #64748b;
}

.mt-4 {
  margin-top: 2rem;
}

.flex {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin: 2rem 0;
}

th,
td {
  padding: 1rem 1.5rem;
  text-align: left;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

td {
  border-bottom: 1px solid #f1f5f9;
}

tr:last-child td {
  border-bottom: none;
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  body {
    padding: 0 0.75rem;  /* ← на узких экранах отступы уменьшаются */
  }

  nav {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 30px;
  }

  h1 {
    font-size: 2rem;
  }

  .version-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
  }

  form {
    padding: 1.5rem;
  }

  .content,
  main,
  .container {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
}

/* ===== WELCOME SECTION ===== */
.welcome-section {
  margin-bottom: 2rem;
}

.subscription-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.4rem 1.2rem;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid #a7f3d0;
}

.empty-state {
  background: white;
  border-radius: 24px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 8px 20px -6px rgba(0,0,0,0.05);
  margin: 2rem 0;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.button {
  background: #0f172a;
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
}

/* ===== PAYMENT PAGE ===== */
.payment-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 0;
}

.subtitle {
  text-align: center;
  color: #64748b;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

.tariff-card {
  background: white;
  border-radius: 32px;
  padding: 2rem;
  box-shadow: 0 20px 30px -8px rgba(0,0,0,0.08);
  border: 1px solid #f1f5f9;
  margin-bottom: 2rem;
}

.tariff-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eef2f6;
}

.tariff-header h2 {
  margin: 0 0 0.5rem;
  border: none;
  padding: 0;
  font-size: 1.8rem;
}

.price {
  font-size: 3rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.period {
  color: #64748b;
  font-size: 1rem;
}

.tariff-features ul {
  list-style: none;
  margin: 0 0 2rem;
}

.tariff-features li {
  padding: 0.6rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #334155;
}

.tariff-features li i {
  color: #10b981;
  font-size: 1.2rem;
}

.tariff-action {
  text-align: center;
}

.button-primary {
  background: #0f172a;
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 60px;
  font-weight: 600;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #0f172a;
}

.button-primary:hover {
  background: #1e293b;
  transform: scale(1.02);
}

.secure-note {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== README MODAL ===== */
.readme-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0.6rem 1.5rem;
  border-radius: 40px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.5rem;
}
.readme-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.version-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Модальное оверлей */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 24px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  box-shadow: 0 25px 40px -10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eef2f6;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
}
.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  /* минимальная высота, чтобы был скролл */
  min-height: 200px;
  line-height: 1.6;
}

/* Стили для контента Markdown внутри модала */
.modal-body h1, .modal-body h2, .modal-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  border: none;
  padding: 0;
}
.modal-body pre {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
}
.modal-body code {
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
/* ===== SEARCH BOX ===== */
.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
  margin: 0 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 40px;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: all 0.2s;
  margin-bottom: 0;
}

.search-box input:focus {
  outline: none;
  border-color: #0f172a;
  background: white;
  box-shadow: 0 0 0 3px rgba(15,23,42,0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

.search-results {
  position: absolute;
  top: 110%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px;
  box-shadow: 0 15px 30px -10px rgba(0,0,0,0.15);
  border: 1px solid #eef2f6;
  max-height: 340px;
  overflow-y: auto;
  z-index: 1000;
  padding: 0.25rem 0;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}

.search-result-item:hover,
.search-result-item.active {
  background: #f1f5f9;
}

.search-result-item strong {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.search-result-item small {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.search-result-item.empty {
  color: #94a3b8;
  font-style: italic;
}

/* Адаптация навигации для мобильных */
@media (max-width: 640px) {
  .search-box {
    max-width: none;
    margin: 0.75rem 0;
    order: 2;
  }
  nav {
    flex-wrap: wrap;
  }
}

.search-result-item mark {
  background: #fef08a;
  color: #0f172a;
  font-weight: 600;
  padding: 0.1em 0.2em;
  border-radius: 3px;
}

.success {
  background: #d1fae5;
  color: #065f46;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== ARTIFACT DESCRIPTION ===== */
.artifact-description {
  background: white;
  border-radius: 20px;
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  border: 1px solid #f1f5f9;
  line-height: 1.7;
  font-size: 1rem;
  color: #334155;
}

.artifact-description h1,
.artifact-description h2,
.artifact-description h3 {
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}

.artifact-description pre {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
}

.artifact-description code {
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.artifact-description ul,
.artifact-description ol {
  margin: 0.5rem 0 0.5rem 1.5rem;
}

.artifact-description p {
  margin-bottom: 0.8rem;
}

.artifact-description img {
  max-width: 100%;
  border-radius: 12px;
}

/* Стили для кнопки гамбургер-меню */
.menu-toggle {
  display: none;               /* скрыта на больших экранах */
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #0f172a;
  padding: 0.25rem;
  line-height: 1;
}

/* Обёртка для пунктов меню */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;                /* промежуток между ссылками */
}

/* Мобильная версия */
@media (max-width: 1000px) {
  .menu-toggle {
    display: block;            /* показываем гамбургер */
    order: -1;                 /* гамбургер всегда первый слева */
  }

  .menu-toggle:hover {
    color: #64748b;   /* умеренно-серый вместо чёрного */
    background: transparent; /* убираем возможный фон, если кнопка его наследует */
  }

  /* Поле поиска */
  nav .search-box {
    display: block;
    flex: 1;
    margin: 0 0.5rem;
    order: 0;                  /* поиск сразу за гамбургером */
  }

  /* Скрываем все пункты меню */
  .nav-links {
    display: none;
    order: 10;                 /* после поиска */
    width: 100%;
    flex-direction: column;    /* пункты будут вертикально */
    align-items: stretch;
    margin-top: 0.5rem;
  }

  /* При открытии меню показываем ссылки */
  nav.open .nav-links {
    display: flex;
  }

  /* Навигация */
  nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
    border-radius: 30px;
  }

  /* Если JS отключён — показываем всё */
  .no-js .nav-links {
    display: flex !important;
  }
  .no-js .menu-toggle {
    display: none !important;
  }
}

/* ===== DEMO SECTION ===== */
.demo-section {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.btn-demo {
  background: #0f172a;
  color: white;
  padding: 0.7rem 1.8rem;
  border-radius: 60px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  border: 1px solid #0f172a;
}

.btn-demo:hover {
  background: #1e293b;
  transform: scale(1.02);
}

/* Иконка вопроса и всплывающая подсказка */
.demo-hint {
  position: relative;
  cursor: pointer;
  color: #64748b;
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
}

.demo-hint .tooltiptext {
  visibility: hidden;
  width: 260px;
  background: #1e293b;
  color: #fff;
  text-align: center;
  border-radius: 12px;
  padding: 0.8rem;
  position: absolute;
  z-index: 10;
  bottom: 130%;          /* позиция над иконкой */
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.2s;
}

.demo-hint .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.demo-hint:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}



