* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background: #F5F7FB; color: #1E2A3A; }
:root {
    --red: #D32F2F;
    --red-dark: #B71C1C;
    --white: #FFFFFF;
    --silver-light: #F8F9FC;
    --silver-medium: #E9ECEF;
    --silver-dark: #CED4DA;
    --shadow-card: 0 8px 20px rgba(0,0,0,0.05);
}

.app-container { max-width: 500px; margin: 0 auto; background: var(--white); min-height: 100vh; box-shadow: 0 0 40px rgba(0,0,0,0.05); position: relative; }
.home-view { display: block; }

/* HEADER */
.app-header { background: var(--white); padding: 18px 20px 12px; border-bottom: 1px solid var(--silver-medium); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: rgba(255,255,255,0.96); }
.header-top { display: flex; justify-content: space-between; align-items: baseline; }
.logo-app { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--red); letter-spacing: -0.3px; }
.logo-app span { color: #1E2A3A; font-weight: 600; }
.header-badge { background: var(--silver-light); padding: 6px 12px; border-radius: 40px; font-size: 0.7rem; font-weight: 600; color: var(--red); }
.header-sub { font-size: 0.75rem; color: #5A6E85; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }

/* CONTENIDO */
.app-content { padding: 20px 16px 32px; }
.card-app { background: var(--white); border-radius: 28px; padding: 20px; box-shadow: var(--shadow-card); border: 1px solid var(--silver-medium); margin-bottom: 24px; }
.hero-card { text-align: center; }
.hero-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.hero-card p { color: #4a5b6e; margin-bottom: 1rem; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--red); }
.calc-card { background: linear-gradient(145deg, var(--white), var(--silver-light)); }
.input-group { margin-bottom: 18px; }
.input-group label { font-weight: 600; font-size: 0.85rem; display: block; margin-bottom: 8px; }
.input-group select, .input-group input { width: 100%; padding: 14px 16px; border-radius: 60px; border: 1px solid var(--silver-dark); font-size: 1rem; background: white; font-weight: 500; }
.range-value { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: #6c757d; }
.result-box { background: var(--red); border-radius: 32px; padding: 20px; text-align: center; margin-top: 20px; color: white; box-shadow: 0 4px 12px rgba(211,47,47,0.3); }
.result-number { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.5px; }

/* FILTROS */
.filters-wrapper { overflow-x: auto; white-space: nowrap; padding-bottom: 12px; margin-bottom: 16px; }
.filters-buttons { display: inline-flex; gap: 12px; }
.filter-chip { background: var(--silver-light); border: none; padding: 10px 20px; border-radius: 40px; font-weight: 600; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; color: #2c3e50; transition: 0.2s; cursor: pointer; }
.filter-chip.active { background: var(--red); color: white; }
.search-box { margin-bottom: 20px; }
.search-box input { width: 100%; padding: 14px 18px; border-radius: 60px; border: 1px solid var(--silver-dark); background: var(--white); font-size: 1rem; padding-left: 45px; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999" viewBox="0 0 24 24" width="20" height="20"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>'); background-repeat: no-repeat; background-position: 18px center; }

/* COMERCIOS PÚBLICOS */
.comercio-grid { display: flex; flex-direction: column; gap: 16px; }
.comercio-item { background: var(--white); border-radius: 24px; padding: 16px; border: 1px solid var(--silver-medium); }
.comercio-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.comercio-nombre { font-size: 1.2rem; font-weight: 700; }
.badge-pais { background: var(--silver-light); padding: 4px 12px; border-radius: 50px; font-size: 0.7rem; font-weight: 600; }
.comision-rate { font-size: 1.6rem; font-weight: 800; color: var(--red); margin: 8px 0 4px; }
.btn-link-app { background: transparent; border: 1.5px solid var(--red); color: var(--red); width: 100%; padding: 12px 0; border-radius: 60px; font-weight: 700; font-size: 0.9rem; margin-top: 12px; cursor: pointer; }
.btn-link-app:active { background: var(--red); color: white; }

/* BOTONES */
.btn-primary { background: var(--red); border: none; padding: 14px 20px; border-radius: 60px; font-weight: 700; color: white; width: 100%; font-size: 1rem; margin-top: 12px; cursor: pointer; box-shadow: 0 4px 10px rgba(211,47,47,0.2); }
.btn-primary:active { transform: scale(0.97); }

/* BARRA INFERIOR */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 500px; margin: 0 auto; background: rgba(255,255,255,0.96); backdrop-filter: blur(20px); border-top: 1px solid var(--silver-medium); display: flex; justify-content: space-around; padding: 8px 16px 20px; z-index: 20; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 500; color: #7e8c9e; background: none; border: none; cursor: pointer; }
.nav-item i { font-size: 1.5rem; }
.nav-item.active { color: var(--red); }

/* MODALES */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); z-index: 1100; display: flex; align-items: center; justify-content: center; visibility: hidden; opacity: 0; transition: 0.25s; }
.modal-overlay.active { visibility: visible; opacity: 1; }
.modal-card { background: white; width: 90%; max-width: 380px; border-radius: 48px; padding: 2rem; text-align: center; box-shadow: 0 20px 35px rgba(0,0,0,0.25); position: relative; }
.modal-card h3 { font-family: 'Poppins', sans-serif; font-size: 1.5rem; color: var(--red); margin-bottom: 0.3rem; }
.modal-card p { color: #5f6c80; font-size: 0.85rem; margin-bottom: 1.2rem; }
.modal-card .form-row { text-align: left; margin-bottom: 1rem; }
.modal-card .form-row label { font-weight: 600; font-size: 0.8rem; display: block; margin-bottom: 4px; color: #2c3e50; }
.modal-card .form-row input, .modal-card .form-row select { width: 100%; padding: 12px 14px; border-radius: 60px; border: 1px solid #e9ecf0; font-size: 0.9rem; }
.modal-card .btn-submit { background: var(--red); color: white; border: none; padding: 12px; border-radius: 60px; font-weight: bold; width: 100%; cursor: pointer; transition: 0.2s; }
.modal-card .btn-submit:hover { background: var(--red-dark); }
.modal-card .form-link { margin-top: 1rem; font-size: 0.85rem; color: #5f6c80; }
.modal-card .form-link a { color: var(--red); text-decoration: none; font-weight: 600; }
.modal-card .modal-buttons { display: flex; flex-direction: column; gap: 12px; }
.modal-card .modal-btn { background: transparent; border: 1.5px solid var(--silver-dark); padding: 14px; border-radius: 60px; font-weight: 700; font-size: 1rem; color: #1e2a3a; transition: 0.2s; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.modal-card .modal-btn i { color: var(--red); }
.modal-card .modal-btn:hover { background: var(--silver-light); border-color: var(--red); transform: translateY(-2px); }
.close-modal { background: none; border: none; font-size: 1.8rem; position: absolute; top: 8px; right: 16px; cursor: pointer; color: #9aa6b5; }
.modal-card .radio-group { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.3rem; }
.modal-card .radio-group label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; cursor: pointer; font-size: 0.9rem; }
.modal-card .pin-hint { color: #D32F2F; display: block; margin-top: 4px; font-size: 0.7rem; text-align: left; }
.modal-card .form-row select { appearance: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>'); background-repeat: no-repeat; background-position: right 16px center; }

/* SPINNER */
.spinner-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; visibility: hidden; opacity: 0; transition: 0.2s; }
.spinner-overlay.active { visibility: visible; opacity: 1; }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: var(--red); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* NIVELES */
.level-bronce { background: #cd7f32; color: white; }
.level-plata { background: #c0c0c0; color: #1e2a3a; }
.level-oro { background: #ffd700; color: #1e2a3a; }

/* RESPONSIVE */
@media (max-width: 480px) {
    .app-content { padding: 16px; }
    .result-number { font-size: 2rem; }
    .hero-card h2 { font-size: 1.3rem; }
    .modal-card { padding: 1.5rem; }
    .modal-card .modal-buttons { gap: 10px; }
    .modal-card .modal-btn { padding: 12px; font-size: 0.9rem; }
}
