/* ==========================================================================
   InCloud — общие стили сайта
   Подключается на всех страницах ПОСЛЕ Tailwind:
   <link rel="stylesheet" href="/assets/tailwind.css">
   <link rel="stylesheet" href="/assets/incloud.css">
   <link rel="stylesheet" href="/assets/site.css">
   ========================================================================== */

/* ============ 1. Токены ============
   Design tokens объявлены один раз — в assets/site.css (:root), который
   загружается на всех страницах после этого файла. Здесь они не
   дублируются, чтобы не было конфликтов значений. */

/* ============ 2. База ============ */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    font-feature-settings: "tnum" 0;
    letter-spacing: -0.005em;
}
section[id] { scroll-margin-top: var(--header-height); }

/* ============ 3. Типографическая система ============ */
.eyebrow {
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: var(--color-secondary);
}
.section-title {
    font-size: 1.875rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}
@media (min-width: 768px) { .section-title { font-size: 2.25rem; } }

.section-subtitle {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}
@media (min-width: 768px) { .section-subtitle { font-size: 1.0625rem; } }

.block-title {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-primary);
}
.card-title {
    font-size: 1rem;
    line-height: 1.45;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: .375rem;
}
.card-text {
    font-size: .875rem;
    line-height: 1.65;
    color: var(--color-text-muted);
}

/* ============ 4. Кнопки ============ */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    display: inline-block;
}
.btn.flex { display: flex; }
.btn.inline-flex { display: inline-flex; }

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover { background-color: var(--color-primary-dark); }

.btn-gradient {
    background-image: var(--brand-gradient);
    color: #fff;
    transition: all .25s;
}
.btn-gradient:hover {
    box-shadow: 0 8px 28px rgba(52,152,219,.5);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background-color: var(--color-primary);
    color: #fff;
}

/* ============ 5. Поверхности и границы ============ */
.border-subtle {
    border-color: rgb(177 177 177);
    border-width: 1px;
}
.glass {
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.14);
}

/* ============ 6. Hero ============ */
.hero-gradient {
    background: linear-gradient(135deg, rgb(58 81 103) 20%, rgb(26, 37, 48) 100%);
}
.hero-overlay {
    background: linear-gradient(90deg, rgba(18,29,45,.94) 0%, rgba(26,37,48,.84) 44%, rgba(26,37,48,.35) 100%);
}
.hero-bg { object-position: center; }
@media (min-width: 1024px) { .hero-bg { object-position: center calc(50% - 120px); } }

.grid-glow {
    background-image:
        linear-gradient(rgba(147,197,253,.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(147,197,253,.11) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent);
}
.hero-logo,
.logo-gradient {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-logo { background-image: linear-gradient(135deg, #ffffff, #3498db); }
.logo-gradient { background-image: linear-gradient(135deg, #c6ceff 0%, #51b4ff 100%); }

/* ============ 7. Анимации ============ */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
    70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
}
.pulse-dot { animation: pulse-dot 2s infinite; }

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }
.reveal-d4 { transition-delay: .4s; }
.reveal-d5 { transition-delay: .5s; }

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.server-blink { animation: blink 2s infinite; }
.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1s; }

/* ============ 8. FAQ ============ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.faq-item.active .faq-answer { max-height: 500px; }
.faq-question svg { transition: transform .3s ease; flex-shrink: 0; }
.faq-item.active .faq-question svg { transform: rotate(180deg); }

/* ============ 10. Калькулятор ============ */
.slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    /* Слой 1: градиент до ползунка (ширина через --progress); слой 2: базовый трек */
    background: linear-gradient(317deg, rgb(77 148 235 / 65%) 0%, rgb(108 105 205 / 66%) 100%) 0 / var(--progress, 0%) 100% no-repeat, #e5e7eb;
}
.slider-thumb::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}
.slider-thumb::-moz-range-track {
    height: 6px;
    background: #e5e7eb;
}
.slider-thumb::-moz-range-progress {
    height: 6px;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgb(50 62 75) 0%, rgb(58 81 103) 100%);
}
.slider-thumb::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: rgb(44 62 80);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: -7px;
}
.slider-thumb::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: rgb(44 62 80);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.calc-num-input {
    width: 72px;
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-align: center;
    outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
    -moz-appearance: textfield;
    appearance: textfield;
}
.calc-num-input:hover { background: #fff; border-color: #d1d5db; }
.calc-num-input:focus {
    background: #fff;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}
.calc-num-input::-webkit-outer-spin-button,
.calc-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.preset-pill {
    transition: all 0.2s;
    cursor: pointer;
}
.preset-pill.active {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
}
.preset-pill:hover:not(.active) {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.plan-button.active {
    background: linear-gradient(135deg, #686fd1d9, #3498dbde);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============ 11. Подсказки ============ */
.tooltip {
    position: relative;
    display: inline-flex;
}
.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 220px;
    background-color: var(--color-primary-dark);
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px 10px;
    position: absolute;
    z-index: 20;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Баннер тестового периода (.mt-trial) — в assets/site.css. */

/* ============ 13. Модальные окна ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.modal-backdrop.active { display: flex; }

/* ============ 14. Мобильное меню ============ */
#mobile-menu { transition: opacity 0.3s ease-in-out; }
#mobile-menu.hidden {
    opacity: 0;
    pointer-events: none;
}
#mobile-menu.block {
    opacity: 1;
    pointer-events: auto;
}
#mobile-menu .flex {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
#mobile-menu.block .flex { transform: translateX(0); }

#mobile-menu-button { transition: transform 0.3s ease-in-out; }
#mobile-menu-button:hover { transform: scale(1.05); }
#mobile-menu-close { transition: all 0.3s ease-in-out; }
#mobile-menu-close:hover { transform: scale(1.1); }

/* Блокировка прокрутки при открытом меню */
body.overflow-hidden {
    position: fixed;
    width: 100%;
}

/* ============ 16. Контейнер ============ */
.container-custom {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    .container-custom {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
@media (min-width: 1024px) {
    .container-custom {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}
