/* =============================================================================
   Visibility Report Widget Styles
   - Matches Amply v2 system: #07090F bg, #2B6BFF accent, Inter Tight display
   ============================================================================= */

:root {
  --vr-bg: #0B0F18;
  --vr-bg-2: #11151F;
  --vr-line: rgba(255, 255, 255, 0.08);
  --vr-line-2: rgba(255, 255, 255, 0.16);
  --warn: #f59e0b;
  --bad: #ef4444;
}

.vr-shell {
  font-family: var(--sans);
  color: var(--text);
  position: relative;
  display: flex;
  flex-direction: column;
}

.vr-shell-hero {
  width: 100%;
  background: linear-gradient(180deg, var(--vr-bg) 0%, var(--vr-bg-2) 100%);
  border: 1px solid var(--vr-line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 560px;
}

.vr-shell-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--vr-bg) 0%, var(--vr-bg-2) 100%);
  border: 1px solid var(--vr-line);
  border-radius: 18px;
  overflow: hidden;
}

/* ───────── Browser-frame chrome (mimics hr-site-bar) ───────── */
.vr-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(7, 9, 15, 0.6);
  border-bottom: 1px solid var(--vr-line);
}
.vr-chrome-dots {
  display: flex; gap: 6px;
}
.vr-chrome-dots span {
  width: 9px; height: 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.vr-chrome-dots span:nth-child(1) { background: #FF5F57; }
.vr-chrome-dots span:nth-child(2) { background: #FEBC2E; }
.vr-chrome-dots span:nth-child(3) { background: #28C840; }
.vr-chrome-url {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 6px;
  max-width: 320px;
  margin: 0 auto;
}
.vr-chrome-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--good);
}

/* ───────── Step 1: Input ───────── */
.vr-input { padding: 36px 32px 28px; display: flex; flex-direction: column; gap: 22px; }
.vr-shell-page .vr-input { padding: 56px 56px 40px; }

.vr-head { display: flex; flex-direction: column; gap: 8px; }
.vr-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.vr-tag-sm {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-3);
  text-transform: uppercase;
}
.vr-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
  color: var(--text);
}
.vr-shell-page .vr-headline { font-size: 38px; }

.vr-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
}

.vr-fields { display: flex; flex-direction: column; gap: 12px; }
.vr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.vr-field { display: flex; flex-direction: column; gap: 6px; }
.vr-field > span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.vr-field input,
.vr-field select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--vr-line-2);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  transition: border-color 150ms ease, background 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.vr-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 5L6 8L9 5' stroke='%239CA3B5' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.vr-field input:focus,
.vr-field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(43, 107, 255, 0.05);
}
.vr-field input::placeholder { color: var(--text-3); }

.vr-cta {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
  width: 100%;
}
.vr-cta:hover { background: var(--accent-2); transform: translateY(-1px); }
.vr-cta-continue { margin-top: 24px; }
.vr-cta-book {
  text-decoration: none;
  width: auto;
  padding: 12px 22px;
}

.vr-fineprint {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  margin: 4px 0 0;
}

/* ───────── Step 2: Loading ───────── */
.vr-loading {
  padding: 60px 32px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  min-height: 480px;
}
.vr-loading-ring { position: relative; width: 160px; height: 160px; }
.vr-loading-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.vr-loading-pct span {
  font-size: 16px;
  color: var(--text-2);
  margin-left: 2px;
}
.vr-loading-msg {
  font-family: var(--display);
  font-size: 16px;
  color: var(--text);
  text-align: center;
  max-width: 380px;
  animation: vrFade 600ms ease;
}
@keyframes vrFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.vr-loading-trail { display: flex; gap: 6px; }
.vr-trail-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  opacity: 0.3;
  animation: vrTrail 1.2s ease-in-out infinite;
}
.vr-trail-dot:nth-child(2) { animation-delay: 0.2s; }
.vr-trail-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes vrTrail {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ───────── Step 3: Results ───────── */
.vr-results { padding: 28px 28px 32px; }
.vr-shell-page .vr-results { padding: 48px 56px; }

.vr-results-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.vr-results-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}
.vr-shell-page .vr-results-title { font-size: 32px; }
.vr-sim-badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm);
  border: 1px solid rgba(255, 120, 73, 0.4);
  background: rgba(255, 120, 73, 0.08);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.vr-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.vr-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--vr-line);
  border-radius: 12px;
  padding: 20px 20px 22px;
}
.vr-panel-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* Score panel */
.vr-ring-wrap {
  display: flex; justify-content: center; align-items: center;
  margin: 8px 0 22px;
}
.vr-ring { position: relative; }
.vr-ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.vr-ring-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.vr-ring-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: 4px;
}

.vr-subs { display: flex; flex-direction: column; gap: 14px; }
.vr-sub { display: flex; flex-direction: column; gap: 5px; }
.vr-sub-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.vr-sub-label {
  font-size: 12px;
  color: var(--text-2);
}
.vr-sub-val {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}
.vr-sub-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}
.vr-sub-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 700ms cubic-bezier(.25,.8,.25,1);
}
.vr-sub-hint {
  font-size: 11px;
  color: var(--text-3);
}

/* Comp panel */
.vr-comp-list {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.vr-comp-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--vr-line);
  border-radius: 8px;
}
.vr-comp-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  width: 22px;
}
.vr-comp-main { flex: 1; min-width: 0; }
.vr-comp-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vr-comp-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-2);
}

.vr-gaps { display: flex; flex-direction: column; gap: 8px; }
.vr-gaps-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}
.vr-gap {
  position: relative;
  padding: 10px 12px 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}
