/* Competitor Research — ONLY the unique wizard widget (cr-*).
   Everything else (hero, sections, tools carousel, buttons, badges, CTA) is
   styled by the SayNine theme's own stylesheets, so the page uses the real
   templates, not our approximations:
     - main_v2.css        (global: .button, .label, .inner_wrapper, .result_*, .section_title)
     - free_seo_audit.css (page:   .hero, .meta_*, .tools*, .pill, .fsa-*)
     - swiper-bundle.min.css
   On WordPress those are enqueued by the theme (see wordpress/README.md).
   The local harness links them from saynine.ai so it previews identically. */

@import url("https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700;800&display=swap");

:root {
  --navy: #021D3D;
  --ink: #0c2340;
  --ink-2: #031D3D;
  --yellow: #FFC73C;
  --blue: #077DFD;
  --blue-link: #1a73e8;
  --input: #F6FAFF;
  --muted: #5b6b80;
  --muted-2: #7f88a2;
  --err: #FF6B6B;
  --green: #16b364;
}

.cr-page { margin: 0; min-height: 100vh; background: var(--navy); color: var(--ink); }
[hidden] { display: none !important; }

/* hero: the theme hero is built for the full-width audit form; our wizard is
   narrower, so center the header + widget (keeps the theme's white-card look). */
.hero .hero__container { display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 5vw, 48px); }
.hero .hero__header { display: block; text-align: center; max-width: 760px; margin: 0; }
.hero .hero__title { margin-bottom: 18px; }
.hero .cr-card { margin: 0 auto; }

/* ---- widget card ---- */
.cr-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid #e7edf6;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(3, 29, 61, .10);
  padding: clamp(24px, 4vw, 40px);
  font-family: "League Spartan", "Helvetica Neue", Arial, sans-serif;
}

.cr-step { display: none; }
.cr-step.cr-step--active { display: block; animation: cr-fade .25s ease; }
@keyframes cr-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cr-label { display: block; font-weight: 600; font-size: 16px; color: var(--ink); margin: 0 0 12px; }
.cr-label + .cr-input, .cr-label + .cr-toggle { margin-bottom: 0; }
.cr-sub2 { font-weight: 400; color: var(--muted-2); }

.cr-input {
  width: 100%;
  background-color: var(--input);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 15px 18px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.cr-input::placeholder { color: #9aa6bd; }
.cr-input:focus { border-color: var(--blue); }
.cr-input.cr-error-field { border-color: var(--err); }

.cr-field { margin-bottom: 8px; }
.cr-field + .cr-field { margin-top: 16px; }
.cr-step .cr-input { margin-bottom: 24px; }
.cr-step .cr-input:last-of-type { margin-bottom: 0; }
.cr-hint { margin: 10px 0 24px; font-size: 14px; color: var(--muted-2); }
.cr-reason { margin: 8px 0 0; font-size: 13px; color: var(--muted-2); min-height: 1em; }

/* mode toggle (segmented) */
.cr-toggle { display: flex; gap: 6px; padding: 5px; background: var(--input); border-radius: 200px; }
.cr-toggle__opt {
  flex: 1; border: 0; border-radius: 200px; padding: 12px 14px;
  font-family: inherit; font-weight: 700; font-size: 15px; color: var(--muted);
  background: transparent; cursor: pointer; transition: .15s;
}
.cr-toggle__opt:hover { color: var(--ink); }
.cr-toggle__opt.is-active { background: var(--blue); color: #fff; }

/* alternates */
.cr-alts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.cr-alts__label { font-size: 13px; color: var(--muted-2); }
.cr-chip {
  border: 1px solid #dce5f2; background: #fff; color: var(--ink);
  border-radius: 200px; padding: 7px 14px; font-family: inherit; font-size: 13px; cursor: pointer;
}
.cr-chip:hover { border-color: var(--blue); }

/* actions + widget buttons */
.cr-actions { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.cr-btn { font-family: inherit; font-weight: 700; font-size: 16px; cursor: pointer; border: 0; transition: .15s; }
.cr-btn--primary {
  margin-left: auto; background: var(--yellow); color: var(--ink);
  border-radius: 200px; padding: 14px 26px; display: inline-flex; align-items: center; gap: 8px;
}
.cr-btn--primary:hover { filter: brightness(.96); }
.cr-btn--primary:disabled { opacity: .6; cursor: default; }
.cr-btn--back { background: transparent; color: var(--blue-link); padding: 8px 4px; }
.cr-btn--back:hover { text-decoration: underline; }
.cr-btn.is-loading { position: relative; color: transparent; }
.cr-btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(12, 35, 64, .35); border-top-color: var(--ink);
  animation: cr-spin .7s linear infinite;
}
@keyframes cr-spin { to { transform: rotate(360deg); } }

/* error */
.cr-error {
  margin: 18px 0 0; padding: 12px 16px; border-radius: 12px;
  background: #fff1f1; border: 1px solid #ffd0d0; color: #c0392b; font-size: 14px;
}

/* progress dots */
.cr-dots { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.cr-dot { width: 9px; height: 9px; border-radius: 50%; background: #d7e0ee; transition: .2s; }
.cr-dot--active { background: var(--blue); transform: scale(1.15); }
.cr-dot--done { background: var(--green); }

/* result panel (building -> sent | failed) */
.cr-result { text-align: center; padding: 8px 0; animation: cr-fade .3s ease; }
.cr-result__view { animation: cr-fade .25s ease; }
.cr-spinner {
  width: 52px; height: 52px; margin: 4px auto 22px; border-radius: 50%;
  border: 4px solid #e3eaf5; border-top-color: var(--blue); animation: cr-spin .8s linear infinite;
}
.cr-result__icon {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 700; line-height: 1;
}
.cr-result__icon--ok { background: #e7f8ef; color: var(--green); }
.cr-result__icon--err { background: #fdeaea; color: #d0392b; }
.cr-result__title { margin: 0 0 10px; font-size: 26px; font-weight: 700; color: var(--ink-2); }
.cr-result__msg { margin: 0 auto 22px; max-width: 40ch; font-size: 16px; line-height: 1.55; color: var(--muted); }
.cr-actions--center { justify-content: center; }
.cr-actions--center .cr-btn--primary { margin-left: 0; }

/* harness footer placeholder (WP uses the theme footer via get_footer) */
.cr-foot { text-align: center; color: #6f7ea0; font-size: 13px; padding: 24px; }

/* our mascot in the theme's Ready-to-build CTA (theme .result_img is sized for a video).
   #result prefix so we beat the theme's .result_img on specificity. */
#result .result_img { flex-shrink: 0; width: 40%; max-width: 340px; display: flex; align-items: center; margin: 0; }
#result .result_img img { width: 100%; height: auto; display: block; }
#result .result_btn { white-space: nowrap; }   /* keep "Contact us" on one line */
#result .result_btn svg { width: 28px; height: 28px; flex-shrink: 0; display: block; }  /* theme sizes img, not our inline svg */
@media (max-width: 1024px) { #result .result_img { width: 100%; max-width: 300px; margin: 0 auto; } }
