/*
 * Download page (services/download app/download_app.html).
 * Same palette and type as the home page: blues #2563eb / #1e40af,
 * gradient #667eea → #764ba2, Inter.
 */

:root {
    --blue: #2563eb;
    --blue-dark: #1e40af;
    --violet-a: #667eea;
    --violet-b: #764ba2;
    --grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-blue: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --ink: #0f172a;
    --text: #1f2937;
    --muted: #64748b;
    --line: rgba(37, 99, 235, 0.12);
    --surface: #f8fafc;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 40px -18px rgba(37, 99, 235, 0.28);
    --ring: var(--blue);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    color: var(--text);
    background: #ffffff;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, p {
    margin: 0;
}

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- Focus */
:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 3px;
}

.hero,
.cta-band,
.site-foot {
    --ring: #ffffff;
}

.navbar .nav-cta:focus-visible {
    outline-color: var(--blue);
}

/* Loader: shared/components/loader.css (same as the home page) */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --------------------------------------------------------------- Hero */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #ffffff;
    background: var(--grad);
    padding: clamp(110px, 14vw, 140px) 0 clamp(4rem, 9vw, 7rem);
}

.hero-light {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.hero-light span {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
}

.hero-light span:nth-child(1) {
    width: 46vmax;
    height: 46vmax;
    left: -14vmax;
    top: -18vmax;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.9), transparent 65%);
    animation: drift-a 30s ease-in-out infinite alternate;
}

.hero-light span:nth-child(2) {
    width: 40vmax;
    height: 40vmax;
    right: -14vmax;
    bottom: -20vmax;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.8), transparent 65%);
    animation: drift-b 36s ease-in-out infinite alternate;
}

@keyframes drift-a {
    to { transform: translate(12vmax, 8vmax) scale(1.15); }
}

@keyframes drift-b {
    to { transform: translate(-10vmax, -8vmax) scale(1.2); }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.app-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 8px;
    margin-bottom: 1.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 0.92rem;
    font-weight: 600;
}

.app-chip img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #ffffff;
    padding: 4px;
}

.hero h1 {
    font-size: clamp(2.2rem, 1.2rem + 3.8vw, 3.9rem);
    line-height: 1.07;
    letter-spacing: -0.03em;
    font-weight: 800;
    text-wrap: balance;
}

.hero .lead {
    margin-top: 1.25rem;
    max-width: 32em;
    font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
}

.download-block {
    margin-top: 2.25rem;
}

/* Store badges: black, like the official Google Play / App Store badges */
.store-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.store-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    min-height: 62px;
    padding: 10px 22px 10px 16px;
    border-radius: 16px;
    background: #0b0b0f;
    color: #ffffff;
    text-decoration: none;
    text-align: start;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.75);
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease, background-color 0.25s ease;
}

.store-btn:hover {
    transform: translateY(-3px);
    background: #000000;
    box-shadow: 0 26px 50px -18px rgba(15, 23, 42, 0.8);
}

.store-btn:active {
    transform: translateY(-1px) scale(0.99);
}

.store-logo {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
}

i.store-logo {
    display: grid;
    place-items: center;
    font-size: 2rem;
    line-height: 1;
}

.store-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.store-small {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.78);
}

.store-big {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* "Pour vous" (visitor's platform) / "Bientôt" (not published yet) */
.store-pill {
    display: none;
    position: absolute;
    top: -10px;
    inset-inline-end: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    color: #ffffff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 6px 14px -6px rgba(5, 150, 105, 0.8);
}

.store-btn.is-mine .store-pill,
.store-btn.is-soon .store-pill {
    display: block;
}

.store-btn.is-mine {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.55),
        0 18px 40px -18px rgba(15, 23, 42, 0.75);
}

.store-btn.is-soon {
    background: rgba(11, 11, 15, 0.55);
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: none;
}

.store-btn.is-soon:hover {
    transform: none;
    background: rgba(11, 11, 15, 0.65);
}

.store-btn.is-soon .store-pill {
    color: var(--ink);
    background: #fde68a;
    box-shadow: none;
}

.store-btn.is-nudge {
    animation: nudge 0.45s ease;
}

@keyframes nudge {
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.dl-status {
    margin-top: 1rem;
    min-height: 1.5em;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.92);
}

.dl-status.is-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 34em;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.28);
    text-align: start;
}

