/* ================================================
   BINGU Online - Design System Components
   Extraído de mockup-componentes.html
   Fuente de verdad: Rubik (headings) + DM Sans (body)
   ================================================ */

/* ===== TIPOGRAFÍA ===== */
.typo-hero {
    font-size: var(--text-3xl);
    font-weight: 800;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--pink), var(--blue), var(--pink));
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.typo-h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--pink), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typo-h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.3;
    color: var(--gray-dark);
}

.typo-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typo-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--blue), var(--pink));
    border-radius: 2px;
}

.typo-body {
    font-size: var(--text-lg);
    color: var(--gray-dark);
    line-height: 1.6;
}

.typo-small {
    font-size: var(--text-sm);
    color: var(--gray);
    line-height: 1.6;
}

.typo-welcome {
    font-size: var(--text-2xl);
    color: var(--pink);
    font-weight: 600;
    line-height: 1.3;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ===== BOTONES ===== */

/* Base 3D pill */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    top: 0;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:hover { top: 2px; }
.btn:active { top: 4px; }

/* Variantes */
.btn-primary {
    background: linear-gradient(to bottom, #2dd4f0, #0ea5e9);
    color: var(--white);
    box-shadow: 0 5px 0 #0b7bb5, 0 7px 12px rgba(26,188,245,0.3);
}
.btn-primary:hover { box-shadow: 0 3px 0 #0b7bb5, 0 5px 8px rgba(26,188,245,0.25); }
.btn-primary:active { box-shadow: 0 1px 0 #0b7bb5, 0 2px 4px rgba(26,188,245,0.2); }

.btn-secondary {
    background: linear-gradient(to bottom, #f472b6, #ec4899);
    color: var(--white);
    box-shadow: 0 5px 0 #be185d, 0 7px 12px rgba(255,29,186,0.3);
}
.btn-secondary:hover { box-shadow: 0 3px 0 #be185d, 0 5px 8px rgba(255,29,186,0.25); }
.btn-secondary:active { box-shadow: 0 1px 0 #be185d, 0 2px 4px rgba(255,29,186,0.2); }

.btn-neutral {
    background: var(--white);
    color: var(--gray-dark);
    box-shadow: 0 4px 0 #d1d5db, 0 6px 10px rgba(0,0,0,0.08);
}
.btn-neutral:hover { box-shadow: 0 2px 0 #d1d5db, 0 4px 6px rgba(0,0,0,0.06); }
.btn-neutral:active { box-shadow: 0 1px 0 #d1d5db, 0 2px 4px rgba(0,0,0,0.04); }

.btn-youtube {
    background: linear-gradient(to bottom, #ff4444, #dc2626);
    color: var(--white);
    box-shadow: 0 4px 0 #991b1b, 0 6px 10px rgba(220,38,38,0.25);
}
.btn-youtube:hover { box-shadow: 0 2px 0 #991b1b, 0 4px 6px rgba(220,38,38,0.2); }
.btn-youtube:active { box-shadow: 0 1px 0 #991b1b, 0 2px 4px rgba(220,38,38,0.15); }

.btn-gradient {
    background: linear-gradient(135deg, var(--blue), var(--pink));
    color: var(--white);
    overflow: hidden;
}
.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.btn-gradient:hover::before { left: 100%; }
.btn-gradient:hover { transform: translateY(-3px); top: 0; }

.btn-google {
    background: var(--white);
    color: var(--gray-dark);
    border: 2px solid #e5e7eb;
    padding: 14px 16px;
    box-shadow: none;
    width: 100%;
    justify-content: center;
}
.btn-google:hover { border-color: #d1d5db; background: #f9fafb; top: 0; }

.btn-submit {
    background: linear-gradient(to bottom, #ff5dd0, var(--pink));
    color: var(--white);
    box-shadow: 0 5px 0 #a8126e, 0 7px 12px rgba(255,29,186,0.3);
    width: 100%;
}
.btn-submit:hover { box-shadow: 0 3px 0 #a8126e, 0 5px 8px rgba(255,29,186,0.25); }

/* Tamaños */
.btn-sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn-lg { padding: 16px 32px; font-size: var(--text-lg); }
.btn-xl { padding: 18px 32px; font-size: var(--text-xl); font-weight: 700; }
.btn-full { width: 100%; }

/* Circular */
.btn-circle {
    width: 44px; height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: var(--white);
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.btn-circle:hover { border-color: var(--blue); background: linear-gradient(135deg, rgba(26,188,245,0.1), rgba(255,29,186,0.1)); top: 0; }
.btn-circle svg { width: 20px; height: 20px; color: var(--gray); }
.btn-circle:hover svg { color: var(--blue); }

/* Icon inside buttons */
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== TARJETAS ===== */
.card {
    background: var(--white);
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.card-body { padding: 24px; }

/* Card 3D (theme cards index) */
.card-3d {
    background: var(--white);
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 5px 0 #d1d5db, 0 7px 16px rgba(0,0,0,0.08);
    position: relative;
    top: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-3d:hover {
    top: -4px;
    box-shadow: 0 8px 0 #d1d5db, 0 12px 24px rgba(0,0,0,0.12);
}

/* Card selectable (demo/play themes) */
.card-selectable {
    border-radius: 16px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-selectable:hover {
    transform: translateY(-4px) scale(1.02);
}

.card-selectable.selected {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(255,29,186,0.2);
}

/* Card centered (auth) */
.card-auth {
    background: var(--white);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 5px 0 #d1d5db, 0 7px 16px rgba(0,0,0,0.1);
    max-width: 460px;
    width: 100%;
}

/* ===== FORMULARIOS ===== */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-dark);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--gray-dark);
    outline: none;
    transition: all 0.2s;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(26,188,245,0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-select {
    padding: 12px 40px 12px 20px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: var(--white);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    outline: none;
}

.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(26,188,245,0.15);
}

.form-select:hover { border-color: var(--blue); }

/* Slider */
.form-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--pink) 100%);
    outline: none;
    cursor: pointer;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--pink);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,29,186,0.3);
}

.form-slider::-moz-range-thumb {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--pink);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,29,186,0.3);
}

/* ===== BADGES / TAGS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge-plan {
    background: linear-gradient(135deg, #fdf2f8, #eff6ff);
    color: var(--gray-dark);
    font-weight: 700;
}

.badge-plan svg { color: var(--pink); }

.badge-info {
    background: linear-gradient(135deg, rgba(26,188,245,0.1), rgba(255,29,186,0.1));
    color: var(--pink);
    font-weight: 700;
}

.badge-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(52,211,153,0.1));
    border: 1px solid rgba(16,185,129,0.25);
    color: #065f46;
}

.badge-demo {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue);
    padding: 0;
    background: none;
}

.badge svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Color dot */
.color-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ===== BANNERS / ALERTS ===== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: var(--text-sm);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-error svg { color: #ef4444; }

.alert-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-success svg { color: #22c55e; }

.alert-info {
    background: linear-gradient(135deg, #e8f9fe, #fce8f8);
    color: var(--gray);
    border: 1px solid rgba(26,188,245,0.2);
}
.alert-info svg { color: var(--blue); }

/* Banner compuesto (info + CTA) */
.banner {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 5px 0 #d1d5db, 0 7px 16px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 18px;
}

.banner-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(to bottom, #93c5fd, #60a5fa);
    color: #1e3a5f;
    box-shadow: 0 4px 0 #2563eb, 0 6px 10px rgba(0,0,0,0.08);
}

.banner-icon svg { width: 26px; height: 26px; }

.banner-body {
    flex: 1;
    min-width: 0;
}

.banner-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--gray-dark);
    margin-bottom: 2px;
}

.banner-text {
    font-size: var(--text-xs);
    color: var(--gray);
    line-height: 1.4;
}
.banner-text strong { color: var(--gray-dark); }

.banner-cta {
    flex-shrink: 0;
}

.banner-cta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 14px;
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
    color: var(--white);
    background: linear-gradient(to bottom, #f472b6, #ec4899);
    box-shadow: 0 4px 0 #be185d, 0 6px 10px rgba(255,29,186,0.25);
    position: relative;
    top: 0;
    transition: all 0.15s ease;
}
.banner-cta a:hover { top: 2px; box-shadow: 0 2px 0 #be185d, 0 4px 6px rgba(255,29,186,0.2); }
.banner-cta a:active { top: 3px; box-shadow: 0 1px 0 #be185d, 0 2px 4px rgba(255,29,186,0.15); }
.banner-cta a svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 599px) {
    .banner {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
}

/* ===== DIVIDERS ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--gray);
    font-size: var(--text-xs);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    padding: 0 16px;
}

.divider-gradient {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,29,186,0.3), var(--blue), rgba(255,29,186,0.3), transparent);
    margin: 24px 0;
}

/* ===== SCROLL HORIZONTAL ===== */
.hscroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 12px 2px 16px;
    margin: -12px -2px -16px;
}

.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ===== MODE SELECTOR ===== */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 3px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
}

.mode-card:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 16px rgba(26,188,245,0.15);
}

.mode-card.selected {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(255,29,186,0.15);
    background: linear-gradient(135deg, rgba(255,29,186,0.03), rgba(26,188,245,0.03));
}

.mode-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--pink));
    flex-shrink: 0;
}

.mode-text { display: flex; flex-direction: column; gap: 2px; }
.mode-text strong { font-size: var(--text-base); color: var(--gray-dark); }
.mode-text span { font-size: var(--text-xs); color: var(--gray); }

/* ===== TOOLTIPS ===== */
[data-tooltip] { position: relative; }

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px) scale(0.8);
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--gray-dark), #374151);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 99999;
    pointer-events: none;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 7px solid transparent;
    border-bottom-color: var(--gray-dark);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 99999;
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ===== PREMIUM BORDER ANIMATION ===== */
.premium-border {
    background: var(--white) !important;
    border: 2px solid transparent;
    background-clip: padding-box !important;
    position: relative;
}

.premium-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--pink), var(--blue), #a855f7, var(--pink));
    background-size: 300% 300%;
    animation: premiumBorder 3s linear infinite;
    z-index: -1;
}

.premium-border::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: var(--white);
    z-index: -1;
}

@keyframes premiumBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== ICON BOX ===== */
.icon-box {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 0 var(--icon-shadow), 0 6px 10px rgba(0,0,0,0.08);
}

.icon-box svg { width: 24px; height: 24px; }

.icon-box-yellow { background: linear-gradient(to bottom, #fbbf24, #f59e0b); color: var(--white); --icon-shadow: #b45309; }
.icon-box-green  { background: linear-gradient(to bottom, #a7f3d0, #6ee7b7); color: #065f46; --icon-shadow: #059669; }
.icon-box-purple { background: linear-gradient(to bottom, #c4b5fd, #a78bfa); color: #4c1d95; --icon-shadow: #7c3aed; }
.icon-box-red    { background: linear-gradient(to bottom, #fca5a5, #f87171); color: #7f1d1d; --icon-shadow: #dc2626; }
.icon-box-blue   { background: linear-gradient(to bottom, #93c5fd, #60a5fa); color: #1e3a5f; --icon-shadow: #2563eb; }

/* ===== AVATAR ===== */
.avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--pink);
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-initial {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-xs);
    flex-shrink: 0;
}

/* ===== CONFIGURADOR (demo.php / play.php) ===== */

.demo-sections {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 90px;
}

.demo-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 768px) {
    .demo-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .demo-sidebar > :first-child,
    .demo-sidebar .btn-demo-wrapper {
        grid-column: 1 / -1;
    }
}

/* Sections */
.section {
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s;
}

.section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--blue), var(--pink));
    border-radius: 2px;
}

/* Temas scroll */
.temas-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px;
}

.section-temas {
    overflow: visible;
}

.temas-grid::-webkit-scrollbar {
    display: none;
}

.tema-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    background: var(--tema-color, #6b7280);
    flex-shrink: 0;
    width: 150px;
    scroll-snap-align: start;
    transform: scale(0.95);
}

.tema-card:hover {
    transform: scale(0.95) translateY(-4px) scale(1.02);
}

.tema-card.selected {
    border-color: var(--pink);
    outline: 3px solid rgba(255, 29, 186, 0.35);
    outline-offset: 2px;
    transform: scale(1.0);
}

.tema-card-img {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

.tema-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.tema-card-overlay {
    display: none;
}

.tema-card-name {
    padding: 10px 12px;
    background: var(--tema-color, #6b7280);
    color: white;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    font-weight: 600;
    text-align: center;
}

.tema-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: var(--pink);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 29, 186, 0.4);
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tema-card.selected .tema-card-check {
    display: flex;
}

.tema-card-check svg {
    width: 16px;
    height: 16px;
    color: white;
}

/* Select rows */
.select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}

.select-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.select-row:first-child {
    padding-top: 0;
}

.select-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--gray-dark);
}

.select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-input {
    padding: 12px 20px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: var(--white);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

.select-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(26, 188, 245, 0.15);
}

.select-input:hover {
    border-color: var(--blue);
}

/* ===== FLAG SELECT (custom dropdown con banderas) ===== */
.flag-select {
    position: relative;
}

.flag-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 40px 10px 14px;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    background: var(--white);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    min-width: 140px;
    transition: all 0.2s;
    position: relative;
}

.flag-select-trigger:hover {
    border-color: var(--blue);
}

.flag-select.open .flag-select-trigger {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(26, 188, 245, 0.15);
}

.flag-select-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.flag-select-arrow {
    width: 16px;
    height: 16px;
    color: var(--gray);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s;
}

.flag-select.open .flag-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.flag-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 100%;
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.flag-select.open .flag-select-dropdown {
    display: block;
}

.flag-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-dark);
    cursor: pointer;
    transition: background 0.15s;
}