.vr-gap-bar {
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
}
.vr-gap-critical .vr-gap-bar { background: var(--bad); }
.vr-gap-warning .vr-gap-bar { background: var(--warn); }
.vr-gap-good .vr-gap-bar { background: var(--good); }
.vr-gap p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

.vr-priority {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.vr-priority-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 6px;
}
.vr-priority p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* ───────── Step 4: Email Gate ───────── */
.vr-gate {
  padding: 40px 32px 32px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  min-height: 480px;
  justify-content: center;
  position: relative;
}
.vr-back {
  position: absolute;
  top: 16px; left: 16px;
  background: none; border: 0;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  font-family: var(--sans);
}
.vr-back:hover { color: var(--text); }
.vr-gate-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43, 107, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 4px;
}
.vr-gate-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 380px;
  line-height: 1.2;
}
.vr-gate-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  max-width: 400px;
  line-height: 1.55;
}
.vr-field-email { width: 100%; max-width: 360px; }

/* ───────── Step 5: Confirmation ───────── */
.vr-confirm {
  padding: 40px 32px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  min-height: 480px;
  justify-content: center;
}
.vr-confirm-icon { animation: vrPop 500ms cubic-bezier(.34,1.56,.64,1); }
@keyframes vrPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
.vr-confirm-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 8px 0 0;
}
.vr-confirm-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
}
.vr-confirm-cta-card {
  margin-top: 18px;
  padding: 22px 24px;
  background: rgba(43, 107, 255, 0.06);
  border: 1px solid rgba(43, 107, 255, 0.25);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 8px;
}
.vr-confirm-cta-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 0;
}
.vr-confirm-cta-sub {
  font-size: 12px;
  color: var(--text-2);
  margin: 0 0 8px;
  line-height: 1.5;
}
.vr-restart {
  background: none; border: 0;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
  font-family: var(--sans);
}
.vr-restart:hover { color: var(--accent); }

/* ───────── Mobile ───────── */
@media (max-width: 720px) {
  .vr-input,
  .vr-shell-page .vr-input { padding: 28px 22px; }
  .vr-results,
  .vr-shell-page .vr-results { padding: 22px 18px; }
  .vr-results-grid { grid-template-columns: 1fr; }
  .vr-field-row { grid-template-columns: 1fr; }
  .vr-headline,
  .vr-shell-page .vr-headline { font-size: 22px; }
  .vr-results-title,
  .vr-shell-page .vr-results-title { font-size: 22px; }
}

/* ───────── Hero slot adjustments ───────── */
.hero-right .vr-shell-hero {
  margin-top: 4px;
}

/* In the hero column the widget is ~580px wide. The 2-column results grid
   that works on /audit doesn't fit here — competitor names overflow. Force
   the entire hero-variant results to single column regardless of viewport. */
.vr-shell-hero .vr-results { padding: 22px 22px 26px; }
.vr-shell-hero .vr-results-grid { grid-template-columns: 1fr; gap: 16px; }
.vr-shell-hero .vr-comp-name { word-break: break-word; }
.vr-shell-hero .vr-comp-meta { flex-wrap: wrap; row-gap: 4px; }

/* ───────── Combobox (custom searchable dropdown) ───────── */
/* Replaces native <select> so we can fully theme the option list — fixes the
   white-on-white menu bug and gives keyboard nav + type-to-filter. */
.vr-cb {
  position: relative;
  width: 100%;
}
.vr-cb-input {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--vr-line-2);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.vr-cb-input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
}
.vr-cb.vr-cb-open .vr-cb-input,
.vr-cb-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(43, 107, 255, 0.05);
}
.vr-cb-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.vr-cb-placeholder { color: var(--text-3); }
.vr-cb-value { color: var(--text); }
.vr-cb-caret {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 150ms ease;
}
.vr-cb.vr-cb-open .vr-cb-caret { transform: rotate(180deg); color: var(--accent); }

.vr-cb-pop {
  position: fixed;
  z-index: 9999;
  background: #0f1219;
  border: 1px solid var(--vr-line-2);
  border-radius: 10px;
  box-shadow: 0 18px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(43, 107, 255, 0.08);
  overflow: hidden;
  animation: vr-cb-in 120ms ease;
}
@keyframes vr-cb-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.vr-cb-search {
  padding: 8px;
  border-bottom: 1px solid var(--vr-line-2);
}
.vr-cb-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
.vr-cb-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(43, 107, 255, 0.06);
}
.vr-cb-search input::placeholder { color: var(--text-3); }

.vr-cb-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.vr-cb-list::-webkit-scrollbar { width: 8px; }
.vr-cb-list::-webkit-scrollbar-track { background: transparent; }
.vr-cb-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
.vr-cb-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}
.vr-cb-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.vr-cb-opt-active,
.vr-cb-opt:hover {
  background: rgba(43, 107, 255, 0.10);
  color: var(--text);
}
.vr-cb-opt-sel {
  color: var(--accent);
  background: rgba(43, 107, 255, 0.06);
}
.vr-cb-opt-sel.vr-cb-opt-active {
  background: rgba(43, 107, 255, 0.16);
}

/* Disabled text input (e.g. Market field before State is picked) */
.vr-field input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.015);
}

/* Belt-and-suspenders fix for any remaining native <select> options
   (white-on-white bug). Most browsers ignore <option> styles, but Firefox
   and Chrome on some platforms honor these. */
.vr-field select option,
.vr-field select optgroup {
  background: #0f1219;
  color: var(--text);
}
