/* ═════════════════════════════════════════════════════════════════════════════
   TASK #914378: Homepage CSS & Layout Fixes
   Fixes for 7 critical visual issues:
   1. Icon positioning in benefit cards ("Why People Trust" section)
   2. Leaderboard/settlement cards missing card styling
   3. Featured settlement hero - contrast and styling
   4. Quiz/Calculator section - button styling and form state management
   5. April banner - layout and button positioning
   6. Excessive whitespace gaps between sections
   7. LIVE indicator - compact spacing
   ═════════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #1: ICON POSITIONING IN BENEFIT CARDS
   Icons should render inline/above headings, not below text.
   Create proper card layout with icons positioned above content.
   ────────────────────────────────────────────────────────────────────────── */

/* Benefit/Trust section cards - restore proper card structure
   CRITICAL FIX (Task #915626): Do NOT apply grid to .trust-proof-section
   or .sr-benefits-section — those are wrapper sections, not grid containers.
   Grid belongs only on inner containers like .sr-benefits-grid. */
.benefits-grid,
.sr-benefits-grid,
.hm-benefits-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.sr-benefits-card,
.benefit-card,
.trust-card,
.hm-benefit-item,
.sr-benefit-item {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.sr-benefits-card:hover,
.benefit-card:hover,
.trust-card:hover,
.hm-benefit-item:hover,
.sr-benefit-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

/* Icon container - ensure it's properly positioned ABOVE content */
.sr-benefits-card-icon,
.benefit-icon,
.trust-icon,
.hm-benefit-icon,
.sr-benefit-icon,
.card-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: #f0fdf4;
  border-radius: 12px;
  font-size: 1.75rem;
  flex-shrink: 0;
  order: -1;  /* Force icon to top */
}

/* Heading inside card */
.sr-benefits-card-title,
.benefit-title,
.trust-title,
.hm-benefit-title,
.sr-benefit-title,
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
  margin: 0;
}

/* Description text */
.sr-benefits-card-desc,
.benefit-desc,
.trust-desc,
.hm-benefit-desc,
.sr-benefit-desc,
.card-description {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* Badge styling (No credit card, Updated daily, etc) */
.sr-benefits-card-badge,
.benefit-badge,
.trust-badge,
.hm-badge,
.sr-badge,
.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  width: fit-content;
  margin-top: auto;
}

@media (max-width: 768px) {
  .benefits-grid,
  .sr-benefits-grid,
  .hm-benefits-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1rem;
  }

  .sr-benefits-card,
  .benefit-card,
  .trust-card,
  .hm-benefit-item,
  .sr-benefit-item {
    padding: 1.5rem;
    gap: 1rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #2: LEADERBOARD / SETTLEMENT CARDS MISSING STYLING
   Settlement cards should have proper card structure with borders, spacing.
   ────────────────────────────────────────────────────────────────────────── */

.sr-leaderboard-section,
.settlement-leaderboard,
.leaderboard-container,
.top-settlements {
  padding: 3rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.sr-leaderboard-grid,
.settlement-grid,
.leaderboard-grid,
.leaderboard-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.sr-settlement-card,
.settlement-card,
.leaderboard-card,
.settlement-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease;
  text-decoration: none;
  color: inherit;
}

.sr-settlement-card:hover,
.settlement-card:hover,
.leaderboard-card:hover,
.settlement-item:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #22c55e;
  transform: translateY(-2px);
}

/* Rank badge (#1, #2, #3, etc) */
.sr-settlement-rank,
.settlement-rank,
.leaderboard-rank,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Settlement name/title */
.sr-settlement-name,
.settlement-name,
.settlement-title,
.leaderboard-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

