body {
    margin: 0;
    padding: 0;
    background: url('img/fondo_app.png') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Poppins', Arial, sans-serif;
    color: #111;
}

.onboarding {
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.slide {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 50px 16px 100px 16px;
    min-height: 100vh;
    box-sizing: border-box;
}

.slide.active {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: none;}
}

.illustration {
    margin-top: 60px;
    margin-bottom: 32px;
}
.illustration img {
    width: 200px;
    max-width: 80vw;
    height: auto;
}

h1, h2 {
    color: #FF518A;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.5em;
}

h1 {
    font-size: 1.6em;
}

.intro, .slide p {
    font-size: 1.12em;
    color: #2509a7;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 0;
    margin-top: 0;
}

/* Dots navigation */
.dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: absolute;
    bottom: 56px;
    left: 0;
    right: 0;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    display: inline-block;
}
.dot.active {
    background: #FF2851;
}

/* SKIP button */
.skip-btn {
    position: absolute;
    bottom: 18px;
    right: 26px;
    background: none;
    border: none;
    color: #FF2851;
    font-size: 1.13em;
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    outline: none;
}

#preconditions {
    padding: 0 0 100px 0; /* Aumentado para dejar espacio al botón fijo */
    max-width: 450px;
    margin: 0 auto;
    background: transparent !important;
    min-height: 100vh;
    position: relative;
}

#preconditions.hidden {
    display: none;
}

/* Cuando preconditions está activo, toma control total de la pantalla */
body.preconditions-active {
    overflow: hidden;
    height: 100vh;
}

body.preconditions-active #preconditions {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 80px;
}

#preconditions .header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, #2911A8, #120FC6);
    color: #fff;
    padding: 28px 0 16px 0;
    border-radius: 0 0 22px 22px;
    margin-bottom: 22px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(41, 17, 168, 0.12);
}

.header h3 {
    margin: 0 0 8px 0;
    color: #FF518A;
    font-weight: 700;
    font-size: 1.22em;
    letter-spacing: 0.01em;
}
.header .subtitle {
    margin: 0;
    font-size: 1em;
    color: #fff;
    opacity: 0.85;
    font-weight: 400;
}

/* --- Fichas de selección (cards) --- */
.card {
    background: rgba(255,255,255,0.78) !important;
    border-radius: 24px;
    padding: 18px 16px 8px 16px;
}

/* Más separación entre cards */
.card + .card {
    margin-top: 36px;
}

/* Pills generales: dos columnas en grupos grandes */
.pills-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    justify-content: flex-start;
}

.pills-group[data-category="landscape"] {
    flex-direction: column;
    gap: 12px;
}
.pills-group[data-category="landscape"] .pill {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
}
.pills-group[data-category="landscape"] .pill.secondary {
    margin-top: 6px;
}

/* Dos columnas para grupos grandes (religion, language) */
.pills-group:not([data-category="landscape"]) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

.pill {
    background: #fff;
    border: none;
    color: #2911A8;
    border-radius: 20px;
    padding: 7px 19px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s;
    margin-bottom: 4px;
    outline: none;
    box-shadow: 0 2px 8px 0 rgba(255, 81, 138, 0.13), 0 1.5px 6px 0 rgba(41, 17, 168, 0.08);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
.pill.active, .pill:active {
    background: #FF518A;
    color: #fff;
    box-shadow: 0 2px 12px 0 rgba(255, 81, 138, 0.22), 0 1.5px 8px 0 rgba(41, 17, 168, 0.10);
}

.pill.secondary {
    background: #fff;
    color: #2911A8;
    border: none;
    font-weight: 400;
    font-size: 1em;
    width: 100%;
    margin-top: 6px;
    transition: background 0.16s, color 0.16s;
    grid-column: 1 / -1; /* Ocupa toda la fila en grid */
}
.pill.secondary.active {
    background: #FF2851;
    color: #fff;
    opacity: 0.7;
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    background: #fff;
    border-top: 2px solid #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    left: 50%;
    transform: translateX(-50%);
}

.done {
    color: #29D162;
    font-weight: 700;
    font-size: 1.13em;
}

.next-btn {
    background: #8E8E93;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 16px 32px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}
.next-btn:not([disabled]):active {
    background: #6d6d72;
    transform: translateY(1px);
}
.next-btn:not([disabled]) {
    background: #2911A8;
}
.arrow-icon {
    margin-left: 8px;
    font-size: 1.3em;
    font-weight: 700;
}

/* Language options styling */
.language-options {
    margin-bottom: 14px;
}

.language-item {
    margin-bottom: 16px;
}

.language-label {
    color: #2911A8;
    font-weight: 500;
    font-size: 1em;
    margin-bottom: 8px;
    text-align: left;
    display: block;
}

.language-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.language-buttons .pill {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.9em;
    margin-bottom: 0;
    width: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.language-yes {
    background: #fff;
    color: #2911A8;
    border: 1px solid #e0e0e0;
}

.language-yes.active {
    background: #FF518A;
    color: #fff;
    border: 1px solid #FF518A;
}

.language-irrelevant {
    background: #fff;
    color: #2911A8;
    border: 1px solid #e0e0e0;
}

.language-irrelevant.active {
    background: #FF2851;
    color: #fff;
    border: 1px solid #FF2851;
}

/* Responsive mobile */
@media (max-width: 600px) {
    .onboarding, #preconditions {
        max-width: 100vw;
        padding: 0;
    }
    .illustration {
        margin-top: 30px;
    }
    .card {
        margin: 18px 6px 18px 6px;
    }
    .bottom-bar {
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        padding: 16px 20px;
    }
    .pills-group[data-category="landscape"] .pill,
    .pill.secondary {
        font-size: 1.08em;
        padding: 10px 0;
    }
    .pills-group:not([data-category="landscape"]) {
        grid-template-columns: 1fr 1fr;
    }
    #sliders {
        padding-bottom: 120px;
    }
    /* Asegurar que el texto de estado no se superponga con el botón */
    .slider-status {
        max-width: 45%;
        font-size: 0.95em;
    }
}
/* --- SLIDERS SCREEN --- */
#sliders {
    padding: 0 0 100px 0; /* Padding uniforme con preconditions */
    max-width: 450px;
    margin: 0 auto;
    background: transparent !important;
    min-height: 100vh;
    position: relative;
}
#sliders.hidden {
    display: none;
}

