:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --accent-color: #f59e0b;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-color: #64748b;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* Базовые стили */
.download-app {
    padding: 3rem 0;
    background: var(--light-color);
    min-height: 70vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--gray-color);
}

/* Карточки */
.app-instructions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.instruction-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.pwa-card {
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.pwa-card::after {
    content: "Рекомендуем";
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--accent-color);
    color: white;
    padding: 3px 30px;
    transform: rotate(45deg);
    font-size: 0.8rem;
}

/* Иконки */
.instruction-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.pwa-card .instruction-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* PWA платформы */
.pwa-platforms {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
    text-align: left;
}

.platform {
    flex: 1;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.platform h4 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.platform ol {
    padding-left: 1.5rem;
    margin: 0;
}

.platform li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Нативные приложения */
.native-apps {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.native-apps .instruction-card {
    flex: 1;
    padding: 1.5rem;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn i {
    margin-right: 0.7rem;
}

/* PWA контент */
.pwa-user-content {
    display: none;
    max-width: 500px;
    margin: 0 auto;
}

.pwa-welcome {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.welcome-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.pwa-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--gray-color);
    font-size: 0.95rem;
}

.feature i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Оверлей установки */
.pwa-install-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: none;
}

.pwa-install-overlay.active {
    transform: translateY(0);
}

.install-progress {
    text-align: center;
}

.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sandglass {
    width: 20px;
    height: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 3px;
    position: relative;
    animation: flip 2s infinite;
}

.sandglass:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--primary-color);
    animation: drain 2s infinite;
}

.progress-text {
    font-weight: 500;
    color: var(--dark-color);
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

/* Анимации */
@keyframes flip {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

@keyframes drain {
    0%, 100% { height: 50%; }
    50% { height: 0%; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .instruction-card {
        padding: 1.5rem;
    }
    
    .pwa-platforms,
    .native-apps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pwa-features {
        grid-template-columns: 1fr;
    }
}

/* PWA-режим */
@media all and (display-mode: standalone) {
    #installInstructions {
        display: none !important;
    }
    #pwaUserContent {
        display: block !important;
    }
    .section-subtitle {
        margin-bottom: 1rem !important;
    }
    
    header, footer, .cookie-banner {
        display: none !important;
    }
    
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        background-color: #fff;
    }
}