/**
 * QLEOS Shared Reviews v1.4.0 — front-end styles.
 * Redesign: clean premium layout, Outfit typography, dark score card,
 * gold stars, clickable rating bars, polished mobile experience.
 */

:root {
  --qleos-review-green: #85c598;
  --qleos-review-green-dark: #4f9a72;
  --qleos-review-green-deep: #2c704c;
  --qleos-review-gold: #e6be4a;
  --qleos-review-ink: #121817;
  --qleos-review-muted: #65706d;
  --qleos-review-faint: #8a938f;
  --qleos-review-body: #3a4643;
  --qleos-review-soft: #f5f8f6;
  --qleos-review-line: rgba(18, 24, 23, 0.08);
  --qleos-review-line-strong: rgba(18, 24, 23, 0.12);
  --qleos-review-card: #ffffff;
  --qleos-review-shadow-soft: 0 12px 34px rgba(18, 24, 23, 0.035);
  --qleos-review-shadow-hover: 0 18px 50px rgba(18, 24, 23, 0.07);
  --qleos-review-radius-xl: 24px;
  --qleos-review-radius-lg: 20px;
  --qleos-review-radius-md: 14px;
}

/* Autoplacement helpers */
.qleos-reviews-autoplace-source[hidden] { display: none !important; }
.qleos-hide-legacy-review-widget { display: none !important; }

.qleos-reviews,
.qleos-reviews * {
  box-sizing: border-box;
}

.qleos-reviews {
  isolation: isolate;
  width: 100%;
  max-width: 1160px;
  margin: clamp(40px, 6vw, 88px) auto;
  padding: 0 clamp(14px, 3vw, 28px);
  color: var(--qleos-review-ink);
  font-family: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-margin-top: 110px;
}

.qleos-reviews a {
  color: var(--qleos-review-green-deep);
  text-decoration: none;
}

.qleos-reviews a:hover {
  color: #17452c;
}

/* Notices */
.qleos-review-notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--qleos-review-line);
  background: var(--qleos-review-soft);
}

.qleos-review-notice--success,
.qleos-review-notice--pending {
  border-color: rgba(133, 197, 152, 0.38);
  background: rgba(133, 197, 152, 0.13);
}

.qleos-review-notice--error {
  border-color: rgba(185, 56, 56, 0.24);
  background: rgba(185, 56, 56, 0.08);
}

/* ---------------------------------------------------------------------------
   Section head
--------------------------------------------------------------------------- */
.qleos-review-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin: 0 0 clamp(24px, 4vw, 36px);
}

.qleos-review-kicker,
.qleos-form-eyebrow,
.qleos-insight-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--qleos-review-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

.qleos-review-kicker::before,
.qleos-form-eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 2px;
  border-radius: 99px;
  background: var(--qleos-review-green);
}

.qleos-review-section-head h2 {
  margin: 14px 0 0;
  font-family: inherit;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 650;
  color: var(--qleos-review-ink);
}

.qleos-review-trust-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qleos-review-trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(18, 24, 23, 0.1);
  color: #31403c;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.qleos-review-trust-strip span::before {
  content: "✓";
  color: var(--qleos-review-green-dark);
  font-weight: 800;
}

/* ---------------------------------------------------------------------------
   Summary hero
--------------------------------------------------------------------------- */
.qleos-review-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

/* Score card — dark */
.qleos-review-score-card {
  position: relative;
  overflow: hidden;
  background: var(--qleos-review-ink);
  color: #fff;
  border: none;
  border-radius: var(--qleos-review-radius-xl);
  padding: 30px 28px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qleos-review-score-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -50px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(133, 197, 152, 0.35), rgba(133, 197, 152, 0));
  pointer-events: none;
}

.qleos-review-score-card .qleos-review-kicker {
  color: rgba(255, 255, 255, 0.6);
}

.qleos-review-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
}

