/* ============================================================
   OK Lens Advisor
   Mobile-first. Uses only existing --ok-* tokens (with fallbacks).
   Inherits Inter from the theme. Adapts to [data-theme] via tokens.
   ============================================================ */

.ok-lens-advisor {
  max-width: 720px;
  margin: 0 auto;
  color: var(--ok-text, #eee);
  font-family: var(--ok-font, 'Inter', sans-serif);
}

/* ---- friendly notices (JS off / no data / engine missing) ---- */
.ok-lens-notice {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px;
  text-align: center;
  background: var(--ok-card-bg, #1a1a1a);
  border: 1px solid var(--ok-card-border, #333);
  border-radius: 8px;
}
.ok-lens-notice p { margin: 0 0 1rem; line-height: 1.7; }
.ok-lens-notice p:last-child { margin-bottom: 0; }

/* ============================================================
   WIZARD
   ============================================================ */
.ok-lens-wizard {
  background: var(--ok-card-bg, #1a1a1a);
  border: 1px solid var(--ok-card-border, #333);
  border-radius: 8px;
  padding: 28px 22px;
}

.ok-lens-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.ok-lens-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok-border, #333);
  transition: background 0.25s, transform 0.25s;
}
.ok-lens-dot.is-done { background: var(--ok-text-muted, #999); }
.ok-lens-dot.is-current {
  background: var(--ok-red, #e63946);
  transform: scale(1.25);
}

.ok-lens-stepcount {
  margin: 0 0 4px;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ok-text-muted, #999);
  text-transform: uppercase;
}
.ok-lens-counter {
  margin: 0 0 22px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ok-red, #e63946);
}

.ok-lens-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 24px;
  min-width: 0;
}
.ok-lens-legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 18px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ok-text, #eee);
}
.ok-lens-legend:focus { outline: none; }

/* radio options as tappable cards */
.ok-lens-options { display: grid; gap: 10px; }
.ok-lens-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--ok-input-border, #444);
  border-radius: 8px;
  background: var(--ok-input-bg, #222);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ok-lens-option:hover { border-color: var(--ok-red, #e63946); }
.ok-lens-radio {
  width: 18px;
  height: 18px;
  accent-color: var(--ok-red, #e63946);
  flex-shrink: 0;
  margin: 0;
}
.ok-lens-option-text { font-size: 1.05rem; line-height: 1.4; }
/* selected + keyboard focus states */
.ok-lens-option:has(.ok-lens-radio:checked) {
  border-color: var(--ok-red, #e63946);
  background: color-mix(in srgb, var(--ok-red, #e63946) 12%, var(--ok-input-bg, #222));
}
.ok-lens-option:has(.ok-lens-radio:focus-visible) {
  outline: 2px solid var(--ok-red, #e63946);
  outline-offset: 2px;
}

/* body select */
.ok-lens-select {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--ok-text, #eee);
  background: var(--ok-input-bg, #222);
  border: 1.5px solid var(--ok-input-border, #444);
  border-radius: 8px;
}
.ok-lens-select:focus-visible {
  outline: 2px solid var(--ok-red, #e63946);
  outline-offset: 2px;
  border-color: var(--ok-red, #e63946);
}

.ok-lens-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ok-lens-nav .ok-btn { cursor: pointer; }
.ok-lens-nav .ok-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   RESULTS
   ============================================================ */
.ok-lens-headline {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ok-text, #eee);
}
.ok-lens-headline:focus { outline: none; }
.ok-lens-constrained {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 1.5rem;
  color: var(--ok-text-muted, #999);
  line-height: 1.6;
}

/* review-answers strip */
.ok-lens-review {
  max-width: 820px;
  margin: 0 auto 2rem;
  padding: 14px 18px;
  border: 1px solid var(--ok-card-border, #333);
  border-radius: 8px;
  background: var(--ok-card-bg, #1a1a1a);
}
.ok-lens-review-title {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ok-text-muted, #999);
  margin-bottom: 8px;
}
.ok-lens-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ok-lens-review-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--ok-border, #333);
  border-radius: 999px;
  font-size: 0.9rem;
}
.ok-lens-review-val { color: var(--ok-text, #eee); }
.ok-lens-edit {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ok-link, #4a9ee0);
  cursor: pointer;
}
.ok-lens-edit:hover { text-decoration: underline; }
.ok-lens-edit:focus-visible {
  outline: 2px solid var(--ok-red, #e63946);
  outline-offset: 1px;
}

/* results grid: 1-up mobile -> 3-up desktop */
.ok-lens-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

/* card — matches .ok-gear-card aesthetics */
.ok-lens-card {
  display: flex;
  flex-direction: column;
  background: var(--ok-card-bg, #1a1a1a);
  border: 1px solid var(--ok-card-border, #333);
  border-radius: 8px;
  padding: 22px;
  transition: transform 0.3s;
}
.ok-lens-card:hover { transform: translateY(-4px); }

.ok-lens-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ok-lens-slot {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok-red, #e63946);
}
.ok-lens-badge {
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ok-border, #333);
  color: var(--ok-text-muted, #999);
  white-space: nowrap;
}
.ok-lens-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ok-text, #eee);
}
.ok-lens-stretch {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  margin: 0 0 12px;
  color: #fff;
  background: var(--ok-accent-hover, #c0303b);
}

/* honest fit bar */
.ok-lens-fit { margin-bottom: 16px; }
.ok-lens-fit-label { font-weight: 600; font-size: 0.98rem; }

.ok-lens-why-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok-text-muted, #999);
}
.ok-lens-reasons {
  margin: 0 0 16px;
  padding-left: 1.15rem;
}
.ok-lens-reasons li {
  margin-bottom: 5px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.ok-lens-facts {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}
.ok-lens-facts dt {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok-text-muted, #999);
}
.ok-lens-facts dd {
  margin: 2px 0 0;
  line-height: 1.5;
  font-size: 0.95rem;
  color: var(--ok-text, #eee);
}

.ok-lens-compat {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--ok-border, #333);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ok-text-muted, #999);
}

.ok-lens-specs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 14px;
  padding: 0;
}
.ok-lens-specs li {
  font-size: 0.8rem;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--ok-input-bg, #222);
  border: 1px solid var(--ok-border, #333);
  color: var(--ok-text-muted, #999);
}

.ok-lens-price {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ok-text, #eee);
}

/* CTAs pinned toward the bottom of every card */
.ok-lens-ctas {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ok-lens-cta {
  display: block;
  width: 100%;
  padding: 11px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1.5px solid #d52f3d;
  background: #d52f3d;
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
}
.ok-lens-cta:hover,
.ok-lens-cta:focus-visible {
  background: var(--ok-accent-hover, #c0303b);
  border-color: var(--ok-accent-hover, #c0303b);
  color: #fff;
}
.ok-lens-cta:focus-visible {
  outline: 2px solid var(--ok-link, #4a9ee0);
  outline-offset: 2px;
}
.ok-lens-cta.is-disabled {
  background: transparent;
  border-color: var(--ok-border, #333);
  color: var(--ok-text-faint, #777);
  cursor: not-allowed;
}

.ok-lens-disclosure {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ok-text-muted, #999);
}
.ok-lens-verified {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--ok-text-faint, #777);
}
.ok-lens-verified a {
  color: var(--ok-link, #4a9ee0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ok-lens-results-foot {
  text-align: center;
  margin-top: 2.5rem;
}
.ok-lens-restart { cursor: pointer; }

/* generic keyboard focus fallback for anything not covered above */
.ok-lens-advisor button:focus-visible,
.ok-lens-advisor a:focus-visible {
  outline: 2px solid var(--ok-red, #e63946);
  outline-offset: 2px;
}

/* The hero stays dark in every site theme, including before theme JS runs. */
body.page-template-page-lens-advisor .ok-hero h1,
body.page-template-page-lens-advisor .ok-hero p {
  color: #fff !important;
}
body.page-template-page-lens-advisor .ok-hero h1 span {
  color: #f45b69 !important;
}

/* The footer becomes a light surface in light mode. */
body.page-template-page-lens-advisor .ok-footer-heading {
  color: #f45b69 !important;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer .ok-logo {
  color: #111 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer .ok-logo span {
  color: #c62836 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer .ok-logo + p {
  color: #444 !important;
  opacity: 1 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer-heading {
  color: #333 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer a {
  color: #444 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-footer-bottom {
  color: #555 !important;
}

body.page-template-page-lens-advisor .ok-lens-stretch {
  color: #fff !important;
}

/* Red text needs separate shades against light and dark surfaces. */
html[data-theme="dark"] body.page-template-page-lens-advisor .ok-gear-disclosure a,
html[data-theme="dark"] body.page-template-page-lens-advisor .ok-lens-counter,
html[data-theme="dark"] body.page-template-page-lens-advisor .ok-lens-slot,
html[data-theme="dark"] body.page-template-page-lens-advisor .ok-lens-results-foot .ok-btn-outline {
  color: #f45b69 !important;
}
html[data-theme="light"] body.page-template-page-lens-advisor .ok-gear-disclosure a,
html[data-theme="light"] body.page-template-page-lens-advisor .ok-lens-counter,
html[data-theme="light"] body.page-template-page-lens-advisor .ok-lens-slot,
html[data-theme="light"] body.page-template-page-lens-advisor .ok-lens-results-foot .ok-btn-outline {
  color: #c62836 !important;
}

/* ---- desktop: 3-up results grid ---- */
@media (min-width: 900px) {
  .ok-lens-advisor.is-results { max-width: 1120px; }
  .ok-lens-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ok-lens-card,
  .ok-lens-dot { transition: none; }
  .ok-lens-card:hover { transform: none; }
}

/* Reserve wizard space before the footer scripts render the first question,
   so the page does not shift the footer once the UI mounts (CLS). */
#ok-lens-advisor {
    min-height: clamp(480px, 70vh, 720px);
}
