/* App download pages (views/app_download_page.php). html.night-mode comes from js/night-mode.js. */

:root {
    --dl-bg: #f5f7f9;
    --dl-card: #ffffff;
    --dl-border: #e6e9ee;
    --dl-text: #181b20;
    --dl-muted: #68707d;
    --dl-brand: var(--shows-primary, #df640f);
    --dl-brand-strong: var(--shows-primary-hover, #b84f08);
    --dl-brand-soft: var(--shows-primary-soft, #fff0e3);
    --dl-store-bg: #111315;
    --dl-store-text: #ffffff;
    --dl-shadow: 0 24px 60px rgba(20, 27, 38, 0.1);
    --dl-glow: color-mix(in srgb, var(--shows-primary) 16%, transparent);
    color-scheme: light;
}

html.night-mode {
    --dl-bg: #111315;
    --dl-card: #1a1d1f;
    --dl-border: #2b3035;
    --dl-text: #f3f4f6;
    --dl-muted: #a1a1aa;
    --dl-brand: var(--shows-primary, #f47b28);
    --dl-brand-strong: var(--shows-primary-hover, #ff9a52);
    --dl-brand-soft: var(--shows-primary-soft, #382216);
    --dl-store-bg: #f3f4f6;
    --dl-store-text: #111315;
    --dl-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --dl-glow: color-mix(in srgb, var(--shows-primary) 18%, transparent);
    color-scheme: dark;
}

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

body.dl-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(760px 380px at 50% -120px, var(--dl-glow), transparent 70%), var(--dl-bg);
    color: var(--dl-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* ---------- Header ---------- */

.dl-top {
    display: flex;
    justify-content: center;
    padding: 28px 16px 8px;
}

.dl-brand img {
    display: block;
    height: 34px;
    width: auto;
}

/* Scoped under .dl-brand so these outrank ".dl-brand img { display: block }";
   otherwise both logos show in light mode. */
.dl-brand .dl-brand__night,
html.night-mode .dl-brand .dl-brand__day {
    display: none;
}

html.night-mode .dl-brand .dl-brand__night {
    display: block;
}

.dl-brand:focus-visible,
.dl-store:focus-visible,
.dl-other:focus-visible,
.dl-home:focus-visible {
    outline: 2px solid var(--dl-brand);
    outline-offset: 3px;
}

/* ---------- Main card ---------- */

.dl-main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.dl-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: center;
    padding: 36px;
    border: 1px solid var(--dl-border);
    border-radius: 24px;
    background: var(--dl-card);
    box-shadow: var(--dl-shadow);
}

.dl-app-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--dl-brand) 80%, #ffffff), var(--dl-brand) 55%, var(--dl-brand-strong));
    color: #fff;
    font-size: 28px;
    box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--shows-primary) 90%, transparent);
}

.dl-card--scanner .dl-app-icon {
    background: linear-gradient(135deg, #27272a, #111315);
    box-shadow: 0 14px 30px -14px rgba(17, 19, 21, 0.9);
}

html.night-mode .dl-card--scanner .dl-app-icon {
    background: linear-gradient(135deg, #3f3f46, #27272a);
}

.dl-card h1 {
    margin: 0 0 8px;
    color: var(--dl-text);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.dl-lead {
    margin: 0;
    max-width: 380px;
    color: var(--dl-muted);
    font-size: 16px;
    line-height: 1.6;
}

.dl-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.dl-store {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 10px 20px;
    border-radius: 14px;
    background: var(--dl-store-bg);
    color: var(--dl-store-text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.dl-store i {
    font-size: 22px;
}

.dl-store:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* The QR code is for visitors on a computer; phones are sent to their store. */
.dl-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--dl-border);
    border-radius: 18px;
    background: var(--dl-bg);
}

.dl-qr img {
    display: block;
    width: 168px;
    height: 168px;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    image-rendering: pixelated;
}

.dl-qr figcaption {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 168px;
    color: var(--dl-muted);
    font-size: 13px;
    text-align: center;
}

/* ---------- Other app and home ---------- */

.dl-other {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--dl-border);
    border-radius: 18px;
    background: var(--dl-card);
    color: var(--dl-text);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.dl-other:hover {
    border-color: var(--dl-brand);
}

.dl-other__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--dl-brand-soft);
    color: var(--dl-brand);
    font-size: 19px;
}

.dl-other__copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.dl-other__name {
    font-size: 15px;
    font-weight: 600;
}

.dl-other__text {
    color: var(--dl-muted);
    font-size: 14px;
}

.dl-other__arrow {
    color: var(--dl-muted);
    transition: color 0.15s ease, transform 0.15s ease;
}

.dl-other:hover .dl-other__arrow {
    color: var(--dl-brand);
    transform: translateX(3px);
}

.dl-home {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--dl-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.dl-home:hover {
    color: var(--dl-text);
}

/* ---------- Phones ---------- */

@media (max-width: 640px) {
    .dl-main {
        justify-content: flex-start;
    }

    .dl-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 22px;
        text-align: center;
    }

    .dl-app-icon {
        margin-right: auto;
        margin-left: auto;
    }

    .dl-lead {
        margin: 0 auto;
    }

    .dl-stores {
        flex-direction: column;
    }

    .dl-store {
        justify-content: center;
        width: 100%;
    }

    .dl-qr {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dl-page * {
        transition: none !important;
    }
}
