/* =============================================================
   VKARD CTA Section Widget
   Scoped recreation of src/components/cta-section.tsx.
   ============================================================= */

@property --vkcta-gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@property --vkcta-gradient-angle-offset {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@property --vkcta-gradient-percent {
    syntax: "<percentage>";
    initial-value: 5%;
    inherits: false;
}

@property --vkcta-gradient-shine {
    syntax: "<color>";
    initial-value: white;
    inherits: false;
}

.vkcta-section,
.vkcta-section * {
    box-sizing: border-box;
}

.vkcta-section {
    width: 100%;
    padding: 96px 24px;
    background: #f9fafb;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.vkcta-section__container {
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    text-align: center;
}

.vkcta-section__panel {
    --vkcta-section-start: #01013c;
    --vkcta-section-mid: #020258;
    --vkcta-section-end: #01013c;
    --vkcta-section-glow: #03a9f4;
    position: relative;
    overflow: hidden;
    padding: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--vkcta-section-start) 0%, var(--vkcta-section-mid) 50%, var(--vkcta-section-end) 100%);
}

.vkcta-section__glows {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    pointer-events: none;
}

.vkcta-section__glow {
    position: absolute;
    border-radius: 999px;
    background: var(--vkcta-section-glow);
    filter: blur(48px);
}

.vkcta-section__glow--top {
    top: 0;
    right: 0;
    width: 256px;
    height: 256px;
    transform: translate(50%, -50%);
}

.vkcta-section__glow--bottom {
    bottom: 0;
    left: 0;
    width: 192px;
    height: 192px;
    transform: translate(-50%, 50%);
}

.vkcta-section__content {
    position: relative;
    z-index: 1;
}

.vkcta-section__heading {
    margin: 0 0 16px;
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
}

.vkcta-section__subtitle {
    max-width: 576px;
    margin: 0 auto 32px;
    color: rgba(186, 230, 253, 0.7);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.55;
}

.vkcta-section__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.vkcta-section__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.vkcta-section__button:hover,
.vkcta-section__button:focus-visible {
    text-decoration: none;
}

.vkcta-section__button-content {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.vkcta-section__button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.vkcta-section__button-icon svg,
.vkcta-section__button-icon i {
    width: 1.25em;
    height: 1.25em;
    color: currentColor;
    fill: currentColor;
}

.vkcta-section__button--primary {
    --vkcta-primary-bg: #03a9f4;
    --vkcta-primary-subtle: #0292d4;
    --vkcta-primary-highlight: #4fc3f7;
    --vkcta-primary-highlight-subtle: #81d4fa;
    --vkcta-gradient-percent: 5%;
    --vkcta-gradient-angle-offset: 0deg;
    --vkcta-gradient-shine: #ffffff;
    isolation: isolate;
    position: relative;
    overflow: hidden;
    min-height: 58px;
    padding: 20px 40px;
    border: 1px solid transparent;
    border-radius: 360px;
    color: #fff;
    background:
        linear-gradient(var(--vkcta-primary-bg), var(--vkcta-primary-bg)) padding-box,
        conic-gradient(
            from calc(var(--vkcta-gradient-angle) - var(--vkcta-gradient-angle-offset)),
            transparent,
            var(--vkcta-primary-highlight) var(--vkcta-gradient-percent),
            var(--vkcta-gradient-shine) calc(var(--vkcta-gradient-percent) * 2),
            var(--vkcta-primary-highlight) calc(var(--vkcta-gradient-percent) * 3),
            transparent calc(var(--vkcta-gradient-percent) * 4)
        ) border-box;
    box-shadow: inset 0 0 0 1px var(--vkcta-primary-subtle);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    outline-offset: 4px;
    transition: --vkcta-gradient-angle-offset 800ms cubic-bezier(0.25, 1, 0.5, 1),
        --vkcta-gradient-percent 800ms cubic-bezier(0.25, 1, 0.5, 1),
        --vkcta-gradient-shine 800ms cubic-bezier(0.25, 1, 0.5, 1);
    animation: vkcta-gradient-angle 3s linear infinite;
}

.vkcta-section__button--primary:hover,
.vkcta-section__button--primary:focus-visible {
    --vkcta-gradient-percent: 20%;
    --vkcta-gradient-angle-offset: 95deg;
    --vkcta-gradient-shine: var(--vkcta-primary-highlight-subtle);
    color: #fff;
}

.vkcta-section__button--primary:active {
    transform: translateY(1px);
}

.vkcta-section__button--primary::before,
.vkcta-section__button--primary::after,
.vkcta-section__button--primary .vkcta-section__button-content::before {
    content: "";
    pointer-events: none;
    position: absolute;
    inset-inline-start: 50%;
    inset-block-start: 50%;
    z-index: -1;
    translate: -50% -50%;
}

.vkcta-section__button--primary::before {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border-radius: inherit;
    background: radial-gradient(circle at 2px 2px, white 0.5px, transparent 0) padding-box;
    background-repeat: space;
    background-size: 4px 4px;
    opacity: 0.4;
    mask-image: conic-gradient(from calc(var(--vkcta-gradient-angle) + 45deg), black, transparent 10% 90%, black);
    -webkit-mask-image: conic-gradient(from calc(var(--vkcta-gradient-angle) + 45deg), black, transparent 10% 90%, black);
}

.vkcta-section__button--primary::after {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(-50deg, transparent, var(--vkcta-primary-highlight), transparent);
    opacity: 0.6;
    mask-image: radial-gradient(circle at bottom, transparent 40%, black);
    -webkit-mask-image: radial-gradient(circle at bottom, transparent 40%, black);
    animation: vkcta-shimmer 7.5s linear infinite paused;
}

.vkcta-section__button--primary:hover::after,
.vkcta-section__button--primary:focus-visible::after {
    animation-play-state: running;
}

.vkcta-section__button--primary .vkcta-section__button-content::before {
    width: calc(100% + 1rem);
    height: calc(100% + 1rem);
    box-shadow: inset 0 -1ex 2rem 4px var(--vkcta-primary-highlight);
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.25, 1, 0.5, 1);
    animation: vkcta-breathe 4.5s linear infinite;
}

.vkcta-section__button--primary:hover .vkcta-section__button-content::before,
.vkcta-section__button--primary:focus-visible .vkcta-section__button-content::before {
    opacity: 1;
}

.vkcta-section__button--secondary {
    min-height: 58px;
    padding: 16px 32px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #fff;
    background: transparent;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.vkcta-section__button--secondary:hover,
.vkcta-section__button--secondary:focus-visible {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes vkcta-gradient-angle {
    to {
        --vkcta-gradient-angle: 360deg;
    }
}

@keyframes vkcta-shimmer {
    to {
        rotate: 360deg;
    }
}

@keyframes vkcta-breathe {
    50% {
        scale: 1.2;
    }
}

@media (max-width: 767px) {
    .vkcta-section {
        padding: 72px 24px;
    }

    .vkcta-section__panel {
        padding: 48px 32px;
    }

    .vkcta-section__heading {
        font-size: 30px;
    }

    .vkcta-section__buttons {
        flex-direction: column;
    }

    .vkcta-section__button {
        width: 100%;
    }

    .vkcta-section__button-content {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vkcta-section__button--primary,
    .vkcta-section__button--primary::after,
    .vkcta-section__button--primary .vkcta-section__button-content::before {
        animation: none !important;
        transition: none !important;
    }
}
