/* =============================================================
   NovaWebDesign — trust.css
   Secțiunea „De ce să lucrezi cu noi” (#incredere), care înlocuiește
   testimonialele-exemplu de pe index.html. Markup: partials/trust.html.

   - Carduri glass cu iconițe line (SVG inline), fără clasa .card
     (script.js animă automat toate .card cu GSAP — evităm dublarea).
   - Apariție la scroll 100% CSS (scroll-driven animations), doar
     transform + opacity; unde nu e suportat, totul e vizibil static.
   - Nota de siguranță are un inel care pulsează discret
     (transform + opacity).
   ============================================================= */

.trust-section {
  --tr-ease: cubic-bezier(.16, 1, .3, 1);
  --tr-card: rgba(var(--nv-card-rgb), .82);
  --tr-line: rgba(255, 255, 255, .08);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg-primary, var(--nv-bg));
}

/* fundal: o singură lumină violet discretă, sus */
.trust-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 34% at 50% 0%, rgba(var(--nv-acc-rgb), .14), transparent 72%),
    radial-gradient(40% 30% at 85% 100%, rgba(var(--nv-acc2-rgb), .06), transparent 70%);
}

.trust-section .trust-header {
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.trust-section .section-title,
.trust-section .section-subtitle {
  text-wrap: balance;
}

.trust-accent {
  background: var(--accent-gradient, linear-gradient(135deg, var(--nv-acc) 0%, var(--nv-acc2) 100%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---- Grila de angajamente ---- */
.trust-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1080px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

/* Mobil/tabletă: iconița stă lângă titlu, textul folosește toată lățimea
   (mai compact pe 320–414 px). .trust-body devine transparent pentru grilă. */
.trust-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 12px;
  min-width: 0;
  padding: 18px 18px 20px;
  border-radius: var(--radius-lg, 16px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012)),
    var(--tr-card);
  border: 1px solid var(--tr-line);
  transition: translate .3s var(--tr-ease);
}

/* fir de lumină pe muchia de sus */
.trust-item::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(var(--nv-acc-rgb), .55), rgba(var(--nv-acc2-rgb), .45), transparent);
  opacity: .55;
}

/* glow la hover — doar opacity */
.trust-item::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(var(--nv-acc-rgb), .35), 0 18px 50px -18px rgba(var(--nv-acc-rgb), .55);
  opacity: 0;
  transition: opacity .3s var(--tr-ease);
}

@media (hover: hover) and (pointer: fine) {
  .trust-item:hover {
    translate: 0 -4px;
  }
  .trust-item:hover::after {
    opacity: 1;
  }
}

.trust-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--nv-acc-pale);
  border: 1px solid transparent;
  background:
    linear-gradient(#15151f, #15151f) padding-box,
    linear-gradient(135deg, rgba(var(--nv-acc-rgb), .75), rgba(var(--nv-acc2-rgb), .55)) border-box;
  box-shadow: 0 10px 24px -14px rgba(var(--nv-acc-rgb), .9);
}

.trust-icon svg {
  display: block;
}

.trust-body {
  display: contents;
}

.trust-name {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--text-primary, var(--nv-tx));
  margin: 0;
  min-width: 0;
}

.trust-text {
  grid-column: 1 / -1;
  font-size: .925rem;
  line-height: 1.6;
  color: #A7AEBB;
  margin: 0;
}

/* ---- Nota de siguranță ---- */
.trust-safety {
  position: relative;
  max-width: 1080px;
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px 16px;
  padding: 20px;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid rgba(var(--nv-acc2-rgb), .22);
  background:
    linear-gradient(135deg, rgba(var(--nv-acc-rgb), .12), rgba(var(--nv-acc2-rgb), .07)),
    rgba(14, 14, 22, .92);
  overflow: hidden;
}

.trust-safety-body {
  display: contents;
}

.trust-safety-text {
  grid-column: 1 / -1;
}

.trust-safety-icon {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--nv-acc2-hi);
  background: radial-gradient(circle at 50% 40%, rgba(var(--nv-acc2-rgb), .18), rgba(var(--nv-acc2-rgb), .04) 70%);
  border: 1px solid rgba(var(--nv-acc2-rgb), .35);
}

.trust-safety-icon svg {
  position: relative;
  display: block;
}

/* inelul care „respiră” — transform + opacity */
.trust-safety-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(var(--nv-acc2-rgb), .55);
  opacity: 0;
  pointer-events: none;
}