.dl-status.is-info i {
    font-size: 1.1rem;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 1.75rem;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
}

.facts li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.facts i {
    color: #c7d2fe;
}

/* ---------------------------------------------------- Phone mock-up */
.device-wrap {
    position: relative;
    display: grid;
    place-items: center;
    perspective: 1200px;
}

.device-wrap::before {
    content: "";
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%);
    filter: blur(10px);
}

.device {
    position: relative;
    width: min(300px, 78vw);
    aspect-ratio: 9 / 19;
    padding: 12px;
    border-radius: 46px;
    background: #0f172a;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.08),
        0 50px 90px -30px rgba(15, 23, 42, 0.7);
    animation: float 9s ease-in-out infinite;
}

.device::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 50%;
    width: 30%;
    height: 22px;
    border-radius: 999px;
    background: #0f172a;
    transform: translateX(-50%);
    z-index: 2;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-14px) rotate(0deg); }
}

.screen {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 36px;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 45%);
    display: flex;
    flex-direction: column;
    padding: 58px 16px 18px;
    gap: 12px;
    color: var(--text);
}

.screen-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.screen-top img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.4);
}

.screen-top .s-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}

.screen-top .s-sub {
    font-size: 0.7rem;
    color: var(--muted);
}

.call-card {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--grad);
    display: grid;
    place-items: center;
    color: #ffffff;
}

.call-card .avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: pulse-ring 2.6s ease-out infinite;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
    100% { box-shadow: 0 0 0 22px rgba(255, 255, 255, 0); }
}

.call-card .timer {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.3);
}

.call-card .self {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 58px;
    height: 76px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.call-controls span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: var(--blue);
    box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.45);
}

.call-controls span.end {
    background: #ef4444;
    color: #ffffff;
}

.float-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 18px 36px -16px rgba(15, 23, 42, 0.5);
    animation: float 8s ease-in-out infinite;
}

.float-badge i {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--grad-blue);
}

/* anchored to the phone, just outside its edges */
.float-badge {
    z-index: 3;
    white-space: nowrap;
}

.float-badge.b1 {
    top: 20%;
    right: calc(100% - 28px);
    animation-delay: -2s;
}

.float-badge.b2 {
    bottom: 22%;
    left: calc(100% - 28px);
    animation-delay: -5s;
}

.float-badge.b2 i {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* --------------------------------------------------------- Sections */
.section {
    padding: clamp(4rem, 9vw, 6.5rem) 0;
}

.section-head {
    max-width: 640px;
    margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
}

.section-head h2 {
    font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

.section-head p {
    margin-top: 0.85rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.features {
    background: var(--surface);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
}

.feature {
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), box-shadow 0.35s ease;
}

.feature:hover {
    transform: translateY(-6px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 26px 50px -20px rgba(37, 99, 235, 0.35);
}

.feature .f-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: #ffffff;
    background: var(--grad);
    margin-bottom: 1.1rem;
    box-shadow: 0 12px 24px -12px rgba(118, 75, 162, 0.7);
}

.feature:nth-child(2) .f-icon {
    background: var(--grad-blue);
}

.feature:nth-child(3) .f-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.feature h3 {
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.feature p {
    color: var(--muted);
    font-size: 0.97rem;
}

/* Install steps: a real sequence, so numbered */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    counter-reset: step;
    padding: 0;
    margin: 0;
    list-style: none;
}

.step {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2rem);
    padding-top: 3.4rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #ffffff;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 1.25rem;
    inset-inline-start: clamp(1.5rem, 3vw, 2rem);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #ffffff;
    background: var(--grad-blue);
}

/* connector between steps on wide screens */
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(1.25rem + 17px);
    inset-inline-start: calc(clamp(1.5rem, 3vw, 2rem) + 46px);
    inset-inline-end: -1.5rem;
    height: 2px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0));
}