.flag-select-option:hover {
    background: #f3f4f6;
}

.flag-select-option.active {
    background: #e8f5fe;
    color: var(--blue);
    font-weight: 600;
}

/* Voice preview button */
.btn-preview-voice {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-preview-voice:hover {
    border-color: var(--blue);
    background: linear-gradient(135deg, rgba(26, 188, 245, 0.1), rgba(255, 29, 186, 0.1));
    transform: scale(1.1);
}

.btn-preview-voice:active {
    transform: scale(0.95);
}

.btn-preview-voice.playing {
    border-color: var(--pink);
    background: rgba(255, 29, 186, 0.1);
    animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 29, 186, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255, 29, 186, 0); }
}

.btn-preview-voice svg {
    width: 20px;
    height: 20px;
    color: var(--gray);
    transition: color 0.2s;
}

.btn-preview-voice:hover svg {
    color: var(--blue);
}

.btn-preview-voice.playing svg {
    color: var(--pink);
}

/* Voice custom dropdown */
.voice-dropdown {
    position: relative;
    flex: 1;
}

.voice-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-sm);
    transition: border-color 0.2s;
}

.voice-dropdown-trigger:hover {
    border-color: var(--blue);
}

.voice-dropdown.open .voice-dropdown-trigger {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(26, 188, 245, 0.1);
}

