/* ==========================================================
   VersaForge - AI Search Visibility Checker
   ----------------------------------------------------------
   Namespaced .avc-* throughout so nothing here can collide
   with any other page's styles. Every font-size in this file
   is 12px or larger, on every breakpoint, by design rule.
   ========================================================== */

.avc-tool {
  background: #FFFFFF;
  border: 1px solid var(--vf-border, #E6ECF5);
  border-radius: 1.5rem;
  box-shadow: 0 25px 60px -20px rgba(106, 88, 228, .14), 0 4px 16px -6px rgba(17, 24, 39, .05);
  padding: 1.75rem;
}

@media (min-width: 640px) {
  .avc-tool { padding: 2.25rem; }
}

/* ---------- Form ---------- */
.avc-form { display: flex; flex-direction: column; gap: 1.1rem; }

.avc-field { display: flex; flex-direction: column; gap: .4rem; }

.avc-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 560px) {
  .avc-field-row { grid-template-columns: 1fr 1fr; }
}

.avc-field label {
  font: 700 13px/1.3 'Inter', sans-serif;
  color: #111827;
}

.avc-field input,
.avc-field select {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border-radius: .8rem;
  border: 1.5px solid var(--vf-border, #E6ECF5);
  background: #F8FAFF;
  font: 500 14px/1.3 'Inter', sans-serif;
  color: #111827;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  appearance: none;
}

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

.avc-field input::placeholder { color: #9AA3B5; }

.avc-field input:focus,
.avc-field select:focus {
  outline: none;
  border-color: #6A58E4;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(106, 88, 228, .12);
}

.avc-field input:invalid:not(:placeholder-shown),
.avc-field.is-invalid input,
.avc-field.is-invalid select {
  border-color: #EF4444;
}

.avc-disclaimer {
  text-align: center;
  font: 500 12px/1.4 'Inter', sans-serif;
  color: #8E97A8;
  margin-top: -.2rem;
}

/* ---------- Results panel ---------- */
.avc-results {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid #EEF1F6;
  animation: avc-fade-up .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes avc-fade-up {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.avc-score-head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.avc-score-ring {
  position: relative;
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
}
.avc-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.avc-ring-track {
  fill: none;
  stroke: #EEF1F8;
  stroke-width: 9;
}
.avc-ring-fill {
  fill: none;
  stroke: #6A58E4;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1), stroke .4s ease;
}

.avc-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  font-family: 'Inter', sans-serif;
  color: #111827;
}
.avc-ring-num #avcScoreNum { font-weight: 900; font-size: 26px; line-height: 1; }
.avc-ring-suffix { font-weight: 700; font-size: 13px; color: #8E97A8; align-self: flex-end; margin-bottom: 2px; }

.avc-score-info {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.avc-score-label {
  font: 700 12px/1.2 'Inter', ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8E97A8;
}
.avc-score-verdict {
  font: 800 20px/1.25 'Inter', sans-serif;
  color: #111827;
}
.avc-score-summary {
  font: 500 13px/1.5 'Inter', sans-serif;
  color: #5B6475;
  margin-top: .2rem;
}

/* ---------- Signal breakdown ---------- */
.avc-breakdown {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.avc-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem .95rem;
  border-radius: .9rem;
  background: #F8FAFF;
  border: 1px solid var(--vf-border, #E6ECF5);
}

.avc-row-ico {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: .65rem;
  display: grid;
  place-items: center;
  color: #fff;
}
.avc-row.is-good .avc-row-ico { background: linear-gradient(135deg, #10B981, #059669); }
.avc-row.is-warn .avc-row-ico { background: linear-gradient(135deg, #F59E0B, #D97706); }
.avc-row.is-bad  .avc-row-ico { background: linear-gradient(135deg, #EF4444, #DC2626); }

.avc-row-main { flex: 1 1 auto; min-width: 0; }
.avc-row-title { font: 700 13px/1.3 'Inter', sans-serif; color: #111827; }
.avc-row-note  { font: 500 12px/1.4 'Inter', sans-serif; color: #5B6475; margin-top: .1rem; }

.avc-row-tag {
  flex: 0 0 auto;
  font: 800 12px/1 'Inter', ui-monospace, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .35rem .6rem;
  border-radius: 999px;
}
.avc-row.is-good .avc-row-tag { background: rgba(16, 185, 129, .12); color: #059669; }
.avc-row.is-warn .avc-row-tag { background: rgba(245, 158, 11, .14); color: #B45309; }
.avc-row.is-bad  .avc-row-tag { background: rgba(239, 68, 68, .12); color: #DC2626; }

/* ---------- Bottom CTA + reset ---------- */
.avc-cta {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(106, 88, 228, .07), rgba(74, 134, 245, .05));
  border: 1px solid rgba(106, 88, 228, .16);
}
.avc-cta-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.avc-cta-title { font: 800 14px/1.3 'Inter', sans-serif; color: #111827; }
.avc-cta-sub   { font: 500 12.5px/1.4 'Inter', sans-serif; color: #5B6475; }

.avc-reset {
  margin: 1.1rem auto 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  font: 700 12.5px/1 'Inter', sans-serif;
  color: #6A58E4;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.avc-reset:hover { text-decoration: underline; }

/* ---------- Signal explainer cards (section 2) ---------- */
.avc-signal-card {
  background: #FFFFFF;
  border: 1px solid var(--vf-border, #E6ECF5);
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 14px 34px -20px rgba(17, 24, 39, .1);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.avc-signal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(106, 88, 228, .3);
  box-shadow: 0 18px 40px -18px rgba(106, 88, 228, .22);
}

.avc-signal-ico {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border-radius: .9rem;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6A58E4, #4A86F5);
  color: #fff;
  margin-bottom: 1rem;
}

.avc-signal-title {
  font: 800 15px/1.3 'Inter', sans-serif;
  color: #111827;
  margin-bottom: .4rem;
}
.avc-signal-desc {
  font: 500 13px/1.55 'Inter', sans-serif;
  color: #5B6475;
}

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .avc-results { animation: none; }
  .avc-ring-fill { transition: none; }
  .avc-signal-card { transition: none; }
}

/* ---------- Mobile tightening (never below 12px) ---------- */
@media (max-width: 480px) {
  .avc-tool { padding: 1.35rem; border-radius: 1.1rem; }
  .avc-field input,
  .avc-field select { height: 46px; font-size: 13px; }
  .avc-score-head { gap: 1.1rem; }
  .avc-score-ring { width: 92px; height: 92px; }
  .avc-ring-num #avcScoreNum { font-size: 22px; }
  .avc-cta { flex-direction: column; align-items: stretch; }
  .avc-cta a { width: 100%; }
}

/* ---------- Real AI call: loading + error states ---------- */
.avc-error {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  font: 500 13px/1.5 'Inter', sans-serif;
  margin-bottom: .25rem;
}
.avc-error[hidden] { display: none; }

.avc-fetch-note {
  margin-top: .9rem;
  padding: .75rem .9rem;
  border-radius: 10px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  font: 500 12.5px/1.5 'Inter', sans-serif;
}

.avc-form button[type="submit"]:disabled {
  opacity: .75;
  cursor: not-allowed;
}

@keyframes avc-spin { to { transform: rotate(360deg); } }
.avc-form button[type="submit"] .animate-spin { animation: avc-spin 0.8s linear infinite; }