/* Cuando body.preconditions-active está activo, aplicar estilos también a sliders */
body.preconditions-active #sliders {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 120px; /* Mayor padding para dejar espacio al botón */
}

/* Cuando body.preconditions-active está activo, aplicar estilos también a services-sliders */
body.preconditions-active #services-sliders {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 120px; /* Mayor padding para dejar espacio al botón */
}

/* Cuando body.preconditions-active está activo, aplicar estilos también a results */
body.preconditions-active #results {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 80px;
}

#results .header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, #2911A8, #120FC6);
    color: #fff;
    padding: 28px 0 16px 0;
    border-radius: 0 0 22px 22px;
    margin-bottom: 22px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(41, 17, 168, 0.12);
}

/* Loading animation */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2911A8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

/* Cities ranking */
.cities-ranking {
    padding: 0 16px;
}

.city-card {
    background: #fff;
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.city-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.city-rank {
    background: linear-gradient(135deg, #2911A8, #120FC6);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
}

.city-info h4 {
    margin: 0 0 4px 0;
    color: #2911A8;
    font-size: 1.2em;
    font-weight: 600;
}

.city-info .country {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.city-score {
    text-align: right;
}

.score-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #FF518A;
    margin: 0;
}

.score-label {
    font-size: 0.8em;
    color: #999;
    margin: 0;
}

.city-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.attribute {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85em;
}

.attribute-name {
    color: #666;
    font-weight: 500;
}

.attribute-value {
    color: #333;
    font-weight: 600;
}

/* Restart section */
.restart-section {
    text-align: center;
    padding: 40px 20px 20px;
}

.restart-btn {
    background: linear-gradient(135deg, #FF518A, #E91E63);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 81, 138, 0.3);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 81, 138, 0.4);
}

.restart-btn:active {
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

#sliders .header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, #2911A8, #120FC6);
    color: #fff;
    padding: 28px 0 16px 0;
    border-radius: 0 0 22px 22px;
    margin-bottom: 22px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(41, 17, 168, 0.12);
}

#services-sliders .header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, #2911A8, #120FC6);
    color: #fff;
    padding: 28px 0 16px 0;
    border-radius: 0 0 22px 22px;
    margin-bottom: 22px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(41, 17, 168, 0.12);
}

/* --- SECTION HEADERS STYLING --- */
.section-header {
    text-align: center;
    padding: 16px 20px 0;
    margin-bottom: 0px;
}

.section-number {
    color: #FF518A;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title {
    color: #2911A8;
    font-weight: 700;
    font-size: 1.1em;
    margin: 4px 0 0 0;
}

/* --- SLIDERS STYLING --- */
.sliders-form {
    padding: 0 0 80px 0;
}

.card h4 {
    color: #2911A8;
    margin: 0 0 10px 0;
    font-weight: 600;
    font-size: 1.22em;
    letter-spacing: 0.01em;
}

.slider-description {
    color: #666;
    font-size: 0.95em;
    margin: 0 0 18px 0;
    line-height: 1.4;
    font-weight: 400;
}

.slider-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #8b8686;
    outline: none;
    transition: background 0.3s;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FF518A;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 81, 138, 0.3);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(255, 81, 138, 0.4);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FF518A;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 81, 138, 0.3);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(255, 81, 138, 0.4);
}

.slider-value {
    color: #2911A8;
    font-weight: 700;
    font-size: 1.2em;
    min-width: 35px;
    text-align: center;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
}

/* --- SERVICES SLIDERS SECTION --- */
#services-sliders {
    padding: 0 0 100px 0;
    max-width: 450px;
    margin: 0 auto;
    background: transparent !important;
    min-height: 100vh;
    position: relative;
}

#services-sliders.hidden {
    display: none;
}

/* --- RESULTS SECTION --- */
#results {
    padding: 0 0 80px 0;
    max-width: 450px;
    margin: 0 auto;
    
    min-height: 100vh;
    position: relative;
}

#results.hidden {
    display: none;
}

/* Error and no results messages */
.no-results, .error-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3, .error-message h3 {
    color: #FF518A;
    margin-bottom: 12px;
}





.slide-content, .slide h1, .slide h2, .slide h3, .slide p, .slide .intro {
    background: rgba(255,255,255,0.78);
    border-radius: 18px;
    padding: 18px 16px;
    display: inline-block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