.qleos-review-score {
  font-size: clamp(58px, 8vw, 76px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.qleos-review-score-max {
  color: rgba(255, 255, 255, 0.55);
  font-size: 20px;
  font-weight: 500;
}

/* Stars */
.qleos-stars {
  display: inline-flex;
  gap: 2px;
  line-height: 1;
  color: rgba(18, 24, 23, 0.13);
  letter-spacing: 0.06em;
}

.qleos-star.is-filled {
  color: var(--qleos-review-gold);
}

.qleos-stars--large {
  margin-top: 16px;
  font-size: 22px;
}

.qleos-review-score-card .qleos-stars {
  color: rgba(255, 255, 255, 0.22);
}

.qleos-review-based-on {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.5;
}

.qleos-shared-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #b7e0c4;
  background: rgba(133, 197, 152, 0.14);
  border: 1px solid rgba(133, 197, 152, 0.3);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.25;
}

/* Rating bars — clickable filters */
.qleos-review-bars {
  background: var(--qleos-review-card);
  border: 1px solid var(--qleos-review-line);
  border-radius: var(--qleos-review-radius-xl);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 14px 40px rgba(18, 24, 23, 0.04);
}

button.qleos-review-bar-row {
  appearance: none;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.qleos-review-bar-row {
  display: grid;
  grid-template-columns: 44px 1fr 38px;
  gap: 12px;
  align-items: center;
  min-height: 28px;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 10px;
  transition: background 150ms ease;
}

button.qleos-review-bar-row:hover,
button.qleos-review-bar-row.is-active {
  background: rgba(133, 197, 152, 0.12);
}

.qleos-review-bar-label,
.qleos-review-bar-count {
  font-size: 13px;
  font-weight: 650;
  color: var(--qleos-review-muted);
  white-space: nowrap;
}

.qleos-review-bar-row.is-active .qleos-review-bar-label {
  color: var(--qleos-review-green-deep);
}

.qleos-review-bar-count {
  text-align: right;
  font-weight: 600;
}

.qleos-review-bar-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(18, 24, 23, 0.07);
  display: block;
}

.qleos-review-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qleos-review-green), var(--qleos-review-green-dark));
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
  display: block;
}

/* Insight card */
.qleos-review-insight-card {
  background: linear-gradient(155deg, #eef6f0, #f8fbf9);
  border: 1px solid rgba(133, 197, 152, 0.3);
  border-radius: var(--qleos-review-radius-xl);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qleos-insight-label {
  font-size: 11px;
  letter-spacing: 0.13em;
}

.qleos-insight-value {
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--qleos-review-ink);
}

.qleos-insight-line {
  width: 100%;
  height: 1px;
  background: rgba(18, 24, 23, 0.08);
  margin: 18px 0;
}

.qleos-insight-copy {
  margin-top: 8px;
  color: #4c5a55;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Toolbar
--------------------------------------------------------------------------- */
.qleos-review-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid var(--qleos-review-line);
  box-shadow: 0 10px 30px rgba(18, 24, 23, 0.04);
  margin: 0 0 22px;
}

.qleos-review-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qleos-filter-button,
.qleos-review-sort,
.qleos-write-review-button {
  min-height: 44px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.qleos-filter-button {
  padding: 0 16px;
  border: 1px solid rgba(18, 24, 23, 0.1);
  background: #fff;
  color: var(--qleos-review-ink);
  cursor: pointer;
}

.qleos-filter-button:hover {
  border-color: rgba(79, 154, 114, 0.5);
}

.qleos-filter-button.is-active {
  background: var(--qleos-review-ink);
  color: #fff;
  border-color: var(--qleos-review-ink);
}

.qleos-sort-label {
  margin-left: auto;
  display: inline-flex;
}

.qleos-review-sort {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 34px 0 15px;
  min-width: 170px;
  border: 1px solid rgba(18, 24, 23, 0.1);
  color: var(--qleos-review-ink);
  cursor: pointer;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path d="M1 1l4 4 4-4" stroke="%2365706d" stroke-width="1.6" fill="none" stroke-linecap="round"/></svg>') no-repeat right 14px center;
}

.qleos-write-review-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  padding: 0 18px;
  background: var(--qleos-review-ink);
  color: #fff !important;
  text-decoration: none !important;
}

.qleos-write-review-button:hover {
  background: var(--qleos-review-green-deep);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------------------
   Content grid: list + form
--------------------------------------------------------------------------- */
.qleos-review-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 20px;
  align-items: start;
}

.qleos-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Review card */
.qleos-review-card {
  background: var(--qleos-review-card);
  border: 1px solid var(--qleos-review-line);
  border-radius: var(--qleos-review-radius-lg);
  padding: 24px 26px;
  box-shadow: var(--qleos-review-shadow-soft);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.qleos-review-card:hover {
  border-color: rgba(133, 197, 152, 0.4);
  box-shadow: var(--qleos-review-shadow-hover);
}

.qleos-review-card-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
}

.qleos-review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e4f2e8, #f6faf7);
  border: 1px solid rgba(133, 197, 152, 0.35);
  color: var(--qleos-review-green-deep);
  font-weight: 700;
  font-size: 14px;
}