.trust-safety-title {
  font-family: var(--font-display, 'Fraunces', Georgia, serif);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary, var(--nv-tx));
  margin: 0;
}

.trust-safety-text {
  font-size: .925rem;
  line-height: 1.6;
  color: #A7AEBB;
  margin: 0;
}

.trust-safety-link {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(var(--nv-acc2-rgb), .38);
  background: rgba(var(--nv-acc2-rgb), .06);
  color: var(--nv-acc2-hi);
  font-family: var(--font-body, 'Figtree', system-ui, sans-serif);
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, transform .2s var(--tr-ease);
}

.trust-safety-link svg {
  flex: none;
  transition: transform .25s var(--tr-ease);
}

@media (hover: hover) and (pointer: fine) {
  .trust-safety-link:hover {
    background: rgba(var(--nv-acc2-rgb), .12);
  }
  .trust-safety-link:hover svg {
    transform: translateX(3px);
  }
}

.trust-safety-link:active {
  transform: scale(.98);
}

.trust-safety-link:focus-visible,
.trust-item:focus-visible {
  outline: 2px solid var(--nv-acc2);
  outline-offset: 3px;
}

/* ---- Breakpoints ---- */
@media (max-width: 359px) {
  .trust-item {
    column-gap: 12px;
    padding: 16px 16px 18px;
  }
  .trust-name,
  .trust-safety-title {
    font-size: .98rem;
  }
  .trust-text,
  .trust-safety-text {
    font-size: .9rem;
  }
  .trust-safety {
    padding: 16px 16px 18px;
    gap: 12px;
  }
}

@media (min-width: 640px) {
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 768px) {
  .trust-safety {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 22px 24px;
    gap: 20px;
    margin-top: 20px;
  }
  .trust-safety-icon {
    width: 52px;
    height: 52px;
  }
  .trust-safety-body {
    display: block;
  }
  .trust-safety-title {
    margin-bottom: 4px;
  }
  .trust-safety-link {
    grid-column: auto;
    justify-self: end;
  }
}

@media (min-width: 1024px) {
  .trust-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  /* Desktop: card clasic — iconița deasupra titlului */
  .trust-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 28px 26px 26px;
  }
  .trust-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
  }
  .trust-name {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
}

/* ---- Mișcare: doar dacă e permisă ---- */
@media (prefers-reduced-motion: no-preference) {
  .trust-safety-ring {
    animation: trust-ring 3.2s var(--tr-ease) 0.6s infinite;
  }

  /* Apariție la scroll, fără JavaScript: rulează pe compozitor și se
     leagă de poziția de scroll. Unde nu e suportat, conținutul e
     pur și simplu vizibil. */
  @supports (animation-timeline: view()) {
    .trust-item,
    .trust-safety {
      animation: trust-reveal cubic-bezier(.25, .8, .35, 1) both;
      animation-timeline: view();
      animation-range: entry 0% entry 75%;
    }

    @media (min-width: 640px) {
      .trust-item:nth-child(2n) {
        animation-range: entry 8% entry 83%;
      }
    }

    @media (min-width: 1024px) {
      .trust-item:nth-child(2n) {
        animation-range: entry 0% entry 75%;
      }
      .trust-item:nth-child(3n+2) {
        animation-range: entry 8% entry 83%;
      }
      .trust-item:nth-child(3n) {
        animation-range: entry 16% entry 91%;
      }
    }
  }
}

@keyframes trust-reveal {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes trust-ring {
  0% {
    opacity: .75;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

/* ---- Punctul despre mentenanță („Preluăm și site-uri făcute de alții”):
        al 7-lea card ocupă tot rândul, cu iconița lângă text ---- */
.trust-link {
  color: var(--accent-secondary, var(--nv-acc2));
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .trust-grid .trust-item--wide { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .trust-item--wide {
    flex-direction: row;
    align-items: center;
    gap: 22px;
    padding: 24px 26px;
  }
  .trust-item--wide .trust-icon { margin-bottom: 0; }
  .trust-item--wide .trust-body { display: block; }
  .trust-item--wide .trust-text { max-width: 62rem; }
}

/* Runda 7: „Vezi abonamentele”: țintă de atingere de 44 px, fără să schimbe rândul de text */
.trust-link { display: inline-block; padding: 13px 0; margin: -13px 0; }
