/* ГрафДок — продуктовый блок */

.site-premium .grafdoc-section {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 108px) 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(15, 136, 147, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 80%, rgba(45, 128, 194, 0.1), transparent 52%),
    linear-gradient(180deg, #f2f8fc 0%, #f8fbfe 45%, #eef5fa 100%);
  border-block: 1px solid rgba(45, 128, 194, 0.1);
}

/* ——— Фон: согласование / поток документов ——— */
.grafdoc-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.grafdoc-bg__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(15, 136, 147, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 136, 147, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 15%, transparent 72%);
}

.grafdoc-bg__flow {
  position: absolute;
  left: 0;
  right: 0;
  top: 15%;
  width: 100%;
  height: 55%;
  opacity: 0.45;
}

.grafdoc-bg__path {
  fill: none;
  stroke: url(#grafdoc-flow-grad);
  stroke-width: 2;
  stroke-dasharray: 14 12;
  stroke-linecap: round;
  animation: grafdoc-path-flow 18s linear infinite;
}

.grafdoc-bg__path--2 {
  opacity: 0.6;
  animation-duration: 22s;
  animation-delay: -6s;
}

@keyframes grafdoc-path-flow {
  to {
    stroke-dashoffset: -52;
  }
}

.grafdoc-bg__nodes circle {
  fill: var(--info-color);
  opacity: 0.4;
  transform-origin: center;
  transform-box: fill-box;
  animation: grafdoc-node-pulse 4s ease-in-out infinite;
}

.grafdoc-bg__nodes circle:nth-child(2) { animation-delay: -0.8s; }
.grafdoc-bg__nodes circle:nth-child(3) { animation-delay: -1.6s; }
.grafdoc-bg__nodes circle:nth-child(4) { animation-delay: -2.4s; }
.grafdoc-bg__nodes circle:nth-child(5) { animation-delay: -3.2s; }

@keyframes grafdoc-node-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.75);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.35);
  }
}

.grafdoc-bg__docs {
  position: absolute;
  inset: 0;
}

.grafdoc-bg__doc {
  position: absolute;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--info-color);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 136, 147, 0.22);
  box-shadow: 0 12px 32px rgba(15, 136, 147, 0.12);
  animation: grafdoc-doc-float 16s ease-in-out infinite;
}

.grafdoc-bg__doc--1 {
  left: 8%;
  top: 22%;
}

.grafdoc-bg__doc--2 {
  right: 12%;
  top: 18%;
  animation-delay: -5s;
  color: var(--primary-color);
}

.grafdoc-bg__doc--3 {
  left: 42%;
  bottom: 18%;
  animation-delay: -10s;
}

@keyframes grafdoc-doc-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(-2deg);
  }
  50% {
    transform: translate(12px, -18px) rotate(3deg);
  }
}

/* ——— Контент ——— */
.grafdoc-section__inner {
  position: relative;
  z-index: 1;
}

.grafdoc-section__head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(36px, 5vw, 52px);
}

.grafdoc-section__eyebrow {
  color: var(--info-color);
  background: rgba(15, 136, 147, 0.1);
  border-color: rgba(15, 136, 147, 0.22);
}

.grafdoc-section__title {
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-color);
}

.grafdoc-section__title-accent {
  background: linear-gradient(120deg, var(--info-color) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grafdoc-section__lead {
  margin: 0;
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.6;
  color: var(--text-muted);
}

/* Intro: фичи + превью */
.grafdoc-intro {
  display: grid;
  gap: clamp(28px, 4vw, 40px);
  align-items: center;
  margin-bottom: clamp(48px, 6vw, 72px);
}

@media (min-width: 960px) {
  .grafdoc-intro {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(32px, 4vw, 48px);
  }
}

.grafdoc-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grafdoc-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(45, 128, 194, 0.14);
  box-shadow: 0 10px 32px rgba(45, 128, 194, 0.08);
  backdrop-filter: blur(8px);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.grafdoc-feature:hover,
.grafdoc-feature.is-highlight {
  transform: translateX(6px);
  border-color: rgba(15, 136, 147, 0.35);
  box-shadow: 0 16px 40px rgba(15, 136, 147, 0.14);
}

.grafdoc-feature__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--info-color);
  background: linear-gradient(145deg, rgba(15, 136, 147, 0.14), rgba(45, 128, 194, 0.08));
  transition: transform 0.35s ease, background 0.35s ease;
}

