/* ===== АНИМАЦИИ И ЭФФЕКТЫ ===== */

/* Прелоадер с анимацией логотипа */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a3c27 0%, #2a6b3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Пыль в прелоадере */
.preloader-dust {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: dustFall 15s infinite linear;
}

.preloader-dust.d1 { width: 2px; height: 2px; top: -10px; left: 10%; animation-delay: 0s; }
.preloader-dust.d2 { width: 3px; height: 3px; top: -10px; left: 30%; animation-delay: 3s; }
.preloader-dust.d3 { width: 2px; height: 2px; top: -10px; left: 50%; animation-delay: 6s; }
.preloader-dust.d4 { width: 4px; height: 4px; top: -10px; left: 70%; animation-delay: 9s; }
.preloader-dust.d5 { width: 3px; height: 3px; top: -10px; left: 90%; animation-delay: 12s; }

@keyframes dustFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.preloader-content {
    text-align: center;
    color: var(--light);
    max-width: 400px;
    position: relative;
    z-index: 3;
}

/* Анимированный логотип DEZON */
.preloader-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    position: relative;
    height: 120px;
    overflow: hidden;
}

.logo-dez, .logo-on {
    display: inline-block;
    position: relative;
    transition: all 0.5s ease;
}

.logo-dez {
    color: #ffffff;
}

.logo-on {
    color: #f9a826;
    margin-left: -5px;
}

/* Анимация вращения всей надписи */
.preloader-logo {
    animation: rotateLogo 2s ease forwards;
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes rotateLogo {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    100% {
        transform: rotateY(360deg) scale(1);
    }
}

/* Пульсация после вращения */
.preloader-logo.pulse {
    animation: pulseLogo 1s ease forwards 2s;
}

@keyframes pulseLogo {
    0% {
        transform: scale(1) translateX(0);
    }
    50% {
        transform: scale(1.1) translateX(5px);
    }
    100% {
        transform: scale(1) translateX(0);
    }
}

/* Движение частей логотипа */
.preloader-logo.separate .logo-dez {
    animation: moveDezBack 0.8s ease forwards 3s;
}

.preloader-logo.separate .logo-on {
    animation: moveOnForward 0.8s ease forwards 3s;
}

@keyframes moveDezBack {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-5px);
    }
}

@keyframes moveOnForward {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(5px);
    }
}

/* Подсветка ON */
.preloader-logo.highlight .logo-on {
    animation: highlightOn 2s ease forwards 3.8s;
}

@keyframes highlightOn {
    0% {
        text-shadow: 0 0 0 rgba(249, 168, 38, 0);
    }
    50% {
        text-shadow: 0 0 20px rgba(249, 168, 38, 0.8), 0 0 30px rgba(249, 168, 38, 0.6);
    }
    100% {
        text-shadow: 0 0 10px rgba(249, 168, 38, 0.4);
    }
}

.preloader-slogan {
    font-size: 1.5rem;
    color: var(--text-light);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    opacity: 0;
    animation: fadeInSlogan 1s ease forwards 5s;
    margin-top: 20px;
}

@keyframes fadeInSlogan {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.preloader-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.preloader-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #f9a826, #ffcc00);
    border-radius: 4px;
    animation: loading 4s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(249, 168, 38, 0.5);
}

