/* * Rumsoft Premium Style Engine - Optimized Performance
 * Version: 2.5 (Senior UX/UI Audit)
 * ----------------------------------------------------
 */

/* --- Core Brand Variables --- */
:root {
    --mts-red: #ff0000;
    --mts-red-dark: #d90000;
    --mts-dark: #1d2023;
    --mts-dark-bg: #121212;
    --mts-gray: #f2f3f7;
    --mts-text-gray: #626c77;
    --marquee-bg: #ffffff;
    
    /* Оптимизированные тени */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

.dark {
    --marquee-bg: #121212;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

/* --- Global Base Styles --- */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--mts-dark);
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Button Components --- */
.btn-primary {
    background-color: var(--mts-red);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), 
                background-color 0.3s ease, 
                box-shadow 0.4s ease;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.25);
    backface-visibility: hidden; /* GPU fix */
}

.btn-primary:hover {
    background-color: var(--mts-red-dark);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 12px 30px -5px rgba(255, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.rumsoft-btn {
    --rumsoft-btn-fill: linear-gradient(90deg, var(--mts-red), var(--mts-red-dark));
    --rumsoft-btn-wave-x: 50%;
    --rumsoft-btn-wave-y: 50%;
    --rumsoft-btn-wave-size: 0px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 0;
    transition: transform 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                color 0.3s ease;
    backface-visibility: hidden;
}

.rumsoft-btn::before,
.rumsoft-btn::after {
    content: "";
    position: absolute;
    border-radius: inherit;
    pointer-events: none;
}

.rumsoft-btn::before {
    inset: 0;
    z-index: 0;
    background: var(--rumsoft-btn-fill);
    display: none;
    transform: translateX(-105%);
    transition: transform 0.34s ease;
    will-change: transform;
}

.rumsoft-btn::after {
    top: var(--rumsoft-btn-wave-y);
    left: var(--rumsoft-btn-wave-x);
    z-index: 1;
    width: var(--rumsoft-btn-wave-size);
    height: var(--rumsoft-btn-wave-size);
    background: radial-gradient(circle,
                rgba(255, 255, 255, 0.9) 0%,
                rgba(255, 255, 255, 0.62) 26%,
                rgba(255, 255, 255, 0.34) 52%,
                rgba(255, 255, 255, 0.1) 72%,
                rgba(255, 255, 255, 0) 88%);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    will-change: transform, opacity;
}

.rumsoft-btn__label {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rumsoft-btn.rumsoft-btn--primary,
.rumsoft-btn.rumsoft-btn--secondary {
    transition: transform 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                color 0.3s ease;
}

.rumsoft-btn.rumsoft-btn--primary {
    background-color: var(--mts-red);
    color: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(255, 13, 13, 0.35);
}

.rumsoft-btn.rumsoft-btn--primary::before {
    display: none;
}

.rumsoft-btn.rumsoft-btn--secondary {
    background-color: #1d2023;
    border-color: rgba(36, 55, 78, 0.95);
    color: #ffffff;
    box-shadow: 0 10px 28px -18px rgba(15, 23, 42, 0.85);
}

.rumsoft-btn.rumsoft-btn--secondary::before {
    display: block;
}

.rumsoft-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 4px;
}

.rumsoft-btn.rumsoft-btn--primary:focus-visible {
    background-color: var(--mts-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 38px -8px rgba(255, 13, 13, 0.45);
}

.rumsoft-btn.rumsoft-btn--secondary:focus-visible {
    border-color: rgba(255, 13, 13, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 16px 36px -12px rgba(255, 13, 13, 0.32);
}

.rumsoft-btn.rumsoft-btn--secondary:focus-visible::before {
    transform: translateX(0);
}

.rumsoft-btn:active {
    transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
    .rumsoft-btn.rumsoft-btn--primary:hover {
        background-color: var(--mts-red-dark);
        transform: translateY(-2px);
        box-shadow: 0 16px 38px -8px rgba(255, 13, 13, 0.45);
    }

    .rumsoft-btn.rumsoft-btn--secondary:hover {
        border-color: rgba(255, 13, 13, 0.45);
        transform: translateY(-2px);
        box-shadow: 0 16px 36px -12px rgba(255, 13, 13, 0.32);
    }

    .rumsoft-btn.rumsoft-btn--secondary:hover::before {
        transform: translateX(0);
    }

    .rumsoft-btn.is-wave-running::after {
        animation: rumsoft-button-wave 1.24s ease-out;
    }
}

@keyframes rumsoft-button-wave {
    0% {
        opacity: 0.92;
        transform: translate(-50%, -50%) scale(0);
    }

    55% {
        opacity: 0.56;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rumsoft-btn,
    .rumsoft-btn::before,
    .rumsoft-btn::after {
        transition: none;
        animation: none;
    }

    .rumsoft-btn.rumsoft-btn--primary:hover,
    .rumsoft-btn.rumsoft-btn--primary:focus-visible,
    .rumsoft-btn.rumsoft-btn--secondary:hover,
    .rumsoft-btn.rumsoft-btn--secondary:focus-visible,
    .rumsoft-btn:active {
        transform: none;
    }

    .rumsoft-btn::after,
    .rumsoft-btn:hover::after,
    .rumsoft-btn:focus-visible::after {
        opacity: 0;
        transform: none;
    }
}

/* --- Layout Elements & Shadows --- */
.card-shadow {
    box-shadow: var(--shadow-sm);
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1), 
                box-shadow 0.5s ease,
                border-color 0.3s ease;
    will-change: transform, box-shadow;
}

.card-shadow:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: var(--shadow-lg);
}

.rounded-mts {
    border-radius: 24px;
}

/* --- Tariff Cards Component --- */
.rumsoft-tariff-grid {
    display: grid;
    gap: 1.5rem;
}

.rumsoft-tariff-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.4s ease;
}

.dark .rumsoft-tariff-card {
    border-color: #2f333a;
    background-color: var(--mts-dark);
}

.rumsoft-tariff-card--featured {
    border-top-width: 4px;
    border-top-color: #3b82f6;
}

.rumsoft-tariff-card--postpaid {
    border-color: #374151;
    background: linear-gradient(135deg, #111827, #1f2937);
    box-shadow: var(--shadow-lg);
    color: #ffffff;
}

.dark .rumsoft-tariff-card--postpaid {
    border-color: #374151;
    background: linear-gradient(135deg, #1f2937, #111827);
}

.rumsoft-tariff-card--postpaid::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom right, rgba(239, 68, 68, 0.1), transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.rumsoft-tariff-card--postpaid > * {
    position: relative;
    z-index: 1;
}

.rumsoft-tariff-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    padding: 0.375rem 1rem;
    border-bottom-left-radius: 16px;
    background-color: var(--mts-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1rem;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}

.rumsoft-tariff-title {
    margin: 0 0 0.5rem;
    color: #111827;
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.dark .rumsoft-tariff-title,
.rumsoft-tariff-card--postpaid .rumsoft-tariff-title {
    color: #ffffff;
}

.rumsoft-tariff-limit {
    margin: 0 0 1.5rem;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rumsoft-tariff-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
}

.dark .rumsoft-tariff-meta {
    border-color: #1f2937;
    color: #9ca3af;
}

.rumsoft-tariff-card--postpaid .rumsoft-tariff-meta {
    border-color: #374151;
    color: #d1d5db;
}

.rumsoft-tariff-meta p {
    margin: 0;
}

.rumsoft-tariff-card--postpaid .rumsoft-tariff-meta p + p {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
}

.rumsoft-tariff-meta span {
    font-weight: 700;
}

.rumsoft-tariff-card--postpaid .rumsoft-tariff-meta span:not(.rumsoft-tariff-accent) {
    color: #ffffff;
}

.rumsoft-tariff-accent {
    color: var(--mts-red);
}

.rumsoft-tariff-period {
    margin-top: 0.5rem;
    color: var(--mts-red);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rumsoft-tariff-price-wrap {
    margin-top: auto;
    margin-bottom: 1.5rem;
}

.rumsoft-tariff-price {
    margin: 0;
    color: #111827;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 900;
}

.dark .rumsoft-tariff-price {
    color: #ffffff;
}

.rumsoft-tariff-price--accent {
    color: var(--mts-red);
}

.dark .rumsoft-tariff-price--accent {
    color: var(--mts-red);
}

.rumsoft-tariff-card--postpaid .rumsoft-tariff-price {
    color: #ffffff;
    font-size: 3rem;
    line-height: 1;
    text-shadow: 0 0 32px rgba(255, 0, 0, 0.55);
}

.rumsoft-tariff-action {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 0;
    border-radius: 0.75rem;
    background-color: #f3f4f6;
    color: #111827;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1rem;
    text-transform: uppercase;
    transition: background-color 0.3s ease,
                color 0.3s ease,
                box-shadow 0.3s ease;
}

.dark .rumsoft-tariff-action {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.rumsoft-tariff-action--primary {
    padding: 1rem;
    background-color: var(--mts-red);
    color: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(255, 0, 0, 0.5);
}

.rumsoft-tariff-action:focus-visible {
    outline: 2px solid rgba(255, 13, 13, 0.45);
    outline-offset: 3px;
}

@media (min-width: 640px) {
    .rumsoft-tariff-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rumsoft-tariff-card--postpaid {
        grid-column: span 2 / span 2;
    }
}

@media (min-width: 1024px) {
    .rumsoft-tariff-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .rumsoft-tariff-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rumsoft-tariff-card--postpaid {
        grid-column: 4 / span 1;
        grid-row: 1 / span 2;
    }
}

@media (hover: hover) and (pointer: fine) {
    .rumsoft-tariff-card:hover {
        z-index: 10;
        transform: translateY(-8px);
        border-color: rgba(255, 0, 0, 0.3);
        box-shadow: 0 20px 60px -10px rgba(255, 0, 0, 0.15),
                    0 0 40px rgba(255, 0, 0, 0.1);
    }

    .dark .rumsoft-tariff-card:hover {
        border-color: rgba(255, 0, 0, 0.2);
        box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8),
                    0 0 50px rgba(255, 0, 0, 0.2);
    }

    .rumsoft-tariff-card:hover .rumsoft-tariff-action {
        background-color: var(--mts-red);
        color: #ffffff;
    }

    .rumsoft-tariff-card:hover .rumsoft-tariff-action--primary {
        background-color: var(--mts-red-dark);
        box-shadow: 0 20px 40px -5px rgba(255, 0, 0, 0.7);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rumsoft-tariff-card,
    .rumsoft-tariff-action {
        transition: none;
    }

    .rumsoft-tariff-card:hover {
        transform: none;
    }
}

/* --- Promo Slider Logic --- */
.slider-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 99px;
    transform: translate3d(0,0,0);
}

.progress-active .slider-progress-bar {
    animation: fillProgress 6s linear forwards;
}

@keyframes fillProgress {
    from { width: 0%; }
    to { width: 100%; }
}

.slide-item {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s;
    pointer-events: none;
}

.slide-item.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-mask {
    mask-image: linear-gradient(to right, transparent, black 35%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 35%);
}

/* --- Cinematic Reveal Effects --- */
@keyframes cinematic-word-reveal {
    0% {
        opacity: 0;
        filter: blur(15px);
        transform: scale(1.3) translate3d(0, 20px, 0);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: scale(1) translate3d(0, 0, 0);
    }
}

.cinematic-word {
    opacity: 0; 
    animation: cinematic-word-reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity, filter;
}

/* --- Scroll Entrance Animations --- */
.reveal {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 1s cubic-bezier(0.2, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.reveal-delay-100 { transition-delay: 100ms; }
.reveal-delay-200 { transition-delay: 200ms; }
.reveal-delay-300 { transition-delay: 300ms; }

/* --- UI Motion & Floating (GPU Accelerated) --- */
@keyframes float {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float 6s ease-in-out infinite;
    animation-delay: 3s;
}

/* --- Marquee Component --- */
.marquee-container {
    overflow: hidden;
    display: flex;
    white-space: nowrap;
    position: relative;
    contain: paint; /* Optimization */
}

.marquee-container::before, .marquee-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 10%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--marquee-bg), transparent);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--marquee-bg), transparent);
}

.marquee-content {
    display: flex;
    animation: marquee 40s linear infinite;
    min-width: max-content; 
    will-change: transform;
}

@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* --- Mobile Specific Optimizations --- */
@media (max-width: 768px) {
    .reveal {
        transition-duration: 0.8s; /* Быстрее на мобилках */
    }
    
    /* Уменьшаем количество тяжелых блюров на мобильных */
    .image-mask {
        mask-image: none;
        -webkit-mask-image: none;
        background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    }
}
