/* iCan CGM App — страница приложения */

.page-app .main-header .logo {
    display: block;
}

.page-app .main-header .logo img {
    height: 32px;
}

/* app-section — баннер во всю ширину (переопределяем .app-section из style.css) */
.page-app {
    overflow-x: hidden;
}

.app-section.app-banner {
    position: relative;
    width: 100vw;
    max-width: none;
    margin: 0;
    margin-left: calc(50% - 50vw);
    padding: 0;
    overflow: hidden;
}

.app-banner__picture {
    display: block;
    width: 100%;
    line-height: 0;
}

.app-banner__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@media (min-width: 769px) {
    .app-banner__img {
        width: 100%;
        aspect-ratio: 2 / 1;
        object-position: center;
    }
}

@media (max-width: 768px) {
    .app-section.app-banner {
        border-radius: 20px;
    }

    .app-banner__img {
        aspect-ratio: 3 / 4;
        object-position: center;
        border-radius: 20px;
    }
}

/* Текстовая область слева */
.app-banner__content {
    position: absolute;
    left: 6%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    max-width: 45%;
    z-index: 2;
}

.app-banner__logo {
    height: 52px;
    width: auto;
    max-height: 52px;
    margin-bottom: 20px;
    flex-shrink: 0;
    object-fit: contain;
    object-position: left top;
    opacity: 0;
    transform: translateY(20px);
    animation: app-fade-slide-up 0.8s ease-out 0.2s forwards;
}

.app-banner__tagline {
    margin: 0;
    font-size: clamp(15px, 1.8vw, 20px);
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    max-width: 480px;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    animation: app-fade-slide-up 0.8s ease-out 0.5s forwards;
}

@keyframes app-fade-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .app-banner__content {
        left: 5%;
        top: 18%;
        transform: none;
        max-width: 90%;
    }

    .app-banner__logo {
        height: 40px;
        max-height: 40px;
        margin-bottom: 14px;
    }

    .app-banner__tagline {
        font-size: clamp(14px, 4vw, 16px);
        max-width: 100%;
    }
}

/* app-card — анимация slide up */
.page-app .app-card {
    opacity: 0;
    transform: translateY(24px);
    animation: app-card-slide-up 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.page-app .app-card--top-left { animation-delay: 0.15s; }
.page-app .app-card--top-right { animation-delay: 0.3s; }
.page-app .app-card--bottom-left { animation-delay: 0.45s; }
.page-app .app-card--bottom-right { animation-delay: 0.6s; }

@keyframes app-card-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .page-app .app-section--showcase .app-card:nth-child(2) { animation-delay: 0.15s; }
    .page-app .app-section--showcase .app-card:nth-child(3) { animation-delay: 0.25s; }
    .page-app .app-section--showcase .app-card:nth-child(4) { animation-delay: 0.35s; }
    .page-app .app-section--showcase .app-card:nth-child(5) { animation-delay: 0.45s; }
}

/* Блок «Мгновенные данные о глюкозе» */
.app-section.app-data {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.app-data {
    position: relative;
    background-image: url('assets/img/app-item-2-canvas.png');
    background-position: bottom center;
    background-repeat: no-repeat;
    background-size: 100% auto;
}

.app-data__text {
    flex: 1;
    text-align: center;
    align-self: center;
}

.app-data__title {
    font-size: clamp(22px, 2.5vw, 28px);
    color: #333;
    margin: 0 0 24px 0;
}

.app-data__wrap {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
}

.app-data__phone {
    flex: 0 0 280px;
}

.app-data__img {
    width: 100%;
    height: auto;
    display: block;
}

.app-data__list {
    margin: 0;
    padding: 0 40px 0 0;
    list-style: none;
    text-align: left;
}

.app-data__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #444;
    line-height: 1.4;
}

.app-data__item:last-child {
    margin-bottom: 0;
}

.app-data__letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgb(193, 25, 32);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .app-data__wrap {
        flex-direction: column;
        gap: 32px;
    }

    .app-data__phone {
        flex: none;
        width: min(280px, 70vw);
    }
}

/* Блок «Ежедневная запись событий» — текст слева, картинка справа */
.app-section.app-events {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 50px 0;
}

.app-events__wrap {
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-events__text {
    flex: 1;
    text-align: left;
}

.app-events__title {
    font-size: clamp(22px, 2.5vw, 28px);
    color: #333;
    margin: 0 0 16px 0;
}

.app-events__desc {
    margin: 0 0 24px 0;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #555;
    line-height: 1.5;
}

.app-events__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-events__list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #444;
    line-height: 1.4;
}

.app-events__list li::before {
    content: '—';
    position: absolute;
    left: 0;
}

.app-events__list li:last-child {
    margin-bottom: 0;
}

.app-events__img-wrap {
    flex: 0 0 400px;
}

.app-events__img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 768px) {
    .app-events__wrap {
        flex-direction: column-reverse;
        gap: 32px;
    }

    .app-events__img-wrap {
        flex: none;
        width: min(360px, 85vw);
    }
}

/* Блок «Скачать приложение» */
.app-section.app-download {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 50px 0;
}

.app-download__wrap {
    display: flex;
    align-items: center;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-download__icon-wrap {
    flex: 0 0 120px;
}

.app-download__icon {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 24px;
}

.app-download__content {
    flex: 1;
    text-align: left;
}

.app-download__title {
    font-size: clamp(22px, 2.5vw, 28px);
    color: #333;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.app-download__desc {
    margin: 0 0 24px 0;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #666;
    line-height: 1.5;
}

.app-download__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.app-download__badge {
    display: block;
}

.app-download__badge img {
    height: 44px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .app-download__wrap {
        flex-direction: column;
        gap: 32px;
    }

    .app-download__icon-wrap {
        flex: none;
        width: 100px;
    }
}

/* Полезные ссылки, документы и руководства */
.app-section.app-links,
.app-links {
    margin-top: 50px;
}

.app-links {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    padding: 48px 40px;
}

.app-links__title {
    font-size: clamp(22px, 2.5vw, 26px);
    color: #1e293b;
    margin: 0 0 32px 0;
    font-weight: 700;
    text-align: center;
}

.app-links__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
}

.app-links__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.app-links__item:hover {
    background: #fff;
    color: #0ea5e9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
    transform: translateX(4px);
}

.app-links__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 10px;
    color: #fff;
}

.app-links__item:hover .app-links__icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.app-links__icon svg {
    width: 22px;
    height: 22px;
}

.app-links__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.app-links__item:hover .app-links__badge {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.15);
}

@media (max-width: 768px) {
    .app-links {
        padding: 32px 20px;
    }

    .app-links__item {
        padding: 14px 16px;
        font-size: 14px;
    }

    .app-links__icon {
        width: 40px;
        height: 40px;
    }

    .app-links__icon svg {
        width: 20px;
        height: 20px;
    }
}