.voice-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--gray-dark);
    white-space: nowrap;
    overflow: hidden;
}

.voice-dropdown-arrow {
    width: 16px;
    height: 16px;
    color: var(--gray);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.voice-dropdown.open .voice-dropdown-arrow {
    transform: rotate(180deg);
}

.voice-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.voice-dropdown.open .voice-dropdown-list {
    display: block;
}

.voice-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--gray-dark);
    white-space: nowrap;
    transition: background 0.15s;
}

.voice-dropdown-option:hover {
    background: #f1f5f9;
}

.voice-dropdown-option.active {
    background: #eff6ff;
    font-weight: 600;
}

.voice-dropdown-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.voice-dropdown-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

/* Speed control */
.speed-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.speed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.speed-label {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--gray-dark);
}

.speed-value {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--pink);
    background: linear-gradient(135deg, rgba(255, 29, 186, 0.1), rgba(26, 188, 245, 0.1));
    padding: 6px 14px;
    border-radius: 20px;
}

.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--pink) 100%);
    outline: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--pink);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 29, 186, 0.3);
    transition: all 0.2s;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 29, 186, 0.4);
}

.speed-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--pink);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 29, 186, 0.3);
}

.speed-hints {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: #9ca3af;
}

/* Main action button */
.btn-demo-wrapper {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 0 20px;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
    z-index: 40;
}

