/* =============================================================================
   ReviewRadar Reputation — Stylesheet
   Font: Inter (loaded from Google Fonts or system fallback)
   ============================================================================= */

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

/* ── Reset scoped to our app ─────────────────────────────────────────────── */
#review-radar-app *,
#review-radar-app *::before,
#review-radar-app *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#review-radar-app {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #0f172a;
  line-height: 1.6;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.rr-hero {
  background: linear-gradient(140deg, #0f172a 0%, #1e3a5f 60%, #1d4ed8 100%);
  padding: 72px 24px 64px;
  text-align: center;
}

.rr-hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.rr-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.3);
  margin-bottom: 24px;
}

.rr-title {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.rr-title em {
  font-style: normal;
  color: #60a5fa;
}

.rr-subtitle {
  font-size: 17px;
  color: #cbd5e1;
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Form Card ───────────────────────────────────────────────────────────── */
.rr-form-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.rr-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}

.rr-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rr-input {
  flex: 1 1 280px;
  height: 52px;
  padding: 0 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.rr-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.rr-input::placeholder {
  color: #94a3b8;
}

.rr-btn-primary {
  flex: 0 0 auto;
  height: 52px;
  padding: 0 28px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rr-btn-primary:hover {
  opacity: 0.9;
}

.rr-btn-primary:active {
  transform: scale(0.98);
}

.rr-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rr-form-note {
  margin-top: 14px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

/* ── Shared section wrapper ──────────────────────────────────────────────── */
.rr-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.rr-progress-card {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 56px 40px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.rr-loader {
  width: 52px;
  height: 52px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: rr-spin 0.9s linear infinite;
  margin: 0 auto 28px;
}

@keyframes rr-spin {
  to { transform: rotate(360deg); }
}

.rr-progress-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 28px;
}

.rr-steps {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rr-step {
  font-size: 14px;
  color: #94a3b8;
  padding: 10px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid transparent;
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rr-step::before {
  content: '○';
  font-size: 16px;
  flex-shrink: 0;
  color: #cbd5e1;
}

.rr-step.active {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
  font-weight: 600;
}

.rr-step.active::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 3px solid #3b82f6;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rr-spin 0.7s linear infinite;
  display: inline-block;
}

.rr-step.done {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.rr-step.done::before {
  content: '✓';
  color: #16a34a;
  font-size: 14px;
  font-weight: 700;
}

/* ── Error ───────────────────────────────────────────────────────────────── */
.rr-error-card {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 56px 40px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.08);
  border: 1px solid #fee2e2;
}

.rr-error-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.rr-error-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.rr-error-msg {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 28px;
  line-height: 1.6;
}

.rr-btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.rr-btn-secondary:hover {
  background: #e2e8f0;
}

/* ── Results: Summary Bar ────────────────────────────────────────────────── */
.rr-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 40px;
}

.rr-home-name {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.rr-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rr-stars {
  color: #f59e0b;
  font-size: 18px;
  letter-spacing: 1px;
}

.rr-rating-num {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.rr-review-count {
  font-size: 14px;
  color: #64748b;
}

.rr-fetched-note {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Score dial */
.rr-score-block {
  text-align: center;
  flex-shrink: 0;
}

.rr-score-ring {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 8px;
}

.rr-score-ring svg {
  transform: rotate(-90deg);
}

.rr-score-ring .rr-ring-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.rr-score-ring .rr-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease;
}

.rr-score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}

.rr-score-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Alert banner */
.rr-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 24px;
  border-radius: 12px;
  margin-bottom: 40px;
  font-size: 15px;
  line-height: 1.6;
}

.rr-alert-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.4;
}

.rr-alert-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.rr-alert.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.rr-alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

/* ── 12-Theme Grid ───────────────────────────────────────────────────────── */
.rr-grid-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
}

.rr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

@media (max-width: 1024px) {
  .rr-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .rr-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .rr-grid { grid-template-columns: 1fr; }
}

/* ── Theme Card ──────────────────────────────────────────────────────────── */
.rr-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 2px solid transparent;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.rr-card.strong {
  border-color: #86efac;
  background: linear-gradient(160deg, #fff 60%, #f0fdf4);
}

.rr-card.mentioned {
  border-color: #fcd34d;
  background: linear-gradient(160deg, #fff 60%, #fffbeb);
}

.rr-card.absent {
  border-color: #fca5a5;
  background: linear-gradient(160deg, #fff 60%, #fef2f2);
}

.rr-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rr-card-icon {
  font-size: 26px;
  line-height: 1;
}

.rr-status-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.strong .rr-status-pill {
  background: #dcfce7;
  color: #15803d;
}

.mentioned .rr-status-pill {
  background: #fef9c3;
  color: #a16207;
}

.absent .rr-status-pill {
  background: #fee2e2;
  color: #b91c1c;
}

.rr-card-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.rr-card-mentions {
  font-size: 12px;
  font-weight: 500;
}

.strong .rr-card-mentions  { color: #15803d; }
.mentioned .rr-card-mentions { color: #a16207; }
.absent .rr-card-mentions   { color: #b91c1c; }

.rr-card-quote {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  font-style: italic;
  border-left: 3px solid #e2e8f0;
  padding-left: 10px;
  margin-top: 2px;
}

.strong .rr-card-quote  { border-left-color: #86efac; }
.mentioned .rr-card-quote { border-left-color: #fcd34d; }

.rr-card-gap {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 2px;
}

.absent .rr-card-gap {
  color: #991b1b;
}

/* GAP badge overlay */
.rr-gap-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 0 12px 0 8px;
}

/* ── Gap Summary ─────────────────────────────────────────────────────────── */
.rr-gaps-section {
  margin-bottom: 48px;
}

.rr-gaps-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.rr-gaps-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

.rr-gap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rr-gap-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid #fee2e2;
  border-radius: 12px;
  padding: 16px 20px;
}

.rr-gap-item-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1.3;
}

.rr-gap-item-label {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.rr-gap-item-advice {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
}

/* ── CTA Section ─────────────────────────────────────────────────────────── */
.rr-cta-section {
  background: linear-gradient(140deg, #0f172a 0%, #1e3a5f 60%, #1d4ed8 100%);
  border-radius: 20px;
  padding: 56px 40px;
  text-align: center;
  color: #fff;
  margin-bottom: 40px;
}

.rr-cta-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 16px;
}

.rr-cta-title {
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.rr-cta-body {
  font-size: 16px;
  color: #cbd5e1;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.rr-cta-btn {
  display: inline-block;
  padding: 16px 36px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.rr-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  color: #1d4ed8;
  text-decoration: none;
}

.rr-cta-note {
  margin-top: 16px;
  font-size: 13px;
  color: #94a3b8;
}

/* Restart link */
.rr-restart-wrap {
  text-align: center;
  padding-bottom: 20px;
}

.rr-restart-link {
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: inherit;
}

.rr-restart-link:hover {
  color: #0f172a;
}

/* Spinner inside button */
.rr-spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rr-spin 0.7s linear infinite;
  vertical-align: middle;
}
