/* =========================================================================
   store.easytrack.ch — page de téléchargement
   ========================================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0b1220;
    color: #e2e8f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ---------- Background ---------- */
.bg-gradient {
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,0.25), transparent 60%),
        radial-gradient(1000px 500px at 100% 100%, rgba(168,85,247,0.18), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 50%, #0b1220 100%);
}
.bg-blob {
    position: fixed; z-index: -1; border-radius: 50%; filter: blur(80px);
    opacity: 0.4; pointer-events: none;
}
.bg-blob-1 { top: -100px; left: -100px; width: 380px; height: 380px; background: #3B82F6; }
.bg-blob-2 { bottom: -120px; right: -120px; width: 420px; height: 420px; background: #8B5CF6; }

/* ---------- Layout ---------- */
.page {
    max-width: 480px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 28px;
}
@media (min-width: 768px) {
    .page { max-width: 540px; padding: 56px 24px 100px; gap: 36px; }
}

/* ---------- Brand ---------- */
.brand { display: flex; justify-content: center; }
.brand-link {
    display: flex; align-items: center; gap: 12px;
    color: white; text-decoration: none;
}
.brand-logo {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(59,130,246,0.35);
}
.brand-logo svg { width: 26px; height: 26px; }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Card ---------- */
.card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 28px;
    padding: 36px 28px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
}
@media (min-width: 768px) { .card { padding: 44px 36px; } }

.card-head { text-align: center; margin-bottom: 28px; }

.badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: #93C5FD;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    margin-bottom: 18px;
}
.badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #60A5FA;
    box-shadow: 0 0 8px #60A5FA;
    animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

.title {
    font-size: 26px; font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 10px;
}
@media (min-width: 768px) { .title { font-size: 30px; } }

.subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}

/* ---------- CTA stack ---------- */
.cta-stack {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 28px;
}

.btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px 22px;
    border: none; border-radius: 14px;
    font-family: inherit;
    font-weight: 700; font-size: 15px;
    cursor: pointer; text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    box-shadow: 0 8px 24px rgba(59,130,246,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(59,130,246,0.45); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-store {
    padding: 14px 22px;
    gap: 14px;
}
.btn-store span {
    display: flex; flex-direction: column;
    align-items: flex-start; text-align: left;
    line-height: 1.15;
}
.btn-store small { font-size: 11px; font-weight: 500; opacity: 0.85; }
.btn-store strong { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

.btn-store-sm {
    padding: 12px 18px;
    font-size: 14px;
}

.store-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- QR inline (desktop) ---------- */
.qr-block {
    display: flex; align-items: center; gap: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 18px;
}
.qr-block-text strong {
    display: block; font-size: 15px; color: white; margin-bottom: 4px;
}
.qr-block-text p { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.4; }
.qr-block-img {
    flex-shrink: 0;
    background: white; border-radius: 12px; padding: 8px;
    line-height: 0;
}
.qr-block-img canvas { display: block; width: 100px; height: 100px; }
@media (min-width: 768px) {
    .qr-block-img canvas { width: 120px; height: 120px; }
}

/* ---------- Features ---------- */
.features {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.feature {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px;
    font-size: 11px; font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-align: center;
}
.feature svg { width: 20px; height: 20px; color: #60A5FA; }

/* ---------- Footer ---------- */
.foot {
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    flex-wrap: wrap;
}
.foot a { color: rgba(255,255,255,0.5); text-decoration: none; }
.foot a:hover { color: white; }

/* ---------- QR FAB (toujours visible) ---------- */
.qr-fab {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    border-radius: 14px;
    font-family: inherit; font-weight: 600; font-size: 13px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 0.15s, background 0.15s;
    z-index: 10;
}
.qr-fab:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); }
.qr-fab svg { width: 18px; height: 18px; }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}
.modal-card {
    position: relative;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 440px; width: 100%;
    text-align: center;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute; top: 14px; right: 14px;
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.06);
    border: none; border-radius: 10px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: white; }
.modal-card h2 {
    font-size: 22px; font-weight: 800; color: white;
    margin-bottom: 8px; padding-right: 28px;
    letter-spacing: -0.02em;
}
.modal-card > p {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}
.qr-wrap {
    background: white;
    border-radius: 18px;
    padding: 18px;
    margin: 0 auto 24px;
    width: fit-content;
    line-height: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.qr-wrap canvas { display: block; max-width: 100%; height: auto; }
.modal-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-bottom: 16px;
}
.modal-actions .btn { padding: 12px 14px; font-size: 13px; }
.modal-actions .btn-primary { grid-column: 1 / -1; padding: 14px; font-size: 14px; }
.url-row {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    word-break: break-all;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; top: 24px; left: 50%;
    transform: translateX(-50%);
    background: #16a34a; color: white;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 30px rgba(22,163,74,0.4);
    z-index: 200;
    animation: toastIn 0.25s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
