/* =========================================================
   FREE WEBSITE CHECK + SCORE RINGS
   Used on the homepage (form in the hero) and the Web Design page.
   Results are compact, so they fit on one screen.
   ========================================================= */

.audit-section {
  padding: 30px 25px;
}

.note-small {
  font-size: 13px;
  color: #8a8a9a;
  text-align: center;
  margin: 14px auto 0;
}

/* When the results box is still hidden, the section takes no space */
.audit-section:has(> .audit-box[hidden]) {
  padding: 0;
}

/* ---------- Website check inside the homepage hero ---------- */

.hero .audit-form {
  position: relative;
  z-index: 1;
  margin-top: 32px;
}

.hero .audit-form input {
  background: rgba(11, 11, 15, 0.75);
  border-color: #3a3a48;
}

.hero .audit-status {
  position: relative;
  z-index: 1;
}

.hero-alt {
  position: relative;
  z-index: 1;
  font-size: 15px !important;
  margin: 6px 0 0;
}

.hero-alt a {
  color: #a29bfe;
}

/* ---------- Score rings (size is set with --size) ---------- */

.rings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}

.ring {
  --size: 130px;
  --score: 0;
  --ring-color: #55efc4;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ring svg {
  width: var(--size);
  height: var(--size);
  transform: rotate(-90deg); /* start the circle at the top */
}

.ring-bg,
.ring-fg {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: #22222c;
}

/* 327 is the length of the circle's outline (2 x 3.14 x 52) */
.ring-fg {
  stroke: var(--ring-color);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.in-view .ring-fg,
.ring.filled .ring-fg {
  stroke-dashoffset: calc(327 * (1 - var(--score)));
}

/* The number sits in the middle of the circle */
.ring b {
  position: absolute;
  top: calc(var(--size) / 2);
  transform: translateY(-50%);
  font-size: calc(var(--size) * 0.23);
  font-weight: 800;
}

.ring span {
  margin-top: 8px;
  font-size: 14px;
  color: #c8c8d4;
}

/* ---------- The check box ---------- */

.audit-box {
  max-width: 900px;
  margin: 0 auto;
  background: #15151c;
  border: 1px solid #6c5ce7;
  border-radius: 24px;
  padding: 36px 36px 28px;
  box-shadow: 0 0 60px rgba(108, 92, 231, 0.2);
}

.audit-box[hidden] {
  display: none;
}

.audit-box h2 {
  margin: 0 0 12px;
}

.audit-sub {
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: 17px;
}

/* Once results show, the intro hides to save space */
.audit-box.has-results .audit-intro {
  display: none;
}

.audit-form {
  display: flex;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
}

.audit-form input,
.audit-lead input {
  flex: 1;
  min-width: 0;
  background: #0b0b0f;
  border: 1px solid #2a2a35;
  border-radius: 50px;
  padding: 15px 22px;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
}

.audit-form input:focus,
.audit-lead input:focus {
  outline: none;
  border-color: #6c5ce7;
}

.audit-form .btn,
.audit-lead .btn {
  margin-top: 0;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  white-space: nowrap;
}

.audit-form .btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.audit-status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 15px;
}

/* ---------- Results (compact) ---------- */

.audit-results {
  text-align: left;
}

.audit-results[hidden] {
  display: none;
}

.results-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.audit-site {
  margin: 0;
  font-size: 15px;
  word-break: break-all;
}

.again-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #2a2a35;
  border-radius: 50px;
  padding: 7px 14px;
  color: #c8c8d4;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.again-btn:hover {
  border-color: #6c5ce7;
  color: #ffffff;
}

/* Smaller rings inside the results */
.audit-results .rings {
  gap: 10px;
  max-width: none;
}

.audit-results .ring {
  --size: 92px;
}

.audit-results .ring span {
  font-size: 13px;
}

/* Three quick facts in a row */
.audit-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.fact {
  background: #0b0b0f;
  border: 1px solid #2a2a35;
  border-radius: 12px;
  padding: 10px 14px;
}

.fact span {
  display: block;
  font-size: 12px;
  color: #a0a0b0;
}

.fact strong {
  font-size: 16px;
}

/* Fixes on the left, lead form on the right */
.results-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.audit-results h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.audit-fixes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.audit-fixes li {
  position: relative;
  padding: 8px 0 8px 24px;
  border-top: 1px solid #2a2a35;
  font-size: 14px;
  line-height: 1.45;
  color: #c8c8d4;
}

.audit-fixes li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #00d2ff;
}

.audit-lead {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.16), rgba(0, 210, 255, 0.1));
  border: 1px solid #2a2a35;
  border-radius: 16px;
  padding: 18px;
}

.audit-lead p {
  font-size: 14px;
  margin: 0 0 12px;
}

.lead-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-lead input {
  padding: 11px 18px;
  font-size: 15px;
}

.audit-lead .btn {
  padding: 12px;
  font-size: 15px;
}

/* ---------- Tablets and phones ---------- */

@media (max-width: 768px) {
  .audit-section {
    padding: 24px 14px;
  }

  .audit-box {
    padding: 26px 18px 20px;
    border-radius: 20px;
  }

  .audit-form {
    flex-direction: column;
  }

  .results-bottom {
    grid-template-columns: 1fr;
  }

  .audit-results .ring {
    --size: 66px;
  }

  .audit-results .ring span {
    font-size: 11px;
    text-align: center;
  }

  .fact {
    padding: 8px 10px;
  }

  .fact span {
    font-size: 11px;
  }

  .fact strong {
    font-size: 14px;
  }

  .rings {
    grid-template-columns: repeat(4, 1fr);
  }

  /* The big target rings stay 2 x 2 on phones */
  .watch-view.rings {
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring-fg {
    transition: none;
  }
}