/* Company name */
.sr-settlement-company,
.settlement-company,
.company-name {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

/* Payout amount - prominent display */
.sr-settlement-payout,
.settlement-payout,
.payout-amount {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sr-settlement-payout-value,
.settlement-payout-value,
.payout-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #16a34a;
}

.sr-settlement-payout-label,
.settlement-payout-label,
.payout-label {
  font-size: 0.85rem;
  color: #6b7280;
}

/* "No proof" / "Proof required" badge */
.sr-settlement-proof-badge,
.proof-badge,
.settlement-proof {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .sr-leaderboard-section,
  .settlement-leaderboard,
  .leaderboard-container,
  .top-settlements {
    padding: 2rem 1rem;
  }

  .sr-leaderboard-grid,
  .settlement-grid,
  .leaderboard-grid,
  .leaderboard-items {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sr-settlement-card,
  .settlement-card,
  .leaderboard-card,
  .settlement-item {
    padding: 1.25rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #3: FEATURED SETTLEMENT HERO - CONTRAST & STYLING
   Dark green text on dark green background = poor contrast.
   Ensure all text has sufficient contrast (white/light on dark).
   ────────────────────────────────────────────────────────────────────────── */

.rs-featured-section,
.featured-settlement-hero,
.feature-hero {
  background: linear-gradient(135deg, #064E30 0%, #0f3a23 100%);
  color: #ffffff;
  padding: 4rem 1.5rem;
  border-radius: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.rs-featured-section-inner,
.featured-settlement-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

/* Eyebrow/tag */
.rs-featured-tag,
.featured-tag,
.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #86efac !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rs-featured-tag-dot {
  width: 6px;
  height: 6px;
  background: #86efac;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Main headline - must be light/white */
.rs-featured-headline,
.featured-headline,
.feature-title {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 800;
  color: #ffffff !important;
  line-height: 1.1;
  margin: 0;
}

/* Subtitle */
.rs-featured-subtitle,
.featured-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85) !important;
  line-height: 1.6;
  max-width: 600px;
}

/* Badge: "No Proof Required" */
.rs-featured-badge,
.no-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fcd34d !important;
}

.rs-featured-badge-icon {
  font-size: 1.1rem;
}

/* CTA button */
.rs-featured-cta,
.featured-cta,
.feature-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: #22c55e;
  color: #ffffff !important;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.rs-featured-cta:hover,
.featured-cta:hover,
.feature-cta-btn:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .rs-featured-section,
  .featured-settlement-hero,
  .feature-hero {
    padding: 2rem 1.25rem;
  }

  .rs-featured-headline,
  .featured-headline,
  .feature-title {
    font-size: 1.6rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #4: QUIZ/CALCULATOR - BUTTON STYLING & FORM STATE
   Yes/No buttons need proper styling.
   Error AND success messages shouldn't show simultaneously.
   Share/Copy/Calculator links need styling.
   ────────────────────────────────────────────────────────────────────────── */

.quiz-section,
.calculator-section,
.hm-quiz {
  padding: 3rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Yes/No button styling */
.quiz-btn,
.calc-btn,
.yn-btn,
.question-option,
.sr-quiz-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.quiz-btn:hover,
.calc-btn:hover,
.yn-btn:hover,
.question-option:hover,
.sr-quiz-button:hover {
  border-color: #16a34a;
  background: #f0fdf4;
}

.quiz-btn:active,
.calc-btn:active,
.yn-btn:active,
.question-option:active,
.sr-quiz-button:active {
  background: #dcfce7;
  border-color: #15803d;
}

.quiz-btn.selected,
.calc-btn.selected,
.yn-btn.selected,
.question-option.selected,
.sr-quiz-button.selected {
  background: #16a34a;
  color: #ffffff;
  border-color: #15803d;
}

/* Email input */
.quiz-email-input,
.calc-email-input,
.sr-email-field {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.quiz-email-input:focus,
.calc-email-input:focus,
.sr-email-field:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Error message - ONLY show when there's an error */
.quiz-error,
.calc-error,
.form-error,
.sr-error-message {
  display: none;
  padding: 1rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-weight: 600;
  margin-top: 1rem;
}

.quiz-error.show,
.calc-error.show,
.form-error.show,
.sr-error-message.show {
  display: block;
}

/* Success message - ONLY show when form is submitted successfully */
.quiz-success,
.calc-success,
.form-success,
.sr-success-message {
  display: none;
  padding: 1rem;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  color: #15803d;
  font-weight: 600;
  margin-top: 1rem;
}

.quiz-success.show,
.calc-success.show,
.form-success.show,
.sr-success-message.show {
  display: block;
}

/* CRITICAL: Hide error if success is showing, and vice versa */
.quiz-success.show ~ .quiz-error,
.quiz-error.show ~ .quiz-success {
  display: none !important;
}

/* Bottom action links - Share on X, Copy Link, Full Calculator */
.quiz-actions,
.calc-actions,
.sr-bottom-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.quiz-action-link,
.calc-action-link,
.sr-action-link,
.share-link,
.copy-link,
.full-calc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quiz-action-link:hover,
.calc-action-link:hover,
.sr-action-link:hover,
.share-link:hover,
.copy-link:hover,
.full-calc-link:hover {
  background: #f9fafb;
  border-color: #16a34a;
  color: #16a34a;
}

@media (max-width: 768px) {
  .quiz-section,
  .calculator-section,
  .hm-quiz {
    padding: 2rem 1rem;
  }

  .quiz-actions,
  .calc-actions,
  .sr-bottom-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quiz-action-link,
  .calc-action-link,
  .sr-action-link,
  .share-link,
  .copy-link,
  .full-calc-link {
    width: 100%;
    justify-content: center;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #5: APRIL BANNER - LAYOUT & BUTTON POSITIONING
   Button should be cohesive with headline, not floating disconnected.
   ────────────────────────────────────────────────────────────────────────── */

.hm-banner-section,
.sr-banner-section,
.monthly-banner,
.settlement-banner {
  padding: 2rem 1.5rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.hm-banner-inner,
.sr-banner-inner,
.banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

/* Banner headline section */
.hm-banner-headline,
.sr-banner-headline,
.banner-headline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.hm-banner-month,
.sr-banner-month,
.banner-month {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hm-banner-title,
.sr-banner-title,
.banner-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.2;
}

.hm-banner-description,
.sr-banner-description,
.banner-description {
  font-size: 0.95rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* Banner CTA button - positioned next to content */
.hm-banner-cta,
.sr-banner-cta,
.banner-cta,
.see-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.hm-banner-cta:hover,
.sr-banner-cta:hover,
.banner-cta:hover,
.see-all-link:hover {
  background: #15803d;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .hm-banner-section,
  .sr-banner-section,
  .monthly-banner,
  .settlement-banner {
    padding: 1.5rem 1rem;
  }

  .hm-banner-inner,
  .sr-banner-inner,
  .banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .hm-banner-cta,
  .sr-banner-cta,
  .banner-cta,
  .see-all-link {
    width: 100%;
    justify-content: center;
  }

  .hm-banner-title,
  .sr-banner-title,
  .banner-title {
    font-size: 1.2rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #6: MASSIVE WHITESPACE GAPS BETWEEN SECTIONS
   Audit and normalize spacing between all sections.
   ────────────────────────────────────────────────────────────────────────── */

/* Section spacing normalization */
.sr-benefits-section,
.sr-leaderboard-section,
.sr-featured-section,
.sr-banner-section,
.trust-proof-section,
.quiz-section,
.featured-settlement-hero,
.featured-roundup-bar,
.settlement-leaderboard,
.mcw-section,
.sr-trending-section,
.community-wins-section {
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  padding-top: 3rem !important;
  padding-bottom: 3rem !important;
}

/* Between adjacent sections - no extra gap */
.sr-benefits-section + .sr-leaderboard-section,
.sr-leaderboard-section + .sr-featured-section,
.sr-featured-section + .sr-banner-section,
.sr-banner-section + .mcw-section,
.trust-proof-section + .quiz-section,
.quiz-section + .featured-settlement-hero,
section + section {
  margin-top: -1rem !important;
}

@media (max-width: 768px) {
  .sr-benefits-section,
  .sr-leaderboard-section,
  .sr-featured-section,
  .sr-banner-section,
  .trust-proof-section,
  .quiz-section,
  .featured-settlement-hero,
  .featured-roundup-bar,
  .settlement-leaderboard,
  .mcw-section,
  .sr-trending-section,
  .community-wins-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   ISSUE #7: LIVE INDICATOR - COMPACT SPACING
   Green "● LIVE" badge + stats bar with excessive whitespace below.
   Should be compact with no excess whitespace.
   ────────────────────────────────────────────────────────────────────────── */

.vpf-wrap,
.verified-payout-feed,
.live-indicator,
#verifiedPayoutFeed {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.vpf-header,
.live-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.75rem;
  flex-wrap: wrap;
}

.vpf-badge,
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.vpf-dot,
.live-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: sr-live-pulse 1.5s ease-in-out infinite;
}

@keyframes sr-live-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.vpf-title,
.live-title {
  font-weight: 800;
  color: #1f2937;
  font-size: 1.1rem;
}

.vpf-sub,
.live-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

/* Remove excess padding/margin from payout feed list */
.vpf-list,
.payout-list {
  padding: 0.5rem 1.5rem 1.5rem !important;
  margin: 0 !important;
}

.vpf-item,
.payout-item {
  padding: 0.75rem 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid #f3f4f6;
}

.vpf-item:last-child,
.payout-item:last-child {
  border-bottom: none;
  padding-bottom: 0 !important;
}

@media (max-width: 768px) {
  .vpf-header,
  .live-header {
    padding: 1rem 1rem 0.5rem;
    gap: 0.75rem;
  }

  .vpf-list,
  .payout-list {
    padding: 0.5rem 1rem 1rem !important;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ────────────────────────────────────────────────────────────────────────── */

/* Extra small screens (< 375px) */
@media (max-width: 374px) {
  .rs-benefits-card,
  .sr-settlement-card,
  .sr-featured-section {
    padding: 1rem;
  }

  .sr-benefits-card-icon,
  .sr-settlement-rank {
    width: 3rem;
    height: 3rem;
  }
}

/* Tablet adjustments — only target actual grid containers, NOT section wrappers */
@media (min-width: 768px) and (max-width: 1024px) {
  .sr-benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sr-leaderboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop adjustments — 4-across for benefit cards
   Task #915626: target .sr-benefits-grid (inner grid), not .sr-benefits-section (wrapper) */
@media (min-width: 1024px) {
  .sr-benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