[dir="rtl"] .step:not(:last-child)::after {
    background: linear-gradient(270deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0));
}

.step h3 {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.step p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Desktop: scan to open the page on the phone */
.qr-card {
    margin: 1.75rem auto 0;
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #eff6ff;
}

.qr-card[hidden] {
    display: none;
}

.qr-box {
    flex-shrink: 0;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.qr-box img,
.qr-box canvas {
    width: 132px;
    height: 132px;
}

.qr-copy h3 {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.35rem;
}

.qr-copy p {
    color: var(--blue-dark);
    font-size: 0.95rem;
}

/* ------------------------------------------------------ CTA band */
.cta-band {
    /* same width as the content column (.wrap), minus its gutters */
    width: calc(min(1180px, 100%) - 2 * var(--gutter));
    margin: 0 auto clamp(3rem, 7vw, 5rem);
    border-radius: 32px;
    padding: clamp(2rem, 5vw, 3.25rem);
    background: var(--grad);
    color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.cta-band::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -100px;
    top: -140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 65%);
    z-index: -1;
}

.cta-band h2 {
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 22em;
}

.cta-band p {
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.88);
}

.cta-band .store-row {
    flex-shrink: 0;
}

/* ------------------------------------------------------------ Footer */
.site-foot {
    background: #1f2937;
    color: #cbd5e1;
    padding: 1.75rem 0;
    font-size: 0.9rem;
}

.site-foot .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.site-foot a {
    color: #e2e8f0;
    text-decoration: none;
}

.site-foot a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.site-foot nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

/* ------------------------------------------------------------ Reveal */
.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.hero .enter {
    animation: rise 1.1s var(--ease) backwards;
    animation-delay: var(--d, 0s);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
}

html.is-loading .hero .enter,
html.is-loading .device,
html.is-loading .float-badge {
    animation-play-state: paused;
}

/* -------------------------------------------------------- Responsive */
@media (max-width: 960px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero .lead {
        margin-inline: auto;
    }

    .store-row,
    .facts {
        justify-content: center;
    }

    .device-wrap {
        margin-top: 1rem;
    }

    .feature-grid,
    .steps {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin-inline: auto;
    }

    .step:not(:last-child)::after {
        display: none;
    }

    .cta-band {
        justify-content: center;
        text-align: center;
    }

    .cta-band .store-row {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .float-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .store-row {
        flex-direction: column;
        align-items: stretch;
        max-width: 320px;
        margin-inline: auto;
    }

    .store-btn {
        justify-content: center;
    }

    .qr-card {
        flex-direction: column;
        text-align: center;
    }

    .device {
        width: min(260px, 74vw);
    }

    .site-foot .wrap {
        justify-content: center;
        text-align: center;
    }
}

/* --------------------------------------------------------------- RTL */
[dir="rtl"] .app-chip {
    padding: 8px 8px 8px 16px;
}

[dir="rtl"] .store-btn {
    padding: 10px 16px 10px 22px;
}

[dir="rtl"] .call-card .timer {
    left: auto;
    right: 12px;
}

[dir="rtl"] .call-card .self {
    right: auto;
    left: 10px;
}

[dir="rtl"] .float-badge.b1 {
    right: auto;
    left: calc(100% - 28px);
}

[dir="rtl"] .float-badge.b2 {
    left: auto;
    right: calc(100% - 28px);
}

[dir="rtl"] .cta-band::before {
    right: auto;
    left: -100px;
}

/* ---------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-light span,
    .device,
    .float-badge,
    .call-card .avatar,
    .store-btn.is-nudge,
    .hero .enter {
        animation: none !important;
    }

    .js .reveal {
        transform: none !important;
        transition: opacity 0.6s ease !important;
    }

    .feature:hover,
    .store-btn:hover {
        transform: none;
    }
}
