/*
 * LeoFolio final refinement patch v4.2.1
 * Scope: YTD statement-context alignment, calculator-card arrow hover,
 * and restrained Trustpilot engagement styling on /reviews/.
 */

:root {
  --lf-v42-navy: #0e1e33;
  --lf-v42-gold: #c8a568;
  --lf-v42-trustpilot: #00b67a;
  --lf-v42-trustpilot-dark: #007a52;
  --lf-v42-trustpilot-deep: #006b48;
  --lf-v42-trustpilot-light: #63e0b5;
  --lf-v42-trustpilot-soft: rgba(0, 182, 122, 0.09);
}

/* /paystub-ytd-checker/: reserve the same label row height for both fields. */
@media (min-width: 621px) {
  body.payroll-ytd-page.lf-v42-ytd-alignment label[for="ytd-pay-date"],
  body.payroll-ytd-page.lf-v42-ytd-alignment label[for="ytd-periods"] {
    align-items: flex-start;
    min-height: 44px;
  }
}

/* /calculators/: the featured Pay Stub Review card is deliberately excluded. */
body.calculators-hub-page.lf-v42-calculator-hover
  a.calc-hub-card:not([href="/paystub-review/"]):hover
  .calc-hub-arrow,
body.calculators-hub-page.lf-v42-calculator-hover
  a.calc-hub-card:not([href="/paystub-review/"]):focus-visible
  .calc-hub-arrow {
  background: var(--lf-v42-navy) !important;
  border-color: var(--lf-v42-navy) !important;
  color: var(--lf-v42-gold) !important;
  box-shadow: 0 7px 16px rgba(14, 30, 51, 0.22);
}

/*
 * /reviews/: enhance the current review gateway instead of replacing it.
 * The installer supplies the page-only marker used by every selector below.
 */
body.lf-v42-review-engagement main {
  --lf-v42-review-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

/* Keep the removed guidance headline from leaving a large empty lead-in. */
body.lf-v42-review-engagement main .lf-review-guidance-compact {
  margin-top: 0 !important;
  padding-top: clamp(34px, 4.5vw, 62px) !important;
}

body.lf-v42-review-engagement main .lf-review-guidance-compact > :first-child {
  margin-top: 0 !important;
}

body.lf-v42-review-engagement main
  :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card) {
  position: relative;
  transition:
    transform 220ms var(--lf-v42-review-ease),
    border-color 220ms ease,
    box-shadow 220ms ease;
}

body.lf-v42-review-engagement main
  :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card):hover,
body.lf-v42-review-engagement main
  :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card):focus-within {
  border-color: rgba(0, 122, 82, 0.42);
  box-shadow:
    0 18px 42px rgba(14, 30, 51, 0.12),
    inset 0 3px 0 rgba(0, 182, 122, 0.85);
  transform: translateY(-3px);
}

/* The featured middle card already sits 12px higher; hover raises it, never drops it. */
body.lf-v42-review-engagement main .rv-guidance-card:nth-child(2):hover,
body.lf-v42-review-engagement main .rv-guidance-card:nth-child(2):focus-within {
  transform: translateY(-15px);
}

/* Trustpilot green accents remain readable on both light and navy sections. */
body.lf-v42-review-engagement main
  :is(.rv-card-kicker, .rv-support-section .rv-eyebrow--dark, .rv-faq-section .rv-eyebrow--dark) {
  color: var(--lf-v42-trustpilot-dark);
}

body.lf-v42-review-engagement main .rv-process .rv-eyebrow {
  color: var(--lf-v42-trustpilot-light);
}

body.lf-v42-review-engagement main
  .rv-guidance-card:not(:nth-child(2)) .rv-card-number {
  background: var(--lf-v42-trustpilot-soft);
  color: var(--lf-v42-trustpilot-dark);
}

body.lf-v42-review-engagement main .rv-guidance-card:nth-child(2) .rv-card-number {
  border: 1px solid rgba(99, 224, 181, 0.3);
  color: var(--lf-v42-trustpilot-light);
}

/* Soft accents break up the paper sections without altering the navy hero. */
body.lf-v42-review-engagement main .rv-guidance {
  background-image: radial-gradient(circle at 91% 8%, rgba(0, 182, 122, 0.1), transparent 29%);
}

body.lf-v42-review-engagement main .rv-faq-section {
  background-image:
    radial-gradient(circle at 8% 92%, rgba(0, 182, 122, 0.11), transparent 27%),
    linear-gradient(135deg, rgba(0, 182, 122, 0.025), transparent 48%);
}

