﻿@import url('./tokens.css');

@font-face {
    font-family: satoshiRegularFont;
    src: url(../fonts/font-1.woff2) format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: satoshiBoldFont;
    src: url(../fonts/font-3.woff2) format("woff2");
    font-weight: 600;
    font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body {
    font-family: var(--font-reg);
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }

.install-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
    overflow: hidden;
}

.install-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
    pointer-events: none;
}

.install-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease both;
}

.install-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 32px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--accent-outline);
}

.install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.install-logo {
    display: block;
    margin: 0 auto 32px;
    color: var(--accent);
    height: 24px;
    width: auto;
}

.install-headline {
    font-family: var(--font-bold);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.install-headline .green { color: var(--accent); }

/* Desktop QR gate: no .install-sub paragraph — keep breathing room before QR */
.install-headline--desktop-gate {
    margin-bottom: 28px;
}

.install-sub {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.install-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 44px;
    flex-wrap: wrap;
}

.install-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.install-feature-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.install-feature-label {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Install button (for Android/Desktop via beforeinstallprompt) */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 17px 40px;
    background: var(--accent);
    color: var(--bg-dark);
    font-family: var(--font-bold);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
    margin-bottom: 20px;
}
.btn-install:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 28px rgba(var(--accent-rgb), 0.35);
}
.btn-install:active { transform: none; box-shadow: none; }
.btn-install:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Official-style store badges - open the faux App Store / Play Store listings
   in a new tab. Uses the universal black pill, white text look so users
   recognize it at a glance; the icon itself provides brand cue. */
.btn-store {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    background: #0b1713;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    min-width: 220px;
    text-align: left;
    transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
    margin-bottom: 14px;
}
.btn-store:hover {
    transform: translateY(-2px);
    background: #0e1f18;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-glow);
}
.btn-store:active { transform: none; box-shadow: none; }

.btn-store-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #ffffff;
}
.btn-store-labels {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
}
.btn-store-upper {
    font-family: var(--font-reg);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}
.btn-store-lower {
    font-family: var(--font-bold);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}

/* Platform-specific instruction blocks */
.platform-block {
    display: none;
    text-align: center;
    width: 100%;
}
.platform-block.active {
    display: block;
}

.ios-steps {
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 28px 24px;
    margin-bottom: 24px;
}

.ios-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--accent-soft);
}
.ios-step:last-child { border-bottom: none; }

.ios-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-bold);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.ios-step-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-top: 3px;
}
.ios-step-text strong {
    color: var(--text-primary);
    font-family: var(--font-bold);
}

.already-installed {
    display: none;
    text-align: center;
    width: 100%;
}
.already-installed.active {
    display: block;
}

.installed-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-outline);
    border-radius: var(--radius-pill);
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 24px;
}

.installed-badge svg {
    width: 16px;
    height: 16px;
}

.btn-open {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 17px 40px;
    background: var(--accent);
    color: var(--bg-dark);
    font-family: var(--font-bold);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: background var(--ease), transform var(--ease);
}
.btn-open:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.install-fallback {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 16px;
}
.install-fallback a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.install-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    font-size: 14px;
    color: var(--text-muted);
    transition: color var(--ease);
}
.install-back:hover { color: var(--text-secondary); }
.install-back svg { transition: transform var(--ease); }
.install-back:hover svg { transform: translateX(-3px); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .install-features { gap: 20px; }
    .install-headline { font-size: 28px; }
    .btn-install { width: 100%; justify-content: center; }
    .btn-open { width: 100%; justify-content: center; }
    .btn-store { width: 100%; min-width: 0; justify-content: center; padding: 14px 20px; }
}

/* Desktop QR gate — shown only when PHP detects a non-mobile UA.
   The white card breaks from the dark palette on purpose: scanners need a
   bright quiet-zone and near-black modules. The emerald outer glow ties
   the card back to the brand accent. */
.desktop-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 8px auto 4px;
}

.qr-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    box-shadow:
        0 24px 60px var(--accent-glow),
        0 0 0 1px rgba(var(--accent-rgb), 0.22),
        inset 0 0 0 1px rgba(var(--bg-dark-rgb), 0.04);
    line-height: 0;
    animation: fadeIn 0.6s ease both;
    animation-delay: 0.08s;
}

.qr-card .qr-target,
.qr-card svg {
    display: block;
    width: 240px;
    height: 240px;
}

.qr-caption {
    font-family: var(--font-reg);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--text-secondary);
    margin-top: 4px;
    max-width: 320px;
    line-height: 1.55;
    text-align: center;
}

@media (max-width: 480px) {
    .qr-card { padding: 16px; border-radius: 16px; }
    .qr-card .qr-target,
    .qr-card svg { width: 200px; height: 200px; }
}
