/* ═══════════════════════════════════════════════
   Tradie Scaler — Free Tools Shared Styles
   ═══════════════════════════════════════════════ */

/* ── Tool page hero ── */
.tool-hero {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.tool-hero .section-label { margin-bottom: 10px; }
.tool-hero h1 { margin: 0 0 12px; }
.tool-hero .tool-hero-sub {
  font-size: 17px; color: var(--text-muted);
  max-width: 620px; margin: 0 auto; line-height: 1.6;
}
.tool-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); color: var(--accent);
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 14px;
  border-radius: 999px; margin-bottom: 16px;
}
.tool-badge svg { width: 14px; height: 14px; fill: currentColor; }

/* ── Tool container ── */
.tool-container {
  max-width: 720px; margin: 0 auto;
  padding: 40px 24px 60px;
}
.tool-container.wide { max-width: 960px; }

/* ── Form elements ── */
.tool-form { display: flex; flex-direction: column; gap: 20px; }

.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field label {
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: 0.01em;
}
.tool-field .field-hint {
  font-size: 13px; color: var(--text-muted); margin-top: -2px;
}

.tool-input,
.tool-select,
.tool-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.tool-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236ee7b7' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.tool-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }

/* Row layout for short fields */
.tool-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 520px) { .tool-row { grid-template-columns: 1fr; } }

/* ── Pill selector ── */
.pill-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pill-option {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.pill-option:hover { border-color: var(--accent); color: var(--text); }
.pill-option.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ── Generate button ── */
.tool-generate {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px;
  background: var(--accent);
  color: oklch(0.16 0.02 165);
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  width: 100%;
  margin-top: 8px;
}
.tool-generate:hover { background: var(--accent-hover); transform: translateY(-1px); }
.tool-generate:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}
.tool-generate .spinner {
  width: 18px; height: 18px;
  border: 2px solid transparent;
  border-top-color: oklch(0.16 0.02 165);
  border-radius: 50%;
  animation: tool-spin 0.6s linear infinite;
  display: none;
}
.tool-generate.loading .spinner { display: inline-block; }
.tool-generate.loading .btn-label { display: none; }

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

/* ── Lead capture gate ── */
.tool-gate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin: 32px 0;
  display: none;
}
.tool-gate.visible { display: block; animation: tool-fadeIn 0.3s ease; }

.tool-gate-header {
  text-align: center; margin-bottom: 24px;
}
.tool-gate-header h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  margin: 0 0 6px; color: var(--text);
}
.tool-gate-header p {
  font-size: 14px; color: var(--text-muted); margin: 0;
}

.gate-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 520px) { .gate-grid { grid-template-columns: 1fr; } }

.gate-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 20px 0;
}

.gate-checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(110,231,183,0.18);
  border-radius: var(--radius);
  margin-top: 4px;
}
.gate-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px; height: 18px;
  margin-top: 2px; flex-shrink: 0;
}
.gate-checkbox label {
  font-size: 14px; color: var(--text); line-height: 1.5;
}
.gate-checkbox label strong { color: var(--accent); }

.gate-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px;
  background: var(--accent);
  color: oklch(0.16 0.02 165);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer; width: 100%;
  margin-top: 8px;
  transition: background 0.15s;
}
.gate-submit:hover { background: var(--accent-hover); }

.gate-skip {
  display: block; text-align: center;
  font-size: 13px; color: var(--text-muted);
  margin-top: 10px; cursor: pointer;
  background: none; border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gate-skip:hover { color: var(--text); }

/* ── Results area ── */
.tool-results {
  display: none;
  margin-top: 32px;
}
.tool-results.visible { display: block; animation: tool-fadeIn 0.4s ease; }

@keyframes tool-fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.result-card h3 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  margin: 0 0 16px; color: var(--accent);
}

.result-content {
  font-size: 15px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap;
}
.result-content h1, .result-content h2, .result-content h3,
.result-content h4, .result-content h5 {
  font-family: var(--font-display); color: var(--text);
  margin: 20px 0 8px; line-height: 1.3;
}
.result-content h2 { font-size: 18px; font-weight: 700; }
.result-content h3 { font-size: 16px; font-weight: 700; }
.result-content ul, .result-content ol {
  padding-left: 20px; margin: 8px 0;
}
.result-content li { margin-bottom: 4px; }
.result-content strong { color: var(--accent); }
.result-content table {
  width: 100%; border-collapse: collapse; margin: 12px 0;
}
.result-content th, .result-content td {
  border: 1px solid var(--border);
  padding: 8px 12px; text-align: left; font-size: 14px;
}
.result-content th {
  background: var(--surface2); font-weight: 600;
}