.btn-demo {
    width: 100%;
    padding: 18px 32px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--blue) 0%, var(--pink) 100%);
    color: var(--white);
    font-family: inherit;
    font-size: var(--text-lg);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(255, 29, 186, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-demo:hover::before {
    left: 100%;
}

.btn-demo:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 29, 186, 0.45);
}

.btn-demo:active {
    transform: scale(0.98);
}

/* Mode selector (configurador) */
.mode-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--pink));
    flex-shrink: 0;
}

.mode-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-card-text strong {
    font-size: var(--text-base);
    color: var(--gray-dark);
}

.mode-card-text span {
    font-size: var(--text-xs);
    color: var(--gray);
}

/* Configurator responsive */
@media (max-width: 479px) {
    .section {
        padding: 20px;
        border-radius: 16px;
    }

    .tema-card {
        width: 130px;
    }

    .select-input {
        min-width: 120px;
        padding: 10px 16px;
        padding-right: 36px;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 480px) {
    .tema-card {
        width: 160px;
    }
}

/* Tablet: 3 por fila, aprovechando ancho completo */
@media (min-width: 768px) {
    .temas-grid {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        max-height: 625px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }

    .temas-grid::-webkit-scrollbar {
        display: block;
        width: 6px;
    }
    .temas-grid::-webkit-scrollbar-track {
        background: transparent;
    }
    .temas-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;
    }
    .temas-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    .tema-card {
        width: calc((100% - 14px * 2) / 3);
    }
}

