/**
 * LawfyCo — reusable premium closing CTA.
 */

.lawfyco-closing-cta {
  --closing-gold: #c9a04f;
  --closing-gold-light: #d4b06a;
  --closing-gold-glow: rgb(201 160 79 / 0.32);
  --closing-bg: #060806;
  --closing-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --closing-max: 1240px;
  --closing-pad-x: clamp(1.5rem, 5vw, 2.75rem);
  --closing-type-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --closing-type-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--closing-bg);
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(6.5rem, 11vw, 10rem);
  position: relative;
}

.lawfyco-closing-cta::before {
  background:
    radial-gradient(ellipse 75% 55% at 50% 100%, rgb(201 160 79 / 0.16), transparent 62%),
    radial-gradient(ellipse 45% 35% at 15% 20%, rgb(201 160 79 / 0.06), transparent 58%),
    radial-gradient(ellipse 40% 32% at 88% 24%, rgb(201 160 79 / 0.05), transparent 55%);
  content: "";
  inset: 0;
  opacity: 1;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.lawfyco-closing-cta::after {
  background: linear-gradient(180deg, transparent 55%, rgb(4 6 4 / 0.85) 100%);
  bottom: 0;
  content: "";
  height: 40%;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  z-index: 0;
}

.lawfyco-closing-cta__atmosphere {
  background:
    linear-gradient(90deg, transparent 0%, rgb(201 160 79 / 0.04) 50%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 0.012) 0,
      rgb(255 255 255 / 0.012) 1px,
      transparent 1px,
      transparent 80px
    );
  inset: 0;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.35), transparent 85%);
  opacity: 0.55;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.lawfyco-closing-cta__glow {
  border-radius: 9999px;
  filter: blur(72px);
  height: clamp(14rem, 28vw, 22rem);
  opacity: 0.42;
  pointer-events: none;
  position: absolute;
  width: clamp(14rem, 28vw, 22rem);
  z-index: 0;
}

.lawfyco-closing-cta__glow--left {
  background: rgb(201 160 79 / 0.22);
  left: -6%;
  top: 18%;
}

.lawfyco-closing-cta__glow--right {
  background: rgb(201 160 79 / 0.14);
  bottom: 8%;
  right: -4%;
}

.lawfyco-closing-cta__shell {
  margin-inline: auto;
  max-width: var(--closing-max);
  padding-inline: var(--closing-pad-x);
  position: relative;
  width: 100%;
  z-index: 1;
}

.lawfyco-closing-cta__stage {
  position: relative;
}

.lawfyco-closing-cta__frame {
  background:
    linear-gradient(168deg, rgb(24 30 24 / 0.92) 0%, rgb(14 18 14 / 0.98) 42%, rgb(8 10 8 / 1) 100%);
  border: 1px solid rgb(255 255 255 / 0.11);
  border-radius: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.08) inset,
    0 -1px 0 rgb(0 0 0 / 0.35) inset,
    0 0 0 1px rgb(201 160 79 / 0.08),
    0 48px 100px -28px rgb(0 0 0 / 0.95),
    0 0 80px -20px rgb(201 160 79 / 0.28);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.5rem, 5vw, 4rem);
  position: relative;
}

/* Inherit shared homepage frame tokens when rendered inside .lawfyco-home */
.lawfyco-home .lawfyco-closing-cta__frame {
  background: var(--home-frame-bg);
  border-color: var(--home-frame-border);
  border-radius: var(--home-frame-radius);
  box-shadow: var(--home-frame-shadow);
}

.lawfyco-closing-cta__frame::before {
  background: linear-gradient(90deg, var(--closing-gold-light), var(--closing-gold) 42%, transparent 100%);
  box-shadow: 0 0 20px -2px rgb(201 160 79 / 0.55);
  content: "";
  height: 2px;
  left: clamp(1.75rem, 4vw, 2.75rem);
  opacity: 0.85;
  position: absolute;
  right: clamp(1.75rem, 4vw, 2.75rem);
  top: 0;
  z-index: 2;
}

.lawfyco-closing-cta__frame::after {
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgb(201 160 79 / 0.09), transparent 68%);
  border: 1px solid rgb(255 255 255 / 0.04);
  border-radius: inherit;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.05) inset;
  content: "";
  inset: 0.65rem;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.lawfyco-closing-cta__grid {
  display: grid;
  gap: clamp(2.25rem, 4.5vw, 3.5rem);
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  position: relative;
  z-index: 1;
}

.lawfyco-closing-cta__eyebrow {
  align-items: center;
  color: var(--closing-gold-light);
  display: flex;
  font-size: 0.6875rem;
  font-weight: 600;
  gap: 0.75rem;
  letter-spacing: 0.34em;
  margin: 0 0 1.5rem;
  text-shadow: 0 0 22px rgb(201 160 79 / 0.18);
  text-transform: uppercase;
}

.lawfyco-closing-cta__eyebrow::before {
  background: linear-gradient(90deg, var(--closing-gold), rgb(201 160 79 / 0.2));
  box-shadow: 0 0 10px -2px rgb(201 160 79 / 0.5);
  content: "";
  flex-shrink: 0;
  height: 1px;
  width: 2rem;
}