/* Primary review actions use Trustpilot green; inline links stay inline. */
body.lf-v42-review-engagement main
  a[data-review-action="write"]:not(.trustpilot-widget a) {
  background: linear-gradient(135deg, var(--lf-v42-trustpilot) 0%, #00a76f 100%) !important;
  border-color: var(--lf-v42-trustpilot-dark) !important;
  box-shadow: 0 10px 24px rgba(0, 122, 82, 0.19);
  color: #071f19 !important;
  transition:
    transform 180ms var(--lf-v42-review-ease),
    box-shadow 180ms ease,
    background 180ms ease;
}

body.lf-v42-review-engagement main
  a[data-review-action="write"]:not(.trustpilot-widget a):hover {
  background: linear-gradient(135deg, #12c98b 0%, var(--lf-v42-trustpilot) 100%) !important;
  box-shadow: 0 14px 30px rgba(0, 122, 82, 0.27);
  transform: translateY(-2px);
}

body.lf-v42-review-engagement main
  a[data-review-action="write"]:not(.trustpilot-widget a):active {
  box-shadow: 0 6px 15px rgba(0, 122, 82, 0.2);
  transform: translateY(0);
}

body.lf-v42-review-engagement main
  a[data-review-action="write"]:not(.trustpilot-widget a):focus-visible {
  outline: 3px solid rgba(0, 182, 122, 0.38);
  outline-offset: 4px;
}

body.lf-v42-review-engagement main .rv-hero a.rv-button[data-review-action="read"] {
  border-color: rgba(99, 224, 181, 0.7);
  background: rgba(0, 182, 122, 0.08);
  color: #e0fff4 !important;
}

body.lf-v42-review-engagement main .rv-hero a.rv-button[data-review-action="read"]:hover {
  border-color: var(--lf-v42-trustpilot-light);
  background: rgba(0, 182, 122, 0.16);
}

body.lf-v42-review-engagement main
  a[data-review-action="read"]:not(.rv-button):not(.trustpilot-widget a) {
  color: var(--lf-v42-trustpilot-deep) !important;
  text-decoration-color: rgba(0, 122, 82, 0.5) !important;
}

body.lf-v42-review-engagement main
  .rv-process a[data-review-action="read"]:not(.rv-button) {
  color: var(--lf-v42-trustpilot-light) !important;
  text-decoration-color: rgba(99, 224, 181, 0.55) !important;
}

/* Preserve Trustpilot's own widget and its fallback link presentation. */
body.lf-v42-review-engagement main .trustpilot-widget > a {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  display: inline !important;
  transform: none !important;
}

/* Supporting links and FAQ controls respond without turning every surface green. */
body.lf-v42-review-engagement main
  :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card)
  a:not([data-review-action]) {
  text-decoration-color: rgba(0, 122, 82, 0.46);
  text-underline-offset: 0.2em;
  transition: color 170ms ease, text-decoration-color 170ms ease;
}

body.lf-v42-review-engagement main
  :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card)
  a:not([data-review-action]):hover {
  color: var(--lf-v42-trustpilot-deep);
  text-decoration-color: currentColor;
}

body.lf-v42-review-engagement main .rv-faq-list details {
  border-radius: 12px;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

body.lf-v42-review-engagement main .rv-faq-list details:hover,
body.lf-v42-review-engagement main .rv-faq-list details:focus-within {
  background: rgba(0, 182, 122, 0.035);
  box-shadow: inset 3px 0 0 rgba(0, 182, 122, 0.58);
}

body.lf-v42-review-engagement main .rv-faq-list summary span {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

body.lf-v42-review-engagement main .rv-faq-list details:hover summary span,
body.lf-v42-review-engagement main .rv-faq-list details:focus-within summary span {
  border-color: rgba(0, 122, 82, 0.38);
  background: var(--lf-v42-trustpilot-soft);
  color: var(--lf-v42-trustpilot-dark);
}

@media (prefers-reduced-motion: reduce) {
  body.lf-v42-review-engagement main *,
  body.lf-v42-review-engagement main *::before,
  body.lf-v42-review-engagement main *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  body.lf-v42-review-engagement main
    :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card):not(.rv-guidance-card:nth-child(2)):hover,
  body.lf-v42-review-engagement main
    :is(.rv-collector-card, .rv-guidance-card, .rv-support-card, .rv-privacy-card):not(.rv-guidance-card:nth-child(2)):focus-within,
  body.lf-v42-review-engagement main
    a[data-review-action="write"]:hover {
    transform: none;
  }

  body.lf-v42-review-engagement main .rv-guidance-card:nth-child(2):hover,
  body.lf-v42-review-engagement main .rv-guidance-card:nth-child(2):focus-within {
    transform: translateY(-12px);
  }
}
