﻿/* ─── RESET ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── VARIABLES ──────────────────────────────────────── */
:root {
    --ios-color: #0A84FF;
    --android-color: #34A853;
    --other-color: #6B7280;
    --bg: #0C0C0E;
    --surface: #18181B;
    --border: rgba(255, 255, 255, 0.07);
    --text: #F4F4F5;
    --muted: #71717A;
}

/* ─── BASE ───────────────────────────────────────────── */
html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ─── FONDO ANIMADO ──────────────────────────────────── */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

    .bg-glow::before {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(10, 132, 255, 0.07) 0%, transparent 70%);
        top: -100px;
        left: -100px;
        animation: drift1 12s ease-in-out infinite;
    }

    .bg-glow::after {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(52, 168, 83, 0.06) 0%, transparent 70%);
        bottom: -80px;
        right: -80px;
        animation: drift2 15s ease-in-out infinite;
    }

@keyframes drift1 {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(40px, 30px);
    }
}

@keyframes drift2 {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-30px, -40px);
    }
}

/* ─── CONTENEDOR ─────────────────────────────────────── */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── ÍCONO DE APP ───────────────────────────────────── */
.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1D4ED8 0%, #0EA5E9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: fadeUp 0.6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
    overflow: hidden;
}

    .app-icon img {
        width: 80px;
        height: 80px;
        border-radius: 20px;
        object-fit: cover;
        display: block;
    }

/* ─── TEXTOS ─────────────────────────────────────────── */
.app-name {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
    animation: fadeUp 0.6s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.app-desc {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 2rem;
    animation: fadeUp 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ─── ESTADO: DETECTANDO ─────────────────────────────── */
.detecting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeUp 0.5s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.detecting-text {
    font-size: 13px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
}

/* ─── ESTADO: REDIRIGIENDO ───────────────────────────── */
.redirecting {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1.25rem;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
}

.badge-ios {
    color: var(--ios-color);
    border-color: rgba(10, 132, 255, 0.3);
    background: rgba(10, 132, 255, 0.08);
}

.badge-android {
    color: var(--android-color);
    border-color: rgba(52, 168, 83, 0.3);
    background: rgba(52, 168, 83, 0.08);
}

.badge-other {
    color: #A1A1AA;
    border-color: rgba(161, 161, 170, 0.25);
    background: rgba(161, 161, 170, 0.06);
}

/* ─── TARJETA DE TIENDA ──────────────────────────────── */
.store-card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}

    .store-card:hover {
        border-color: rgba(255, 255, 255, 0.14);
        transform: translateY(-1px);
    }

    .store-card:active {
        transform: scale(0.98);
    }

.store-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .store-icon.ios {
        background: rgba(10, 132, 255, 0.12);
    }

    .store-icon.android {
        background: rgba(52, 168, 83, 0.12);
    }

    .store-icon.other {
        background: rgba(161, 161, 170, 0.08);
    }

.store-label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}

.store-name {
    font-size: 15px;
    font-weight: 500;
}

.store-arrow {
    margin-left: auto;
    color: var(--muted);
    font-size: 18px;
}

/* ─── BARRA DE PROGRESO ──────────────────────────────── */
.progress-wrap {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width 2.5s linear;
}

    .progress-bar.ios {
        background: var(--ios-color);
    }

    .progress-bar.android {
        background: var(--android-color);
    }

    .progress-bar.other {
        background: var(--other-color);
    }

.redirect-note {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* ─── LINKS MANUALES ─────────────────────────────────── */
.manual-links {
    margin-top: 1.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

    .manual-links p {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 4px;
    }

.manual-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

    .manual-btn:hover {
        border-color: rgba(255, 255, 255, 0.15);
        color: var(--text);
    }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-ios {
    background: var(--ios-color);
}

.dot-android {
    background: var(--android-color);
}

.dot-other {
    background: var(--other-color);
}