@keyframes loading {
    0% { width: 0; }
    30% { width: 30%; }
    60% { width: 70%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

/* Текст под шкалой загрузки */
.preloader-text {
    color: white !important;
    margin-top: 20px;
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
    animation: fadeInText 1s ease forwards 4s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes fadeInText {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 0.9; transform: translateY(0); }
}

/* Параллакс эффект в герое */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-bg-1 {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(42, 107, 63, 0.8) 100%);
}

.hero-bg-2 {
    background-image: url('https://images.unsplash.com/photo-1584467735871-8db9ac8d0916?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
    opacity: 0.3;
    background-size: cover;
    background-position: center;
    filter: blur(1px);
}

.hero-bg-3 {
    background: radial-gradient(circle at 30% 50%, rgba(249, 168, 38, 0.2) 0%, transparent 50%);
}

/* Плавающие элементы */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-element {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.2;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 0;
}

.floating-element.fe-1 {
    animation-delay: 0s;
    animation-duration: 10s;
}

.floating-element.fe-2 {
    animation-delay: 1.5s;
    animation-duration: 12s;
}

.floating-element.fe-3 {
    animation-delay: 3s;
    animation-duration: 9s;
}

.floating-element.fe-4 {
    animation-delay: 4.5s;
    animation-duration: 11s;
}

.floating-element.fe-5 {
    animation-delay: 6s;
    animation-duration: 8s;
}

.floating-element.fe-6 {
    animation-delay: 7.5s;
    animation-duration: 13s;
}

.floating-element.fe-7 {
    animation-delay: 9s;
    animation-duration: 10s;
}

.floating-element.fe-8 {
    animation-delay: 10.5s;
    animation-duration: 11s;
}

.floating-element.fe-9 {
    animation-delay: 12s;
    animation-duration: 9s;
}

.floating-element.fe-10 {
    animation-delay: 13.5s;
    animation-duration: 12s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.2;
    }
    25% { 
        transform: translate(20px, -20px) rotate(5deg) scale(1.1);
        opacity: 0.3;
    }
    50% { 
        transform: translate(-15px, 10px) rotate(-5deg) scale(0.9);
        opacity: 0.25;
    }
    75% { 
        transform: translate(10px, 15px) rotate(3deg) scale(1.05);
        opacity: 0.3;
    }
}

/* Анимация заголовка */
.hero-title-part {
    display: block;
    overflow: hidden;
    margin-bottom: 5px;
}

.hero-title-part span {
    display: inline-block;
    transform: translateY(100%);
    animation: slideUp 0.8s ease forwards;
}

.hero-title-part:nth-child(2) span {
    animation-delay: 0.2s;
}

.hero-title-part:nth-child(3) span {
    animation-delay: 0.4s;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* Кнопки с эффектами */
.btn-pulse {
    position: relative;
    overflow: hidden;
}

.btn-pulse:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-pulse:hover:before {
    width: 300px;
    height: 300px;
}

.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    transition: all 0.6s;
}

.btn-shine:hover:after {
    left: 130%;
}

.btn-bounce {
    animation: bounce 3s ease infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.btn-glow {
    box-shadow: 0 0 20px rgba(42, 107, 63, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(42, 107, 63, 0.5);
    }
    to {
        box-shadow: 0 0 30px rgba(42, 107, 63, 0.8), 0 0 40px rgba(42, 107, 63, 0.6);
    }
}

/* Карточки с 3D эффектом */
.service-card-3d {
    width: 100%;
    height: 350px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border-radius: var(--radius);
}

.service-card-3d:hover {
    transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.service-card-front {
    background: linear-gradient(135deg, var(--light) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: var(--shadow);
    border: 1px solid rgba(42, 107, 63, 0.1);
}

.service-card-back {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--light);
    transform: rotateY(180deg);
    overflow: hidden;
}

.service-card-back h4 {
    color: var(--light);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.service-card-back ul {
    list-style: none;
    margin-bottom: 25px;
    text-align: left;
    width: 100%;
}

.service-card-back li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.service-card-back li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.2rem;
}

.service-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary);
    transition: var(--transition);
}

.service-card-3d:hover .service-icon {
    transform: scale(1.2);
}

.service-card-back .service-icon {
    color: var(--light);
}

/* Стилизованные элементы формы */
.select-animated {
    position: relative;
    background: var(--light);
    border: 2px solid #ddd;
    border-radius: var(--radius);
    padding: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232a6b3f' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.select-animated:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12, 131, 70, 0.1);
    outline: none;
}

.range-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--light);
    border: 3px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.checkbox-modern {
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    user-select: none;
}

.checkbox-modern input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #eee;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.checkbox-modern:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-modern input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-modern input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-modern .checkmark:after {
    left: 9px;
    top: 5px;
    width: 7px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Экономия в калькуляторе */
.result-savings {
    background: rgba(249, 168, 38, 0.1);
    padding: 10px 15px;
    border-radius: var(--radius);
    margin-top: 15px;
    font-size: 0.9rem;
    border-left: 3px solid var(--secondary);
}

.savings-amount {
    color: var(--secondary);
    font-weight: 700;
}

/* Карусель отзывов */
.reviews-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.carousel-container {
    overflow: hidden;
    border-radius: var(--radius);
}

.review-slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.review-slide.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.review-rating {
    color: var(--secondary);
    margin-top: 5px;
    font-size: 0.9rem;
}

.review-service {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gray);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-top: 15px;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.carousel-prev,
.carousel-next {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(42, 107, 63, 0.2);
}

.carousel-prev:hover,
.carousel-next:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(42, 107, 63, 0.3);
}

.carousel-dots {
    display: flex;
    gap: 10px;
}

.carousel-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dots .dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* Анимации при скролле */
.animate-on-scroll.fadeInUp.animated {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-on-scroll.fadeInLeft.animated {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-on-scroll.fadeInRight.animated {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-on-scroll.zoomIn.animated {
    animation: zoomIn 0.8s ease forwards;
}

.animate-on-scroll.slideInLeft.animated {
    animation: slideInLeft 0.8s ease forwards;
}

.animate-on-scroll.slideInRight.animated {
    animation: slideInRight 0.8s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Стили для виджетов услуг */
@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Адаптивность анимаций */
@media (max-width: 768px) {
    .hero-title-part {
        display: inline;
    }
    
    .process-timeline:before {
        left: 25px;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-right: 15px;
    }
    
    .process-step:nth-child(even) .step-number {
        margin-left: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .stats-counter {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .preloader-logo {
        font-size: 3rem;
        height: 100px;
    }
    
    .preloader-slogan {
        font-size: 1.2rem;
    }
    
    .preloader-text {
        font-size: 1rem;
    }
}

/* Отключение некоторых анимаций на мобильных */
@media (max-width: 768px) {
    .service-card-3d {
        transform-style: flat;
        transition: none;
    }
    
    .service-card-3d:hover {
        transform: none;
    }
    
    .service-card-back {
        display: none;
    }
    
    .floating-element {
        display: none;
    }
    
    .bg-particle {
        display: none;
    }
    
    .service-widget__icon {
        animation: floatIcon 2s ease-in-out infinite;
    }
}

/* Исправление контраста для текста в калькуляторе */
.checkbox-text {
    color: var(--text-dark);
}

.range-value {
    color: var(--text-dark);
}

.range-hint {
    color: var(--gray-dark);
}

/* Улучшение видимости текста в калькуляторе */
.form-group label {
    color: var(--text-dark);
}

/* Улучшение видимости текста в checkboxes */
.checkbox-modern .checkbox-text {
    color: var(--text-dark);
}