/* =========================================
   UI Plate & Label
   ========================================= */
.ui-plate--glass {
    background: rgba(var(--color-white-rgb), 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--color-white-rgb), 0.2);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.ui-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.ui-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
    transform: translateY(-4px);
}

.ui-label {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
}

.ui-label--success { background-color: var(--color-success); color: white; }
.ui-label--error   { background-color: var(--color-error);   color: white; }
.ui-label--warning { background-color: var(--color-warning);  color: white; }
.ui-label--info    { background-color: var(--color-info);     color: white; }

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-ui);
    border: 1px solid transparent;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--color-primary-rgb), 0.2), 0 2px 4px -1px rgba(var(--color-primary-rgb), 0.1);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.35);
}

.btn--secondary {
    background-color: transparent;
    border: 1px solid var(--color-secondary-dark);
    color: var(--color-secondary-dark);
}

.btn--secondary:hover {
    background-color: var(--color-secondary-dark);
    color: white;
}

.btn--outline-white {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn--outline-white:hover {
    background-color: white;
    color: var(--color-primary);
}

.btn--small {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-sm);
}

.btn--full {
    width: 100%;
}

.btn--survey {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--survey:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn:disabled {
    background-color: var(--color-border) !important;
    color: var(--color-text-muted) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* =========================================
   Ornaments & Dividers
   ========================================= */
.ornament-bg {
    background-image: url('../img/ornament_kalmyk.svg');
    background-repeat: repeat-x;
    background-size: auto 40px;
    height: 40px;
    width: 100%;
}

.ornament-divider {
    height: 48px;
    margin-bottom: 0;
    opacity: 1;
    position: relative;
    overflow: hidden;
}

.ornament-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -232px;
    width: calc(100% + 232px);
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light), var(--color-primary), var(--color-primary-dark));
    -webkit-mask-image: url('../img/ornament_single.svg');
    mask-image: url('../img/ornament_single.svg');
    -webkit-mask-size: 58px 48px;
    mask-size: 58px 48px;
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    animation: ornament-slide-right 20s linear infinite;
    will-change: transform;
}

@keyframes ornament-slide-right {
    from { transform: translateX(0); }
    to   { transform: translateX(232px); }
}

.block-divider {
    margin: -32px 0;
    position: relative;
    overflow: visible;
    z-index: 20;
}

.block-divider__ornaments {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 0.75rem 0;
    width: 100%;
    background-color: var(--color-light-brown);
    border-top: 2px solid var(--color-black);
    border-bottom: 2px solid var(--color-black);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.block-divider__dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-dark-blue);
    border-radius: 50%;
    opacity: 0.8;
    flex-shrink: 0;
}

.block-divider__icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform var(--transition-spring);
}

.block-divider__icon:hover {
    transform: scale(1.3) rotate(360deg);
}

.block-divider__icon--1 { background-image: url('../img/uzor_1.svg'); }
.block-divider__icon--2 { background-image: url('../img/uzor_2.svg'); }
.block-divider__icon--3 { background-image: url('../img/uzor_3.svg'); }
.block-divider__icon--4 { background-image: url('../img/uzor_4.svg'); }
.block-divider__icon--5 { background-image: url('../img/uzor_5.svg'); }
.block-divider__icon--6 { background-image: url('../img/uzor_6.svg'); }

/* =========================================
   Cards
   ========================================= */
.card {
    background: var(--color-white);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.card--sticky {
    position: sticky;
    top: calc(var(--space-xl) + 64px);
}

.service-card {
    background: var(--color-white);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    border-color: var(--color-primary);
}

.content-box {
    background: var(--color-white);
    padding: var(--space-3xl);
    border-radius: var(--radius-lg);
    border-top: 4px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.info-block {
    margin-bottom: var(--space-3xl);
}

.info-block h2 {
    margin-bottom: var(--space-md);
}

/* =========================================
   Section Header
   ========================================= */
.section-header {
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: var(--h2-size);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-black);
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
    font-style: normal;
}

/* =========================================
   Why Us
   ========================================= */
.why-us-section {
    background-color: var(--color-bg-alt);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
}

.why-us-card {
    background: var(--color-white);
    padding: var(--space-2xl) var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
}

.why-us-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary);
}

.why-us-card__icon {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

.why-us-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.why-us-card h3 {
    font-size: var(--font-size-lg);
    margin: 0;
    color: var(--color-primary);
}

.why-us-card p {
    color: var(--color-black);
    opacity: 0.75;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 1280px) {
    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .why-us-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Solutions / Product Cards
   ========================================= */
.solutions-section {
    background-color: white;
    padding: var(--space-section) 0;
}

.solutions-intro {
    margin-bottom: var(--space-3xl);
}

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    position: relative;
    z-index: 5;
}

.product-card {
    position: relative;
    overflow: hidden;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    border-color: var(--color-primary);
}

.product-card__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--color-bg-alt-purple-rgb), 0.4) 0%, rgba(var(--color-bg-alt-blue-rgb), 0.4) 100%);
    z-index: 0;
    opacity: 0.6;
    overflow: hidden;
    transform: translateZ(0);
}

.product-card__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/vertical_ornament.svg');
    background-repeat: repeat;
    background-attachment: fixed;
    background-size: 8vw 45vh;
    opacity: 0.15;
    mix-blend-mode: multiply;
    z-index: 1;
    pointer-events: none;
    transform: scaleX(-1) translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

