/* ==========================================================
   Frayno — come-funziona.css
   Stili per la pagina "Come Funziona"
   Estende main.css — usa variabili esistenti
   ========================================================== */

/* ──────────────────────────────────────────────────────────
   SECTION 1 — HERO
   ────────────────────────────────────────────────────────── */
.cf-hero {
  background: #ffffff;
  padding: 80px 0;
}

.cf-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.cf-hero__breadcrumb {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 16px;
}

.cf-hero__breadcrumb a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}

.cf-hero__breadcrumb a:hover { color: var(--blue); }

.cf-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0;
}

.cf-hero__desc {
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 20px;
}

.cf-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2B3A9E;
  color: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 32px;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.cf-hero__cta:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.cf-hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.cf-hero__trust-item {
  color: #6b7280;
  font-size: 0.85rem;
}

.cf-hero__img {
  width: 100%;
  height: 420px;
  background: linear-gradient(145deg, #374151, #1f2937);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-hero__img-inner {
  text-align: center;
  color: rgba(255,255,255,0.2);
}

.cf-hero__img-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.35;
}

/* ──────────────────────────────────────────────────────────
   SECTION 2 — LOGOS BAR
   ────────────────────────────────────────────────────────── */
.cf-logos {
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 28px 0;
}

.cf-logos__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cf-logos__inner::-webkit-scrollbar { display: none; }

