/* ============================================================
   Поиск конкурентов — общие стили
   Визуальный язык: тёмно-синий + янтарный, плоские блоб-формы
   на фоне, «таблеточные» кнопки — сознательно не похоже на
   исходные референсы (там был обычный синий SaaS-стиль).
   ============================================================ */

:root {
  --bg: #eef0f7;
  --card-bg: #ffffff;
  --border: #e6e8f2;
  --navy: #1c1f3d;
  --navy-soft: #565a7d;
  --amber: #ffb238;
  --amber-dark: #f39a0e;
  --amber-soft: #fff2dc;
  --indigo: #4b4fe0;
  --indigo-soft: #ecebff;
  --success: #0f9d74;
  --error: #e5484d;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 10px rgba(28, 31, 61, 0.04), 0 20px 40px rgba(28, 31, 61, 0.06);
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Декоративные фоновые формы ---------- */

.blob {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
}

.blob-amber {
  top: -120px;
  left: -110px;
  width: 320px;
  height: 320px;
  background: var(--amber);
  opacity: 0.55;
}

.blob-indigo {
  top: -160px;
  right: -140px;
  width: 380px;
  height: 380px;
  background: var(--indigo);
  opacity: 0.16;
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
}

.blob-navy {
  bottom: -140px;
  right: -90px;
  width: 260px;
  height: 260px;
  background: var(--navy);
  opacity: 0.9;
}

/* ---------- Layout ---------- */

.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

/* ---------- Header ---------- */

.page-header {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.page-icon {
  flex: none;
  width: 52px;
  height: 52px;
}

.page-header-text h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0 10px;
  color: var(--navy);
}

.subtitle {
  color: var(--navy-soft);
  font-size: 15px;
  margin: 0;
  max-width: 56ch;
}

/* ---------- Cards ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 20px;
}

/* ---------- Form elements ---------- */

label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--navy);
}

.card label:not(:first-child) {
  margin-top: 18px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfe;
  color: var(--navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--indigo);
  background: #fff;
  box-shadow: 0 0 0 4px var(--indigo-soft);
}

.hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--navy-soft);
}

.hint a {
  color: var(--indigo);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 22px;
  padding: 14px 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  background: var(--amber);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(255, 178, 56, 0.35);
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--amber-dark);
  box-shadow: 0 12px 24px rgba(255, 178, 56, 0.45);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #ffe1af;
  color: #b98a3d;
  cursor: progress;
  box-shadow: none;
}

/* ---------- Tabs (сегментированный переключатель) ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #f2f3fa;
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 22px;
}

.tab {
  flex: 1 1 auto;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-soft);
  background: none;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--navy);
}

.tab.active {
  color: #fff;
  background: var(--navy);
}

.panel-desc {
  color: var(--navy-soft);
  font-size: 14px;
  margin: 0 0 18px;
}

/* ---------- Console / log ---------- */

.console {
  margin-top: 22px;
  max-height: 280px;
  overflow-y: auto;
  background: #f7f7fc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.log-line {
  padding: 2px 0;
  color: var(--navy);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line.ok {
  color: var(--success);
  font-weight: 700;
}

.log-line.err {
  color: var(--error);
  font-weight: 700;
}

.tab-panel textarea {
  width: 100%;
}

.panel-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 26px 0 22px;
}

/* ---------- Checkbox grid (Круг 2) ---------- */

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--indigo);
  cursor: pointer;
}

@media (max-width: 480px) {
  .checkbox-grid {
    gap: 8px 10px;
  }

  .checkbox-item {
    font-size: 12.5px;
    gap: 6px;
  }

  .checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }
}

/* ---------- Post cards (результаты поиска по фразам) ---------- */

.post-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fbfbfe;
}

.post-card:last-child {
  margin-bottom: 0;
}

.post-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.post-card-head a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

.post-card-head a:hover {
  text-decoration: underline;
}

.post-card-date {
  flex: none;
  font-size: 12.5px;
  color: var(--navy-soft);
}

.post-card-text {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--navy);
  white-space: pre-wrap;
}

.post-card-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo);
  text-decoration: none;
  margin-right: 10px;
}

.post-card-link:hover {
  text-decoration: underline;
}

.post-card-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--amber-dark);
  background: var(--amber-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.results {
  margin-top: 22px;
}

.results h3 {
  font-size: 16px;
  margin: 0 0 12px;
  color: var(--navy);
}

.table-scroll {
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 420px;
}

.results-table th,
.results-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  background: #f7f7fc;
  font-weight: 700;
  color: var(--navy-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table a {
  color: var(--indigo);
  text-decoration: none;
  font-weight: 700;
}

.results-table a:hover {
  text-decoration: underline;
}

/* ---------- Step cards (страница ключа) ---------- */

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.step-head h2 {
  font-size: 17px;
  margin: 0;
  color: var(--navy);
}

.step p {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--navy-soft);
}

.step p:last-of-type {
  margin-bottom: 0;
}

.step strong {
  color: var(--navy);
}

kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--indigo-soft);
  color: var(--indigo);
  border: 1px solid #d9d8ff;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
}

.step .note {
  margin-top: 24px;
  background: #f5e6c8;
  border: 1.5px solid #e8c98a;
  border-left: 5px solid #d9a441;
  color: #6b4a10;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13.5px;
}

.token-result {
  margin-top: 18px;
}

.token-result p {
  margin: 0 0 12px;
  font-size: 14px;
}

.token-result .ok {
  color: var(--success);
  font-weight: 700;
}

.token-result .err {
  color: var(--error);
  font-weight: 700;
}

.token-result .btn-primary {
  margin-top: 0;
  width: auto;
  padding: 11px 20px;
}

.page-footer {
  text-align: center;
  color: var(--navy-soft);
  font-size: 13px;
  margin-top: 36px;
}

.page-footer p {
  margin: 2px 0;
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .page {
    padding: 32px 14px 56px;
  }

  .page-icon {
    width: 40px;
    height: 40px;
  }

  .page-header-text h1 {
    font-size: 22px;
    margin-top: 0;
  }

  .card {
    padding: 20px;
    border-radius: 20px;
  }

  .tabs {
    gap: 2px;
  }

  .tab {
    font-size: 12.5px;
    padding: 9px 8px;
  }

  .blob-amber {
    width: 200px;
    height: 200px;
    top: -80px;
    left: -80px;
  }

  .blob-indigo {
    width: 220px;
    height: 220px;
    top: -100px;
    right: -100px;
  }

  .blob-navy {
    display: none;
  }
}

/* ---------- Focus visibility for keyboard users ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
