/* ── FREE TOOLS: interactive widgets ── */
/* Loaded alongside style.css + blog.css. Uses the same design tokens. */

.tool-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin: 8px 0 12px;
  box-shadow: 0 1px 2px rgba(43, 42, 39, 0.04), 0 10px 32px rgba(43, 42, 39, 0.06);
}

/* Drop zone */
.tool-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--bg3);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.tool-drop:hover,
.tool-drop.is-drag {
  border-color: var(--accent);
  background: rgba(43, 42, 39, 0.05);
}

.tool-drop .tool-drop-icon {
  display: block;
  width: 26px;
  height: 26px;
  padding: 14px;
  margin: 0 0 16px;
  color: var(--accent);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(43, 42, 39, 0.06);
  box-sizing: content-box;
  transition: transform 0.18s, box-shadow 0.18s;
}

.tool-drop:hover .tool-drop-icon,
.tool-drop.is-drag .tool-drop-icon {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(43, 42, 39, 0.12);
}

.tool-drop strong {
  display: block;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 6px;
}

.tool-drop span {
  font-size: 13.5px;
  color: var(--muted);
}

.tool-drop input[type="file"] {
  display: none;
}

/* Controls row */
.tool-controls {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tool-field > label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.tool-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.tool-row .tool-field {
  flex: 1;
  min-width: 130px;
}

.tool-widget select,
.tool-widget input[type="number"],
.tool-widget input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 13px;
  transition: border-color 0.18s;
}

.tool-widget select:focus,
.tool-widget input:focus {
  outline: none;
  border-color: var(--accent);
}

.tool-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.tool-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.tool-range-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-range-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.tool-range-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Primary action button */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, opacity 0.18s;
}

.tool-btn:hover:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(-1px);
}

.tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tool-btn.tool-btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.tool-btn.tool-btn-ghost:hover:not(:disabled) {
  background: var(--bg3);
  border-color: var(--accent);
}

/* Result area */
.tool-result {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.tool-preview {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  /* checkerboard so transparency is visible */
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.tool-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.tool-stats span {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}

.tool-stats b {
  color: var(--text);
  font-weight: 600;
}

/* ── Inline product CTA (right under the widget) ── */
.tool-inline-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 22px 0 8px;
  padding: 22px 26px;
  background: var(--accent);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(43, 42, 39, 0.14);
}

.tool-inline-cta-text {
  flex: 1;
  min-width: 220px;
}

.tool-inline-cta strong {
  display: block;
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -0.3px;
  margin-bottom: 5px;
}

.tool-inline-cta span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  line-height: 1.55;
}

.tool-cta-btn {
  flex-shrink: 0;
  display: inline-block;
  background: #fff;
  color: var(--accent);
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s;
}

.tool-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

/* ── Peak-intent CTA inside the result panel ── */
.tool-result-cta {
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.tool-result-cta a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tool-result-cta a:hover {
  text-decoration: underline;
}

.tool-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-actions .tool-btn {
  width: auto;
  flex: 1;
  min-width: 160px;
}

/* Privacy / status notes */
.tool-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 16px;
}

.tool-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.8;
}

.tool-status {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}

.tool-status.is-error {
  color: #c0392b;
}

.tool-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(43, 42, 39, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tool-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

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

.tool-hidden {
  display: none !important;
}

/* Checker verdict list */
.tool-verdicts {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.tool-verdict {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: 14px;
  line-height: 1.5;
}

.tool-verdict .tool-verdict-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.tool-verdict.pass .tool-verdict-icon { background: #3f9b6e; }
.tool-verdict.fail .tool-verdict-icon { background: #c0392b; }
.tool-verdict.warn .tool-verdict-icon { background: #c88a2e; }

.tool-verdict b {
  color: var(--text);
  font-weight: 600;
}

.tool-verdict span {
  color: var(--muted);
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.tool-summary {
  text-align: center;
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 16px;
  color: var(--text);
}

/* "Tools" hub grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0 8px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(43, 42, 39, 0.04), 0 8px 24px rgba(43, 42, 39, 0.05);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
  border-color: rgba(43, 42, 39, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 2px 8px rgba(43, 42, 39, 0.05), 0 16px 40px rgba(43, 42, 39, 0.10);
}

.tool-card .tool-card-icon {
  width: 34px;
  height: 34px;
  color: var(--accent);
}

.tool-card h3 {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0;
}

.tool-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.tool-card .tool-card-go {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 640px) {
  .tool-widget { padding: 20px; }
  .tool-drop { padding: 34px 16px; }
  .tools-grid { grid-template-columns: 1fr; }
}