.cf-logos__label {
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.cf-logos__list {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.cf-logos__item {
  width: 64px;
  height: 32px;
  background: #e5e7eb;
  border-radius: 4px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
   SECTION 3 — BENEFIT CARDS
   ────────────────────────────────────────────────────────── */
.cf-benefits {
  background: #ffffff;
  padding: var(--sec-pad) 0;
}

.cf-benefits__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.benefit-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.benefit-card__icon {
  width: 56px;
  height: 56px;
  background: #EEF2FF;
  color: #2B3A9E;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.benefit-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.benefit-card__desc {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────
   SECTION 4 — STEPS
   ────────────────────────────────────────────────────────── */
.cf-steps {
  background: #ffffff;
  padding: var(--sec-pad) 0;
  border-top: 1px solid #f0f0f0;
}

.steps-container {
  position: relative;
  max-width: 900px;
  margin: 60px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.steps-line {
  position: absolute;
  top: 19px;
  left: calc(12.5% + 20px);
  right: calc(12.5% + 20px);
  height: 2px;
  background: linear-gradient(to right, #2B3A9E, #F5A623);
  z-index: 0;
  transform-origin: left center;
}

.step-item {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 8px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2B3A9E;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.step-circle--accent {
  background: #F5A623;
  color: #1a1a2e;
}

.step-title {
  font-weight: 700;
  color: #1a1a2e;
  font-size: 0.9rem;
  margin-top: 16px;
}

.step-desc {
  color: #6b7280;
  font-size: 0.8rem;
  line-height: 1.6;
  max-width: 180px;
  margin: 8px auto 0;
}

.cf-steps__cta {
  text-align: center;
  margin-top: 48px;
}

/* ──────────────────────────────────────────────────────────
   SECTION 5 — WORKFLOW
   ────────────────────────────────────────────────────────── */
.cf-workflow {
  background: #ffffff;
  padding: var(--sec-pad) 0;
  border-top: 1px solid #f0f0f0;
}

.cf-workflow__grid {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 72px;
  align-items: center;
}

.cf-workflow__img {
  position: relative;
}

.cf-workflow__img-box {
  width: 100%;
  height: 400px;
  background: linear-gradient(145deg, #1a1a2e, #2B3A9E);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cf-workflow__img-icon {
  font-size: 5rem;
  opacity: 0.25;
}

.float-card {
  position: absolute;
  bottom: 24px;
  right: -20px;
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 2;
  min-width: 160px;
}

.float-card__amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: #2B3A9E;
  line-height: 1;
}

.float-card__label {
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 4px;
}

.cf-workflow__title {
  font-size: clamp(1.8rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.cf-workflow__desc {
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.75;
  margin-top: 16px;
}

.cf-workflow__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2B3A9E;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 24px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cf-workflow__link:hover { opacity: 0.75; }

/* ──────────────────────────────────────────────────────────
   SECTION 6 — PRICING TEASER
   ────────────────────────────────────────────────────────── */
.cf-pricing-teaser {
  background: #f8f9fa;
  padding: var(--sec-pad) 0;
}

.cf-pt__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.cf-pt-card {
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.cf-pt-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.cf-pt-card__img {
  height: 260px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-pt-card--retail .cf-pt-card__img {
  background: linear-gradient(135deg, #2B3A9E, #374151);
}

.cf-pt-card--restaurant .cf-pt-card__img {
  background: linear-gradient(135deg, #374151, #1a2580);
}

.cf-pt-card__img-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.cf-pt-card__body {
  padding: 24px;
  background: #fff;
}

.cf-pt-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
}

.cf-pt-card__desc {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 8px;
}

.cf-pt-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2B3A9E;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cf-pt-card__link:hover { opacity: 0.75; }

/* ──────────────────────────────────────────────────────────
   SECTION 7 — BUSINESS TYPES
   ────────────────────────────────────────────────────────── */
.cf-business {
  padding: 0 0 80px;
  background: #ffffff;
}

.business-card {
  background: #FFF9F0;
  border-radius: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.cf-business__title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.cf-business__desc {
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 16px;
}

.cf-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.cf-checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.93rem;
  color: #1a1a2e;
  line-height: 1.5;
}

.cf-checklist__check {
  color: #2B3A9E;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.cf-business__phone {
  width: 280px;
  height: 380px;
  background: linear-gradient(145deg, #1a1a2e, #2B3A9E);
  border-radius: 28px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cf-business__phone-icon {
  font-size: 5rem;
  opacity: 0.2;
}

/* Screen lines simulation */
.cf-business__phone::before,
.cf-business__phone::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

.cf-business__phone::before { top: 30%; }
.cf-business__phone::after  { top: calc(30% + 20px); right: 60px; }

/* ──────────────────────────────────────────────────────────
   SECTION 8 — CTA BANNER
   ────────────────────────────────────────────────────────── */
.cf-cta {
  background: #1a1a2e;
  padding: 80px 0;
  text-align: center;
}

.cf-cta__title {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.cf-cta__subtitle {
  color: rgba(255,255,255,0.68);
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 12px;
}

.cf-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2B3A9E;
  color: #fff;
  padding: 16px 40px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 32px;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.2s ease;
}

.cf-cta__btn:hover {
  background: #F5A623;
  color: #1a1a2e;
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────
   SECTION 9 — FAQ
   ────────────────────────────────────────────────────────── */
.cf-faq {
  background: #ffffff;
  padding: var(--sec-pad) 0;
}

.cf-faq__grid {
  display: grid;
  grid-template-columns: 30fr 70fr;
  gap: 80px;
  align-items: flex-start;
}

.cf-faq__left-title {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.cf-faq__left-label {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 12px;
}

.cf-faq__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cf-faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.cf-faq-item:first-child {
  border-top: 1px solid #e5e7eb;
}

.cf-faq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  gap: 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.cf-faq-header__q {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.45;
}

.cf-faq-header__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #EEF2FF;
  color: #2B3A9E;
  font-size: 1.2rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, background 0.2s ease;
  line-height: 1;
}

.cf-faq-item.is-open .cf-faq-header__icon {
  background: #2B3A9E;
  color: #fff;
  transform: rotate(45deg);
}

.cf-faq-content {
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease;
}

.cf-faq-content__inner {
  padding: 0 0 20px;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cf-hero__grid    { gap: 40px; }
  .cf-workflow__grid { gap: 48px; }
  .business-card     { gap: 40px; padding: 40px; }
  .cf-faq__grid      { gap: 48px; }
}

@media (max-width: 768px) {
  /* Hero */
  .cf-hero { padding: 56px 0; }
  .cf-hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cf-hero__img { height: 280px; order: -1; }

  /* Benefits */
  .cf-benefits__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* Steps */
  .steps-container {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 320px;
  }
  .steps-line { display: none; }
  .step-item { display: flex; align-items: flex-start; gap: 16px; text-align: left; }
  .step-circle { flex-shrink: 0; }
  .step-desc { margin: 4px 0 0; max-width: none; }

  /* Workflow */
  .cf-workflow__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cf-workflow__img-box { height: 280px; }
  .float-card { right: 12px; bottom: 16px; }

  /* Pricing teaser */
  .cf-pt__cards { grid-template-columns: 1fr; }

  /* Business types */
  .business-card {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 32px 24px;
    border-radius: 16px;
  }
  .cf-business__phone { width: 220px; height: 300px; }

  /* FAQ */
  .cf-faq__grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 480px) {
  .cf-benefits__grid { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────
   ANIMATION INITIAL STATES
   (GSAP gsap.to() animates these back to visible)
   ────────────────────────────────────────────────────────── */
.benefit-card,
.cf-pt-card,
.cf-faq-item {
  opacity: 0;
  transform: translateY(30px);
}

.step-circle {
  opacity: 0;
  transform: scale(0);
}

.step-title,
.step-desc {
  opacity: 0;
  transform: translateY(16px);
}

.steps-line {
  transform: scaleX(0);
  transform-origin: left center;
}

.cf-workflow__img {
  opacity: 0;
  transform: translateX(-44px);
}

.cf-workflow__text {
  opacity: 0;
  transform: translateX(44px);
}

.business-card {
  opacity: 0;
  transform: scale(0.95);
}

.cf-cta__title {
  opacity: 0;
  transform: translateY(32px);
}

.cf-cta__subtitle {
  opacity: 0;
  transform: translateY(24px);
}

.cf-cta__btn {
  opacity: 0;
  transform: scale(0.9);
}

.cf-faq__left {
  opacity: 0;
  transform: translateY(20px);
}

/* Fallback: show everything when GSAP is absent or motion is reduced */
@media (prefers-reduced-motion: reduce) {
  .benefit-card, .cf-pt-card, .cf-faq-item,
  .step-circle, .step-title, .step-desc, .steps-line,
  .cf-workflow__img, .cf-workflow__text,
  .business-card,
  .cf-cta__title, .cf-cta__subtitle, .cf-cta__btn,
  .cf-faq__left {
    opacity: 1 !important;
    transform: none !important;
  }
}