.qleos-review-author-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qleos-review-author-row strong {
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.qleos-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(133, 197, 152, 0.14);
  border: 1px solid rgba(133, 197, 152, 0.3);
  color: var(--qleos-review-green-deep);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.qleos-verified-badge::before {
  content: "✓";
  font-size: 11px;
}

.qleos-review-date {
  margin-top: 3px;
  color: var(--qleos-review-faint);
  font-size: 12px;
}

.qleos-review-card-rating {
  justify-self: end;
  font-size: 15px;
  white-space: nowrap;
}

.qleos-review-title {
  margin: 16px 0 6px;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 650;
  color: var(--qleos-review-ink);
}

.qleos-review-body {
  color: var(--qleos-review-body);
  font-size: 14.5px;
  line-height: 1.7;
}

.qleos-review-body p {
  margin: 0 0 12px;
}

.qleos-review-body p:last-child {
  margin-bottom: 0;
}

.qleos-review-body.is-collapsed {
  max-height: 156px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.qleos-review-body.is-collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96));
}

/* Empty states */
.qleos-review-empty {
  background: #fff;
  border: 1px dashed rgba(18, 24, 23, 0.15);
  border-radius: var(--qleos-review-radius-lg);
  min-height: 200px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  padding: 34px 24px;
}

.qleos-review-empty h3 {
  margin: 10px 0 0;
  font-size: 21px;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.qleos-review-empty p {
  margin: 0;
  color: var(--qleos-review-muted);
  font-size: 14px;
}

.qleos-empty-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: var(--qleos-review-green-deep);
  background: rgba(133, 197, 152, 0.16);
  border: 1px solid rgba(133, 197, 152, 0.25);
  font-weight: 700;
}

/* Load more */
.qleos-load-more {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--qleos-review-line-strong);
  background: #fff;
  color: var(--qleos-review-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.qleos-load-more:hover {
  border-color: rgba(133, 197, 152, 0.5);
  box-shadow: 0 12px 30px rgba(18, 24, 23, 0.06);
}

/* ---------------------------------------------------------------------------
   Review form
--------------------------------------------------------------------------- */
.qleos-review-form-card {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--qleos-review-line);
  border-radius: var(--qleos-review-radius-xl);
  padding: 28px;
  box-shadow: 0 18px 50px rgba(18, 24, 23, 0.05);
}

.qleos-form-head h3 {
  margin: 12px 0 22px;
  font-family: inherit;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 650;
  color: var(--qleos-review-ink);
}

.qleos-review-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qleos-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.qleos-field label,
.qleos-field-label {
  color: var(--qleos-review-ink);
  font-size: 13px;
  font-weight: 650;
}

