/* ====================================================
   yandex-goals.css — локальные стили инструмента
   создания целей Яндекс Метрики. Префикс yg-.
   База и общие компоненты: base.css + tool-page.css.
   ==================================================== */

/* Форма в этом туле — таблица целей, ей нужно больше места */
.fc-grid { grid-template-columns: 460px 1fr; }
@media (max-width: 980px) { .fc-grid { grid-template-columns: 1fr; } }


/* ============================================================
   TOPBAR: доступ к API
   ============================================================ */

.yg-topbar { align-items: stretch; }

.yg-creds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.yg-cred {
  display: flex;
  align-items: center;
  gap: 8px;
}
.yg-cred-token { flex: 1; min-width: 280px; }
.yg-cred-token .fc-key-input-wrap { flex: 1; }
.yg-cred-counter .fc-input { width: 130px; }

.yg-oauth { flex: none; padding: 7px 12px; }

@media (max-width: 720px) {
  .yg-creds { flex-direction: column; align-items: stretch; }
  .yg-cred { flex-wrap: wrap; }
  .yg-cred-token { min-width: 0; }
  .yg-cred-counter .fc-input { width: 100%; }
  .yg-oauth { width: 100%; justify-content: center; }
  .fc-mode { width: 100%; }
  .fc-mode-tab { flex: 1; justify-content: center; }
}


/* ============================================================
   РУЧНОЙ РЕЖИМ: таблица целей
   ============================================================ */

.yg-rows-head,
.yg-row {
  display: grid;
  grid-template-columns: 1fr 1fr 104px 28px;
  gap: 8px;
  align-items: center;
}
.yg-rows-head {
  font-family: var(--font-mono);
  font-size: var(--fc-fs-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 0 0 2px;
}

.yg-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.yg-row .fc-input { padding: 7px 9px; }
.yg-row .yg-remove { justify-self: center; }

.yg-add { align-self: flex-start; padding: 7px 12px; }


/* ============================================================
   РЕЖИМ «СПИСКОМ» и заметки
   ============================================================ */

/* Note: use .fc-note from tool-page.css instead of duplicate styles */
.yg-note {
  /* Reuse from tool-page.css .fc-note */
  margin: 0;
  padding: 10px 12px;
  font-size: var(--fc-fs-sm);
  line-height: 1.55;
  color: var(--ink-600);
  background: var(--ink-50);
  border-left: 3px solid var(--lime-400);
  border-radius: 0 var(--fc-r-1) var(--fc-r-1) 0;
}
.yg-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--ink-100);
  padding: 1px 5px;
  border-radius: 3px;
}
.yg-note a { color: var(--ink-800); border-bottom: 1px solid var(--lime-200); }

/* Счётчик целей в primary-кнопке */
.yg-foot-count {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  background: var(--lime-200);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}


/* ============================================================
   РЕЖИМ «PROTECTION»
   ============================================================ */

.yg-preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.yg-preset-toggle { padding: 4px 8px; }
.yg-preset-counter {
  font-family: var(--font-mono);
  font-size: var(--fc-fs-xs);
  color: var(--ink-500);
}

.yg-preset-rows { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.yg-preset-row {
  display: grid;
  grid-template-columns: 24px 1fr 150px;
  gap: 8px;
  align-items: center;
}
.yg-preset-row .fc-input { padding: 6px 9px; }
.yg-preset-row .fc-input[readonly] { color: var(--ink-500); background: var(--ink-50); }

/* Custom checkbox — use .fc-checkbox from tool-page.css for shared styling */
.yg-check {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.yg-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.yg-check span {
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink-300);
  border-radius: var(--fc-r-1);
  background: var(--white);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-2) var(--ease-out);
}
.yg-check input:checked + span {
  background: var(--lime-400);
  border-color: var(--lime-400);
  color: var(--accent);
}
.yg-check input:focus-visible + span {
  outline: 2px solid var(--fc-lime-ring);
  outline-offset: 2px;
}


/* ============================================================
   РЕЗУЛЬТАТЫ: живой лог
   Reuse .fc-log-* from tool-page.css for common patterns
   ============================================================ */

.yg-output { padding: 0; }
.yg-output .fc-empty { padding: 48px 16px; }

.yg-log {
  display: flex;
  flex-direction: column;
}
.yg-log[hidden] { display: none; }

.yg-log-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ink-100);
  font-size: var(--fc-fs-sm);
}

.yg-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-300);
}

.yg-log-row.is-pending .yg-log-dot {
  background: var(--lime);
  animation: fcPulse 1.2s ease-in-out infinite;
}

.yg-log-row.is-ok .yg-log-dot    { background: #10b981; }
.yg-log-row.is-error .yg-log-dot { background: #d4351c; }

.yg-log-name {
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yg-log-msg {
  font-family: var(--font-mono);
  font-size: var(--fc-fs-xs);
  color: var(--ink-500);
  white-space: nowrap;
}

.yg-log-row.is-ok .yg-log-msg    { color: #10b981; }
.yg-log-row.is-error .yg-log-msg { color: #d4351c; white-space: normal; }


/* ============================================================
   SEO-блок
   ============================================================ */

.yg-seo {
  margin: 56px auto 0;
  max-width: 880px;
  text-align: center;
}
.yg-seo-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.02em;
  color: var(--ink-950);
  margin: 0 0 10px;
}
.yg-seo-lead {
  font-size: var(--fc-fs-md);
  line-height: 1.6;
  color: var(--ink-600);
  max-width: 620px;
  margin: 0 auto 28px;
}
.yg-seo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  text-align: left;
}
@media (max-width: 720px) { .yg-seo-grid { grid-template-columns: 1fr; } }

.yg-seo-card {
  background: var(--white);
  border: var(--fc-border);
  border-radius: var(--fc-r-4);
  box-shadow: var(--fc-shadow-flat);
  padding: 18px;
}
.yg-seo-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--fc-r-2);
  background: var(--lime-100);
  color: var(--accent);
  margin-bottom: 12px;
}
.yg-seo-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fc-fs-lg);
  color: var(--ink-950);
  margin: 0 0 6px;
}
.yg-seo-card p {
  font-size: var(--fc-fs-sm);
  line-height: 1.55;
  color: var(--ink-600);
  margin: 0;
}