/* Copy button */
.result-actions {
  display: flex; gap: 10px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.copy-btn, .download-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.copy-btn:hover, .download-btn:hover {
  border-color: var(--accent); color: var(--accent);
}
.copy-btn.copied {
  border-color: var(--accent); color: var(--accent);
}

/* ── Tool hub grid ── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  text-decoration: none;
  display: flex; flex-direction: column;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.tool-card-icon {
  font-size: 36px; margin-bottom: 14px;
}
.tool-card h3 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  margin: 0 0 8px; color: var(--text);
}
.tool-card p {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.6; margin: 0 0 16px; flex: 1;
}
.tool-card-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 10px;
}
.tool-card-cta {
  font-size: 14px; font-weight: 700; color: var(--accent);
}
.tool-card:hover .tool-card-cta { text-decoration: underline; }

/* ── Pricing table specific ── */
.pricing-filters {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.pricing-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.pricing-table th {
  background: var(--surface2);
  padding: 10px 14px; text-align: left;
  font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  cursor: pointer;
}
.pricing-table th:hover { color: var(--accent); }
.pricing-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.pricing-table tr:hover td { background: var(--accent-glow); }
.price-free {
  color: var(--accent); font-weight: 600;
}
.price-tag {
  font-weight: 600;
}
.last-updated {
  font-size: 12px; color: var(--text-muted);
  text-align: right; margin-top: 8px;
}

/* ── Licence lookup specific ── */
.licence-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.licence-header {
  background: var(--accent-dim);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.licence-header h3 {
  margin: 0; font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--accent);
}
.licence-body { padding: 20px; }
.licence-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.licence-row:last-child { border-bottom: none; }
.licence-label { color: var(--text-muted); font-weight: 500; }
.licence-value { color: var(--text); font-weight: 600; text-align: right; }
.licence-value a { color: var(--accent); }

/* ── Rate calculator gauges ── */
.rate-gauge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.rate-gauge .gauge-label {
  font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600; margin-bottom: 8px;
}
.rate-gauge .gauge-value {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800;
  color: var(--accent);
}
.rate-gauge .gauge-sub {
  font-size: 14px; color: var(--text-muted); margin-top: 4px;
}

.rate-breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.rate-breakdown h3 {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  margin: 0 0 12px; color: var(--text);
}
.breakdown-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.breakdown-row .br-label { color: var(--text-muted); }
.breakdown-row .br-value { color: var(--text); font-weight: 600; }
.breakdown-row.total {
  border-top: 2px solid var(--accent);
  margin-top: 8px; padding-top: 10px;
}
.breakdown-row.total .br-label,
.breakdown-row.total .br-value {
  color: var(--accent); font-weight: 700; font-size: 16px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .tool-hero { padding: 36px 0 28px; }
  .tool-hero h1 { font-size: 26px; }
  .tool-container { padding: 28px 16px 48px; }
  .tool-grid { grid-template-columns: 1fr; }
  .result-card { padding: 18px 16px; }
}

/* ── How it works steps ── */
.tool-how-it-works {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding: 0;
}
.tool-step {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(110,231,183,0.04);
  border: 1px solid rgba(110,231,183,0.15);
  border-radius: 10px;
  padding: 16px 14px;
}
.tool-step-num {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: #6ee7b7;
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}
.tool-step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tool-step-text strong {
  font-size: 14px;
  color: #fff;
  line-height: 1.3;
}
.tool-step-text span {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.45;
}
@media (max-width: 600px) {
  .tool-how-it-works {
    flex-direction: column;
    gap: 10px;
  }
  .tool-step { padding: 14px 12px; }
}

/* ── Pain point callout ── */
.tool-pain-point {
  background: rgba(110,231,183,0.05);
  border: 1px solid rgba(110,231,183,0.12);
  border-left: 3px solid #6ee7b7;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 14px;
  line-height: 1.7;
  color: #cbd5e1;
}
.tool-pain-point strong {
  color: #6ee7b7;
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

/* ── Generate hint ── */
.tool-generate-hint {
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  margin-top: 10px;
  margin-bottom: 0;
}

/* SEO content sections */
.tool-seo-content {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.tool-seo-content .content-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.tool-seo-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}
.tool-seo-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #e2e8f0;
}
.tool-seo-content p {
  color: #94a3b8;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.tool-seo-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}
.tool-seo-content ul li {
  color: #94a3b8;
  line-height: 1.7;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
}
.tool-seo-content ul li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #6ee7b7;
}
.tool-seo-content ul li strong {
  color: #e2e8f0;
}
.tool-seo-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.tool-seo-content table th {
  text-align: left;
  padding: 0.75rem;
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tool-seo-content table td {
  padding: 0.75rem;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tool-seo-content em {
  font-style: italic;
  color: #64748b;
  font-size: 0.85rem;
}