.qleos-field input,
.qleos-field textarea {
  width: 100%;
  border: 1px solid var(--qleos-review-line-strong);
  background: #fff;
  border-radius: var(--qleos-review-radius-md);
  padding: 13px 14px;
  color: var(--qleos-review-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.qleos-field textarea {
  resize: vertical;
  min-height: 120px;
}

.qleos-field input:focus,
.qleos-field textarea:focus {
  border-color: var(--qleos-review-green-dark);
  box-shadow: 0 0 0 4px rgba(133, 197, 152, 0.18);
}

.qleos-review-sort:focus,
.qleos-filter-button:focus-visible,
.qleos-write-review-button:focus-visible,
.qleos-submit-review:focus-visible,
.qleos-load-more:focus-visible,
button.qleos-review-bar-row:focus-visible {
  outline: none;
  border-color: var(--qleos-review-green-dark);
  box-shadow: 0 0 0 4px rgba(133, 197, 152, 0.18);
}

.qleos-form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Star rating input */
.qleos-rating-input {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.qleos-rating-input input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.qleos-rating-input label {
  font-size: 28px;
  line-height: 1;
  color: rgba(18, 24, 23, 0.15);
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
}

.qleos-rating-input label:hover {
  transform: translateY(-2px);
}

.qleos-rating-input label:hover,
.qleos-rating-input label:hover ~ label,
.qleos-rating-input input:checked ~ label {
  color: var(--qleos-review-gold);
}

.qleos-submit-review {
  width: 100%;
  min-height: 52px;
  border-radius: var(--qleos-review-radius-md);
  border: none;
  background: var(--qleos-review-ink);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.qleos-submit-review:hover {
  background: var(--qleos-review-green-deep);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(44, 112, 76, 0.25);
  color: #fff;
}

.qleos-privacy-note {
  margin: 0;
  color: var(--qleos-review-faint);
  font-size: 12px;
  line-height: 1.55;
}

.qleos-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.qleos-review-form-disabled {
  text-align: center;
  display: grid;
  gap: 14px;
  place-items: center;
  min-height: 180px;
  color: var(--qleos-review-muted);
}

/* ---------------------------------------------------------------------------
   Responsive — tablet
--------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .qleos-review-hero {
    grid-template-columns: 1fr 1fr;
  }

  .qleos-review-score-card {
    grid-column: 1 / -1;
    min-height: 0;
    padding: 26px;
  }

  .qleos-review-content-grid {
    grid-template-columns: 1fr;
  }

  .qleos-review-form-card {
    position: static;
    top: auto;
  }
}

/* ---------------------------------------------------------------------------
   Responsive — mobile
--------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .qleos-reviews {
    margin: 40px auto;
    scroll-margin-top: 80px;
  }

  .qleos-review-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .qleos-review-hero {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .qleos-review-score-card {
    grid-column: auto;
    text-align: center;
    align-items: center;
  }

  .qleos-review-score-card .qleos-review-kicker {
    justify-content: center;
  }

  .qleos-shared-pill {
    align-self: center;
    text-align: center;
  }

  .qleos-review-bars,
  .qleos-review-insight-card {
    padding: 22px 20px;
  }

  .qleos-review-toolbar {
    border-radius: 22px;
    padding: 10px;
    gap: 10px;
  }

  .qleos-review-filter-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .qleos-filter-button {
    padding: 0 8px;
    text-align: center;
  }

  .qleos-filter-button:first-child {
    grid-column: 1 / -1;
  }

  .qleos-sort-label,
  .qleos-review-sort {
    width: 100%;
    margin-left: 0;
  }

  .qleos-write-review-button {
    width: 100%;
  }

  .qleos-review-card {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .qleos-review-card-top {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .qleos-review-card-rating {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }

  .qleos-review-form-card {
    padding: 22px 18px;
  }

  .qleos-form-two-col {
    grid-template-columns: 1fr;
  }

  .qleos-review-body.is-collapsed {
    max-height: 132px;
  }
}
