/* ============================================================
   bysajid.com — Free Tools (calculators & audits)
   Mobile-first, follows the site design system.
   ============================================================ */

/* ---------- Tool layout ---------- */
.tool-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.tool-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}

.tool-panel__head {
  margin-bottom: 1.5rem;
}

.tool-panel__head h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.tool-panel__head p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Form fields ---------- */
.field {
  display: grid;
  gap: 0.5rem;
}

.field + .field {
  margin-top: 1.3rem;
}

.field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.field label,
.field__label-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.field select,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field select:focus,
.field input[type="text"]:focus,
.field input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%23a8852e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.6rem;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Range sliders ---------- */
.range__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.range__val {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--gold-2);
  white-space: nowrap;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) var(--fill, 50%), var(--line) var(--fill, 50%));
  outline: none;
  touch-action: manipulation;
  min-height: 24px;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(198, 162, 74, 0.55);
  cursor: pointer;
}

.range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid #fff;
  box-shadow: 0 2px 10px rgba(198, 162, 74, 0.55);
  cursor: pointer;
}

.range:focus-visible {
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* ---------- Checkboxes (checklists) ---------- */
.check-group {
  display: grid;
  gap: 0.6rem;
}

.check-item {
  position: relative;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.check-item:hover {
  border-color: rgba(198, 162, 74, 0.5);
}

.check-item:active {
  transform: scale(0.995);
}

.check-item.checked {
  border-color: rgba(198, 162, 74, 0.6);
  background: var(--gold-soft);
}

.check-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-item__box {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 8px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.check-item__box svg {
  width: 14px;
  height: 14px;
}

.check-item input:checked + .check-item__box {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1a1a;
}

.check-item input:focus-visible + .check-item__box {
  box-shadow: 0 0 0 3px var(--gold-soft);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.check-item__body {
  display: grid;
  gap: 0.15rem;
}

.check-item__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.check-item__desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Buttons inside tools ---------- */
.tool-submit {
  width: 100%;
  margin-top: 1.6rem;
}

.tool-reset {
  width: 100%;
  margin-top: 0.6rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  min-height: 48px;
}

.tool-reset:hover {
  border-color: var(--gold-2);
  color: var(--gold-2);
}

/* ---------- Results ---------- */
.tool-result {
  display: none;
}

.tool-result.show {
  display: block;
}

.tool-result__verdict {
  text-align: center;
  margin-bottom: 1.4rem;
}

.tool-result__title {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.tool-result__sub {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 26rem;
  margin-inline: auto;
}

/* Score gauge */
.gauge {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 1.4rem auto 1rem;
}

.gauge__svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge__bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 13;
}

.gauge__fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 13;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.7s ease;
}

.gauge__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.gauge__num b {
  font-family: var(--serif);
  font-size: 2.7rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.gauge__num span {
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Stat cards */
.stat-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.result-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.result-stat__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-stat__val {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.3rem;
  line-height: 1.2;
  word-break: break-word;
}

.result-stat__val small {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

/* Recommendation list */
.rec-block {
  margin-top: 1.4rem;
  border-top: 1px dashed var(--line);
  padding-top: 1.2rem;
}

.rec-block h3 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.rec-block p.rec-empty {
  font-size: 0.9rem;
  color: var(--muted);
}

.rec-list {
  display: grid;
  gap: 0.6rem;
}

.rec {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.rec svg {
  flex: none;
  color: var(--gold-2);
  margin-top: 0.15rem;
}

.rec.rec--done {
  background: var(--surface);
  color: var(--muted);
}

.rec.rec--done svg {
  color: #7fa37a;
}

/* Disclaimer */
.tool-note {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1.3rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(198, 162, 74, 0.45);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

.tool-note svg {
  flex: none;
  color: var(--gold-2);
  margin-top: 0.1rem;
}

.tool-note a {
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Tool directory cards ---------- */
.tool-grid-cards {
  display: grid;
  gap: 1.25rem;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), rgba(198, 162, 74, 0.2));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(198, 162, 74, 0.55);
  box-shadow: var(--shadow-lg);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tool-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-3) 100%);
  color: var(--gold);
}

.tool-card__icon svg {
  width: 24px;
  height: 24px;
}

.tool-card__tag {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
  background: var(--gold-soft);
  padding: 0.3rem 0.6rem;
  border-radius: 7px;
  white-space: nowrap;
}

.tool-card h3 {
  font-size: 1.2rem;
  line-height: 1.3;
}

.tool-card h3 a {
  color: var(--ink);
}

.tool-card h3 a:hover {
  color: var(--gold-2);
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
}

.tool-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-card__meta span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.tool-card__cta {
  margin-top: auto;
}

/* Dark variant (homepage) */
.tool-card--dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-dark);
}

.tool-card--dark h3 a {
  color: #fff;
}

.tool-card--dark h3 a:hover {
  color: var(--gold);
}

.tool-card--dark p {
  color: #aab4c4;
}

.tool-card--dark .tool-card__tag {
  background: rgba(198, 162, 74, 0.16);
}

.tool-card--dark .tool-card__meta span {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-dark);
  color: #d7dee9;
}

.tool-card--dark:hover {
  border-color: rgba(198, 162, 74, 0.5);
  box-shadow: var(--shadow-lg);
}

.tool-card--dark .tool-card__cta {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.tool-card--dark .tool-card__cta:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Related tools strip ---------- */
.related-strip {
  display: grid;
  gap: 0.75rem;
}

.related-strip a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  min-height: 52px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.related-strip a:hover {
  border-color: rgba(198, 162, 74, 0.55);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.related-strip svg {
  flex: none;
  color: var(--gold-2);
}

/* ---------- Media queries ---------- */
@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 920px) {
  .tool-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .tool-result {
    position: sticky;
    top: calc(var(--header-h) + 1.25rem);
  }

  .tool-grid-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}
