/* Fenêtre de présentation de l'application mobile (page d'accueil et tableau de bord), avec son
   aperçu en grand des captures. Contenu et comportement : scripts/app-mobile.js ; un élément
   .open-app-mobile de la page ouvre la fenêtre. */

.modal-app-mobile-styled {
    border-radius: 20px !important;
    width: 92% !important;
    max-width: 820px !important;
    max-height: 90dvh !important;
}

.modal-app-mobile-styled .modal-content {
    padding: 28px 24px 20px !important;
}

.app-mobile-close {
    position: absolute;
    top: 12px;
    right: 14px;
    color: #607d8b !important;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
}

.app-mobile-close:hover {
    background: rgba(0, 0, 0, .06);
}

.app-mobile-close .material-icons {
    font-size: 20px;
    display: block;
}

.app-mobile-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 28px;
}

.app-mobile-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-mobile-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #1a237e;
}

.app-mobile-sub {
    margin: 0;
    font-size: 14px;
    color: #4a5a6e;
}

.app-mobile-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 18px;
}

.app-mobile-store {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 14px;
    border-radius: 10px;
    line-height: 1.15;
}

.app-mobile-store svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.app-mobile-store span {
    display: flex;
    flex-direction: column;
    font-size: 17px;
    font-weight: 600;
}

.app-mobile-store small {
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.app-mobile-store-play {
    background: #000;
    color: #fff;
    transition: transform .15s, box-shadow .15s;
}

.app-mobile-store-play:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.app-mobile-store-soon {
    background: #eef1f4;
    color: #607d8b;
    border: 1px dashed #b0bec5;
}

.app-mobile-store-soon span {
    font-size: 14px;
}

.app-mobile-gallery {
    position: relative;
}

.app-mobile-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Marge pour le zoom + halo de l'animation de la première vignette (sinon coupés par le défilement),
       compensée par la marge négative pour garder l'alignement avec le reste de la fenêtre. */
    padding: 12px 12px 14px;
    margin: -8px -12px 0;
    scroll-padding-left: 12px;
    scrollbar-width: thin;
}

.app-mobile-slide {
    flex: 0 0 auto;
    width: 170px;
    margin: 0;
    scroll-snap-align: start;
    text-align: center;
}

.app-mobile-slide img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35);
    cursor: zoom-in;
}

.app-mobile-slide figcaption {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #37474f;
}

.app-mobile-nav {
    position: absolute;
    top: calc(50% - 16px);
    transform: translateY(-50%);
    z-index: 1;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: #1b3446;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.app-mobile-prev {
    left: -6px;
}

.app-mobile-next {
    right: -6px;
}

@media (max-width: 600px) {
    .modal-app-mobile-styled .modal-content {
        padding: 22px 16px 16px !important;
    }

    .app-mobile-logo {
        display: none;
    }

    .app-mobile-title {
        font-size: 18px;
    }

    .app-mobile-slide {
        width: 150px;
    }

    /* Sur téléphone, on fait défiler au doigt. */
    .app-mobile-nav {
        display: none;
    }
}

/* Tag « Nouveau » de l'application mobile (bouton du bandeau et titre de la fenêtre). */
.app-mobile-new {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.5;
    vertical-align: middle;
}

/* Aperçu en grand ouvert par-dessus la présentation : la fenêtre du dessous s'assombrit et ses
   flèches disparaissent, pour ne pas faire doublon avec celles de l'aperçu. */
body:has(#modal-app-mobile-preview.open) #modal-app-mobile {
    filter: brightness(.4);
}

body:has(#modal-app-mobile-preview.open) .app-mobile-nav {
    visibility: hidden;
}

/* Vignette de l'écran d'accueil qui pulse 1,5 s à l'ouverture de la présentation, juste avant de
   s'afficher en grand (voir index.js). */
.app-mobile-slide img.app-mobile-attention {
    animation: app-mobile-attention .75s ease-in-out 2;
}

@keyframes app-mobile-attention {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35), 0 0 0 0 rgba(255, 202, 40, 0);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .45), 0 0 0 5px rgba(255, 202, 40, .9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-mobile-slide img.app-mobile-attention {
        animation: none;
    }
}

/* ── Aperçu en grand d'une capture ──────────────────────────
   Même principe que #modal-screenshot de la page d'accueil : la fenêtre Materialize devient une
   boîte transparente qui centre l'image à son propre ratio (au lieu de l'étirer). */
#modal-app-mobile-preview {
    background: transparent;
    box-shadow: none;
    overflow: visible;
    height: auto;
    max-height: 80dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-app-mobile-preview .modal-content {
    position: static;
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 80dvh;
    padding: 0;
    line-height: 0;
}

#modal-app-mobile-preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80dvh;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .55);
}

.app-mobile-preview-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1004;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(0, 0, 0, .45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-mobile-preview-nav:hover {
    background: rgba(0, 0, 0, .65);
}

.app-mobile-preview-prev {
    left: 18px;
}

.app-mobile-preview-next {
    right: 18px;
}

@media (max-width: 560px) {
    .app-mobile-preview-nav {
        width: 38px;
        height: 38px;
    }

    .app-mobile-preview-prev {
        left: 6px;
    }

    .app-mobile-preview-next {
        right: 6px;
    }
}

/* Titre et numéro de la capture affichée (« Pointage  2 / 9 »), sous l'image : l'image laisse sa place dans les 80dvh. */
#modal-app-mobile-preview img {
    max-height: calc(80dvh - 40px);
}

.app-mobile-preview-caption {
    display: table;
    margin: 12px auto 0;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.app-mobile-preview-count {
    margin-left: 10px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .03em;
    color: rgba(255, 255, 255, .7);
}

/* Flèches en position fixe : à masquer explicitement tant que l'aperçu est fermé. */
#modal-app-mobile-preview:not(.open) .app-mobile-preview-nav {
    display: none;
}

/* ─── Bandeau « Application mobile » (tableau de bord, /pointage, formulaires de feuilles) ─── */

.app-mobile-banner-row {
    padding: 0 16px;
    max-width: 1280px;
    margin: 0 auto 8px;
}

.app-mobile-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #1b3446 0%, #2f6f8f 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.app-mobile-banner:hover,
.app-mobile-banner:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.app-mobile-banner-android {
    width: 30px;
    height: 30px;
    color: #3ddc84;
    flex-shrink: 0;
}

.app-mobile-banner-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-mobile-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.app-mobile-banner-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
}

.app-mobile-banner-cta {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #23324a;
    background: linear-gradient(135deg, #ffca28, #ffa000);
}

.app-mobile-banner-cta .material-icons {
    font-size: 20px;
}

@media (max-width: 600px) {
    .app-mobile-banner-cta {
        display: none;
    }
}

/* Dans les formulaires de feuilles (feuille, individuelle, chauffeur) : en tête du formulaire. */
.app-mobile-banner-form {
    margin: 4px 0 12px;
}