/* Desktop: layout 2 columnas configurador */
@media (min-width: 1024px) {

    .demo-sections {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .demo-sections > * {
        grid-column: 1;
    }

    .demo-sections > .section-temas {
        grid-column: 2;
        grid-row: 1 / span 10;
        display: flex;
        flex-direction: column;
        align-self: start;
        min-height: 0;
    }

    .demo-sections > .section-temas .temas-grid {
        overflow-x: visible;
        overflow-y: auto;
        scroll-snap-type: none;
        flex: 1;
        min-height: 0;
        max-height: 625px;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        padding-right: 8px;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }

    .tema-card {
        width: calc((100% - 14px) / 2);
    }

    .demo-sections > .section-temas .temas-grid::-webkit-scrollbar {
        display: block;
        width: 6px;
    }
    .demo-sections > .section-temas .temas-grid::-webkit-scrollbar-track {
        background: transparent;
    }
    .demo-sections > .section-temas .temas-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 3px;
    }
    .demo-sections > .section-temas .temas-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* ===== PWA INSTALL BANNER ===== */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 12px 16px;
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-banner--visible {
    transform: translateY(0);
}

.pwa-banner-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-dark);
}

.pwa-banner-install {
    padding: 8px 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(to bottom, #2dd4f0, #0ea5e9);
    color: var(--white);
    font-weight: 700;
    font-size: var(--text-sm);
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 3px 0 #0b7bb5;
    transition: all 0.2s;
    position: relative;
    top: 0;
    flex-shrink: 0;
}

.pwa-banner-install:hover {
    top: 2px;
    box-shadow: 0 1px 0 #0b7bb5;
}

.pwa-banner-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--gray);
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.2s;
}

.pwa-banner-close:hover {
    background: #f1f5f9;
    color: var(--gray-dark);
}

@media (max-width: 480px) {
    .pwa-banner-text {
        font-size: 0.8rem;
    }
    .pwa-banner-install {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
    .pwa-banner-icon {
        width: 34px;
        height: 34px;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .mode-selector { grid-template-columns: 1fr; }
}