.grafdoc-feature.is-highlight .grafdoc-feature__icon,
.grafdoc-feature:hover .grafdoc-feature__icon {
  transform: scale(1.08) rotate(-4deg);
  background: linear-gradient(135deg, var(--info-color), var(--primary-color));
  color: #fff;
}

.grafdoc-feature p {
  margin: 0;
  padding-top: 4px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text-color);
}

/* Превью интерфейса */
.grafdoc-preview__frame {
  position: relative;
  border-radius: 20px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 248, 253, 0.9));
  border: 1px solid rgba(45, 128, 194, 0.2);
  box-shadow:
    0 32px 80px rgba(15, 35, 55, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  animation: grafdoc-preview-float 7s ease-in-out infinite;
}

@keyframes grafdoc-preview-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.grafdoc-preview__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.grafdoc-preview__shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  animation: grafdoc-shine 8s ease-in-out infinite;
}

@keyframes grafdoc-shine {
  0%,
  70%,
  100% {
    transform: translateX(0);
    opacity: 0;
  }
  82% {
    opacity: 1;
  }
  95% {
    transform: translateX(280%);
    opacity: 0;
  }
}

.grafdoc-preview__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(45, 128, 194, 0.12);
}

.grafdoc-preview__badges {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 3;
  pointer-events: none;
}

.grafdoc-preview__pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.grafdoc-preview__pill.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.grafdoc-preview__pill--draft {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(45, 128, 194, 0.2);
}

.grafdoc-preview__pill--review {
  color: #8a5a00;
  background: rgba(255, 236, 179, 0.95);
  border: 1px solid rgba(200, 150, 40, 0.35);
}

.grafdoc-preview__pill--ok {
  color: #0d6b4d;
  background: rgba(220, 252, 231, 0.95);
  border: 1px solid rgba(13, 107, 77, 0.3);
  box-shadow: 0 4px 16px rgba(13, 107, 77, 0.2);
}

/* Сценарии */
.grafdoc-scenarios__head {
  text-align: center;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.grafdoc-scenarios__title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.grafdoc-scenarios__sub {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
}

.grafdoc-scenarios__grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .grafdoc-scenarios__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grafdoc-scenarios__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.grafdoc-scenario {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 20px 18px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(45, 128, 194, 0.14);
  box-shadow: 0 12px 36px rgba(45, 128, 194, 0.08);
  transition:
    transform 0.4s cubic-bezier(0.34, 1.15, 0.64, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
  opacity: 0.88;
}

.grafdoc-scenario__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(15, 136, 147, 0.2), rgba(45, 128, 194, 0.15));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.grafdoc-scenario--active,
.grafdoc-scenario:hover {
  opacity: 1;
  transform: translateY(-8px);
  border-color: rgba(15, 136, 147, 0.38);
  box-shadow: 0 24px 52px rgba(15, 136, 147, 0.16);
}

.grafdoc-scenario--active .grafdoc-scenario__glow,
.grafdoc-scenario:hover .grafdoc-scenario__glow {
  opacity: 1;
  animation: grafdoc-scenario-glow 2.5s ease-in-out infinite;
}

@keyframes grafdoc-scenario-glow {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.grafdoc-scenario h4 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-color);
}

.grafdoc-scenario ul {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.grafdoc-scenario li {
  margin-bottom: 6px;
}

.grafdoc-scenario li::marker {
  color: var(--info-color);
}

.grafdoc-scenario--active h4 {
  color: var(--info-color);
}

@media (max-width: 959px) {
  .grafdoc-preview__badges {
    left: 12px;
    bottom: 12px;
  }

  .grafdoc-bg__doc {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grafdoc-bg__path,
  .grafdoc-bg__node,
  .grafdoc-bg__doc,
  .grafdoc-preview__frame,
  .grafdoc-preview__shine::after,
  .grafdoc-scenario__glow,
  .grafdoc-scenario--active .grafdoc-scenario__glow {
    animation: none;
  }

  .grafdoc-preview__pill {
    opacity: 1;
    transform: none;
  }
}