@media (max-width: 768px) {
    .product-card__bg::after {
        background-attachment: scroll;
        background-position: top left;
        background-size: 18vw 18vw;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: 150px;
    }
}

.product-card__main {
    position: relative;
    z-index: 10;
    padding: var(--space-xl) var(--space-xl) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.product-card:hover .product-card__main {
    transform: translateY(-5px);
    opacity: 0.6;
}

.product-card__icon-wrap {
    width: 80px;
    height: 80px;
    background: var(--color-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    transition: transform var(--transition-base);
}

.product-card:hover .product-card__icon-wrap {
    transform: scale(1.1);
}

.product-card__icon-wrap img {
    width: 48px;
    height: 48px;
}

.product-card h3 {
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
    font-size: var(--font-size-xl);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-card__hook {
    font-size: var(--font-size-md);
    color: var(--color-secondary-dark);
    font-weight: 700;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.product-card__desc {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    text-align: left;
}

.archetype-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.product-card .role-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
    text-align: left;
    width: 100%;
}

.product-card .role-list li {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.product-card .role-list li::before {
    content: '';
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background-image: url('../img/uzor_3.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.product-card .role-list li svg {
    display: none;
}

.product-card__cta {
    position: relative;
    z-index: 30;
    padding: var(--space-md) var(--space-xl) var(--space-md);
    width: 100%;
    margin-top: auto;
    display: flex;
    flex-direction: row;
    gap: var(--space-sm);
    background: transparent;
}

.product-card__cta .btn {
    flex: 1;
}

.card-config-footer {
    background: rgba(var(--color-primary-rgb), 0.03);
    border-top: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-xl);
    font-size: 11px;
    text-align: left;
    z-index: 10;
}

.config-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 4px;
    opacity: 0.7;
}

.stack-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.stack-badge {
    background: white;
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Bottom gradient accent line */
.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    z-index: 50;
}

/* =========================================
   Hover Panel
   ========================================= */
.hover-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: rgba(var(--color-white-rgb), 0.96);
    backdrop-filter: blur(12px);
    z-index: 25;
    transition: all var(--transition-reveal);
    overflow: hidden;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.product-card:hover .hover-panel {
    height: calc(100% - 70px);
    opacity: 1;
    padding: var(--space-xl);
    border-bottom: 2px solid var(--color-primary);
}

.hover-panel__content {
    opacity: 0;
    transition: opacity var(--transition-base);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--color-text);
}

.product-card:hover .hover-panel__content {
    opacity: 1;
}

.hover-panel h4 {
    font-size: var(--font-size-md);
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.hover-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hover-panel__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.hover-panel__list li::before {
    content: '';
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-image: url('../img/uzor_5.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.hover-panel ul {
    list-style: none;
    padding: 0;
}

.hover-panel li {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-xs);
}

/* ---- Responsive for solutions grid & hover panel ---- */
@media (max-width: 1280px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .solutions-grid {
        grid-template-columns: 1fr;
    }

    .product-card-long {
        grid-column: span 1;
    }

    .product-card-long .product-card__main {
        flex-direction: column;
        text-align: center;
    }

    .hover-panel {
        display: none;
    }
}

/* Mobile: hover panel shown statically below buttons */
@media (max-width: 768px) {
    .hover-panel {
        display: flex;
        position: static;
        height: auto;
        opacity: 1;
        padding: var(--space-md) var(--space-xl) var(--space-xl);
        border-top: 2px solid var(--color-primary);
        border-bottom: none;
        background: rgba(var(--color-white-rgb), 0.96);
        transition: none;
    }

    .hover-panel__content {
        opacity: 1;
    }

    .product-card .product-card__main {
        opacity: 1;
        transform: none;
    }

    .product-card:hover .product-card__main {
        opacity: 1;
        transform: none;
    }

    .product-card:hover .hover-panel {
        position: static;
        height: auto;
        padding: var(--space-md) var(--space-xl) var(--space-xl);
        border-top: 2px solid var(--color-primary);
        border-bottom: none;
        transition: none;
    }

    .product-card__main  { order: 1; }
    .hover-panel         { order: 2; }
    .product-card__cta   { order: 3; }
}

/* Touchscreen tablets (no pointer): hover panel always visible */
@media (hover: none) and (min-width: 1025px) {
    .hover-panel {
        display: flex;
        position: static;
        height: auto;
        opacity: 1;
        padding: var(--space-md) var(--space-xl);
        border-bottom: 2px solid var(--color-primary);
        background: rgba(var(--color-white-rgb), 0.96);
    }

    .hover-panel__content {
        opacity: 1;
    }

    .product-card .product-card__main {
        opacity: 1;
        transform: none;
    }
}

/* =========================================
   Back to Top
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 1500;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease, background-color 200ms ease;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--color-primary-dark);
}

.back-to-top:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: calc(var(--space-lg) + 80px);
        right: var(--space-lg);
    }
}

/* =========================================
   Legal Info
   ========================================= */
.legal-info-list {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
}

.legal-info-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-bg-alt);
    font-size: var(--font-size-sm);
}

.legal-info-list .label {
    font-weight: 600;
    color: var(--color-primary);
}

.legal-info-list .value {
    color: var(--color-text);
}