.lawfyco-closing-cta__heading {
  color: #fff;
  font-family: var(--closing-type-display);
  font-size: clamp(2.375rem, 4.8vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.06;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.lawfyco-closing-cta__heading::first-line {
  color: var(--closing-gold-light);
}

.lawfyco-closing-cta__lead {
  color: rgb(255 255 255 / 0.64);
  font-family: var(--closing-type-display);
  font-size: clamp(1.0625rem, 1.6vw, 1.3125rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.58;
  margin: 0 0 2rem;
  max-width: 34rem;
}

.lawfyco-closing-cta__trust {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lawfyco-closing-cta__trust-item {
  align-items: center;
  color: rgb(255 255 255 / 0.82);
  display: flex;
  font-size: 0.8125rem;
  font-weight: 600;
  gap: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lawfyco-closing-cta__trust-mark {
  background: linear-gradient(135deg, var(--closing-gold-light), var(--closing-gold));
  border-radius: 9999px;
  box-shadow: 0 0 12px -2px rgb(201 160 79 / 0.65);
  flex-shrink: 0;
  height: 6px;
  position: relative;
  width: 6px;
}

.lawfyco-closing-cta__trust-mark::after {
  border: 1px solid rgb(201 160 79 / 0.35);
  border-radius: inherit;
  content: "";
  inset: -4px;
  position: absolute;
}

.lawfyco-closing-cta__action {
  backdrop-filter: blur(8px);
  background: linear-gradient(155deg, rgb(255 255 255 / 0.04) 0%, rgb(255 255 255 / 0.01) 100%);
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 1.5rem;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.05) inset,
    0 20px 48px -28px rgb(0 0 0 / 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  position: relative;
}

.lawfyco-closing-cta__action::before {
  background: linear-gradient(180deg, rgb(201 160 79 / 0.14) 0%, transparent 32%);
  content: "";
  height: 1px;
  left: 1.25rem;
  position: absolute;
  right: 1.25rem;
  top: 0;
}

.lawfyco-closing-cta__copy {
  color: rgb(200 206 214 / 0.96);
  font-family: var(--closing-type-body);
  font-size: clamp(0.96875rem, 1.1vw, 1.0625rem);
  letter-spacing: 0.008em;
  line-height: 1.78;
  margin: 0 0 2rem;
}

.lawfyco-closing-cta__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.lawfyco-closing-cta__btn-primary {
  width: 100%;
}

.lawfyco-closing-cta__btn-secondary {
  width: 100%;
}

.lawfyco-closing-cta__assurance {
  border-top: 1px solid rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.4);
  font-size: 0.75rem;
  font-style: italic;
  letter-spacing: 0.04em;
  line-height: 1.55;
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  position: relative;
}

.lawfyco-closing-cta__assurance::before {
  background: linear-gradient(90deg, transparent, rgb(201 160 79 / 0.28), transparent);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.lawfyco-closing-cta__stats {
  border-top: 1px solid rgb(255 255 255 / 0.07);
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
  position: relative;
  z-index: 1;
}

.lawfyco-closing-cta__stats::before {
  background: linear-gradient(90deg, transparent 5%, rgb(201 160 79 / 0.3) 50%, transparent 95%);
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.lawfyco-closing-cta__stat {
  position: relative;
  text-align: center;
}

.lawfyco-closing-cta__stat + .lawfyco-closing-cta__stat::before {
  background: linear-gradient(180deg, transparent, rgb(255 255 255 / 0.08), transparent);
  content: "";
  height: 70%;
  left: 0;
  position: absolute;
  top: 15%;
  width: 1px;
}

.lawfyco-closing-cta__stat-value {
  color: var(--closing-gold-light);
  font-family: var(--closing-type-display);
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}

.lawfyco-closing-cta__stat-label {
  color: rgb(255 255 255 / 0.42);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  margin: 0;
  text-transform: uppercase;
}

/* Rhythm when placed after the mid-page CTA */
.lawfyco-home-cta + .lawfyco-closing-cta {
  padding-top: clamp(4rem, 7vw, 6rem);
}

.lawfyco-home-cta + .lawfyco-closing-cta::before {
  opacity: 0.82;
}

/* Homepage variant — extra presence */
.lawfyco-closing-cta--home {
  padding-bottom: clamp(7.5rem, 12vw, 11rem);
}

.lawfyco-closing-cta--home .lawfyco-closing-cta__frame {
  padding: clamp(2.75rem, 5.5vw, 4.5rem);
}

.lawfyco-closing-cta--home .lawfyco-closing-cta__heading {
  font-size: clamp(2.5rem, 5.2vw, 4rem);
}

/* Inner pages */
.lawfyco-inner-page .lawfyco-closing-cta {
  margin-top: clamp(3rem, 6vw, 5rem);
}

@media (max-width: 960px) {
  .lawfyco-closing-cta__grid {
    grid-template-columns: 1fr;
  }

  .lawfyco-closing-cta__stats {
    grid-template-columns: 1fr;
  }

  .lawfyco-closing-cta__stat + .lawfyco-closing-cta__stat::before {
    display: none;
  }

  .lawfyco-closing-cta__stat {
    border-top: 1px solid rgb(255 255 255 / 0.06);
    padding-top: 1rem;
  }

  .lawfyco-closing-cta__stat:first-child {
    border-top: 0;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .lawfyco-closing-cta__glow {
    opacity: 0.28;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lawfyco-closing-cta__frame {
    transition: none;
  }
}