/* =====================================================================
   Quick SEO Check — hero-блок в верх /tools
   ===================================================================== */

/* ── Quick Check root ── */
.quick-check {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

/* ── Hero ── */
.quick-check-hero {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.quick-check-title {
  font-size: var(--fs-metric);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.01em;
}

.quick-check-subtitle {
  color: var(--text-dim);
  font-size: var(--fs-xl);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto var(--space-xl);
}

/* ── Form ── */
.quick-check-form {
  display: flex;
  gap: var(--space-md);
  max-width: 640px;
  margin: 0 auto var(--space-md);
}

.quick-check-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-xl);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  min-width: 0;
}

.quick-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 2px rgba(0,0,0,0.08);
}

.quick-check-input::placeholder { color: var(--text-muted); }

.quick-check-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  min-width: 160px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent), #fff 10%) 0%, var(--accent) 50%, color-mix(in srgb, var(--accent), #000 20%) 100%);
  color: var(--on-accent);
  font-family: var(--font);
  font-size: var(--fs-xl);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 12px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.quick-check-submit:hover { filter: brightness(1.15); }
.quick-check-submit:active { transform: scale(0.98); }

.quick-check-submit[disabled] {
  opacity: 0.85;
  cursor: progress;
}

.quick-check-hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ── Spinner in button ── */
.qc-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: qc-spin 0.8s linear infinite;
}

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

/* ── Grid ── */
.quick-check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ── State: empty (before submit) — hide grid entirely ── */
.quick-check[data-state="empty"] .quick-check-grid { display: none; }
.quick-check[data-state="empty"] .qc-error-banner { display: none; }

/* ── State: loading — show skeletons ── */
.quick-check[data-state="loading"] .qc-error-banner { display: none; }

/* ── State: result — show cards ── */
.quick-check[data-state="result"] .qc-error-banner { display: none; }

/* ── State: error — hide grid, show banner ── */
.quick-check[data-state="error"] .quick-check-grid { display: none; }

/* ── Card ── */
.qc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 16px 18px;
  min-height: 138px;
  background: color-mix(in srgb, var(--bg-card), transparent 45%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color var(--dur-mid) var(--ease),
              box-shadow var(--dur-mid) var(--ease),
              transform var(--dur-mid) var(--ease);
}

.qc-card:hover:not(.is-empty):not(.is-loading) {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.light .qc-card {
  background: rgba(250,250,245,0.90);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.light .qc-card:hover:not(.is-empty):not(.is-loading) {
  box-shadow: var(--shadow-md);
  border-color: rgba(26,150,72,0.25);
}

/* Empty state */
.qc-card.is-empty { opacity: 0.55; }

/* ── Head: icon + title + status ── */
.qc-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.qc-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  color: var(--accent);
}
.qc-card-icon svg { width: 20px; height: 20px; }

.qc-card.is-empty .qc-card-icon {
  background: var(--bg-input);
  color: var(--text-muted);
}

.qc-card-title {
  flex: 1;
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.25;
  margin: 6px 0 0;
  color: var(--text);
}

/* ── Status badge ── */
.qc-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 4px;
  line-height: 1.2;
}
.qc-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.qc-status--ok       { background: var(--green-bg);  color: var(--green); }
.qc-status--warning  { background: var(--yellow-bg); color: var(--yellow); }
.qc-status--error    { background: var(--red-bg);    color: var(--red); }
.qc-status--skipped  { background: var(--bg-input);  color: var(--text-muted); }

/* ── Summary ── */
.qc-card-summary {
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--text-dim);
  margin: 0;
  word-break: break-word;
}

.qc-card.is-empty .qc-card-summary { color: var(--text-muted); }

/* ── Foot: Открыть проверку → ── */
.qc-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.qc-card-more {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform var(--dur-fast) var(--ease);
}
.qc-card-more:hover { transform: translateX(2px); }

/* ── Skeleton (loading state) ── */
.qc-skeleton {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-input) 0%,
    color-mix(in srgb, var(--bg-input), var(--text) 8%) 50%,
    var(--bg-input) 100%
  );
  background-size: 200% 100%;
  animation: qc-shimmer 1.2s ease-in-out infinite;
}
.qc-skeleton--icon  { width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0; }
.qc-skeleton--title { width: 55%; height: 14px; margin-top: 8px; }
.qc-skeleton--badge { width: 56px; height: 18px; border-radius: 9999px; margin-top: 6px; flex-shrink: 0; }
.qc-skeleton--line  { width: 100%; }
.qc-skeleton--line-short { width: 70%; }

@keyframes qc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.qc-card.is-loading { pointer-events: none; }

/* ── Error state (per-card) ── */
.qc-card.is-error .qc-card-icon {
  background: var(--red-bg);
  color: var(--red);
}

/* ── Error banner (global, for data-state="error") ── */
.qc-error-banner {
  max-width: 640px;
  margin: var(--space-xl) auto 0;
  padding: 16px 20px;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red), transparent 70%);
  border-radius: var(--radius);
  font-size: var(--fs-md);
  line-height: 1.5;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .quick-check-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .quick-check { padding: 28px 16px 0; }
  .quick-check-title { font-size: calc(var(--fs-base) + 10px); }
  .quick-check-subtitle { font-size: var(--fs-lg); }

  .quick-check-form { flex-direction: column; }
  .quick-check-submit { width: 100%; }
  .quick-check-input { font-size: var(--fs-lg); padding: 12px 14px; }

  .quick-check-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .quick-check-title { font-size: calc(var(--fs-base) + 7px); }
  .qc-card { min-height: auto; }
}
