* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: #FFF69C;
    color: black;
    padding: 40px;
    text-align: center;
}

/* Páginas legales: título centrado en todo el ancho (escritorio y móvil) */
.header-legal .header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.header-legal .header-logo-block {
    justify-self: start;
}
.header-legal .header-text-container {
    justify-self: center;
    grid-column: 2;
    margin-left: 0;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* Logo + Iniciar sesión/Registrarse centrados como bloque; título a la misma altura que el logo */
.header-brand-and-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-left: 40px;
}

.header-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.header-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.user-state {
    font-size: 0.85rem;
    color: rgba(0,0,0,0.7);
}
.header-user .btn-link {
    background: none;
    border: none;
    color: rgba(0,0,0,0.85);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
}
.header-user .btn-link:hover {
    color: #333;
}
.header-user a.btn-link {
    text-decoration: underline;
}

/* Modal auth */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.auth-modal-content {
    background: white;
    padding: 28px 32px;
    border-radius: 12px;
    max-width: 360px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.auth-modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 1.35rem;
}
.auth-modal-content input {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}
.password-wrapper {
    position: relative;
    margin-bottom: 12px;
}
.password-wrapper input {
    margin-bottom: 0;
    padding-right: 95px;
}
.btn-show-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #667eea;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}
.btn-show-password:hover {
    color: #5568d3;
}
.auth-modal-content button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.auth-error {
    color: #c00;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.auth-switch {
    margin-top: 16px;
    text-align: center;
}
.auth-switch .btn-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
}
.auth-forgot {
    margin-top: 10px;
    text-align: center;
}
.auth-forgot .btn-link {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
}
.auth-forgot-intro {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: #555;
}
.auth-success {
    color: #0a0;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Restablecer contraseña (página con ?reset=token) */
.reset-password-section {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.reset-password-box {
    background: white;
    padding: 28px 32px;
    border-radius: 12px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.reset-password-box h2 {
    margin: 0 0 12px 0;
    font-size: 1.35rem;
}
.reset-password-intro {
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    color: #555;
}
.reset-password-box input {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}
.reset-password-box button[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* CTA Suscríbete (plan free) */
.upgrade-cta {
    margin: 20px 40px 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    text-align: center;
}
.upgrade-cta p {
    margin: 0 0 14px 0;
    font-size: 1rem;
    color: #333;
}
.btn-subscribe {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-subscribe:hover {
    opacity: 0.95;
}

.header-brand-name {
    margin-top: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.header-logo {
    height: 64px;
    width: auto;
    display: block;
    object-fit: contain;
    /* Mezclar el fondo blanco con el color lila del header, manteniendo solo la silueta negra */
    mix-blend-mode: multiply;
}

header h1 {
    font-size: 2.5rem;
    margin: 0 0 8px 0;
    font-weight: 700;
    text-align: center;
}

header h1.main-title {
    font-size: 2rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    text-align: center;
}

.hero-tension {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 8px 0 4px 0;
    text-align: center;
    color: rgba(0, 0, 0, 0.85);
}
.hero-emotional {
    font-size: 0.95rem;
    margin: 2px 0 4px 0;
    text-align: center;
    color: rgba(0, 0, 0, 0.7);
    font-style: italic;
}
.hero-tension-cta {
    font-size: 0.9rem;
    margin: 2px 0 4px 0;
    text-align: center;
    color: rgba(0, 0, 0, 0.6);
}
.hero-authority {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
    text-align: center;
    color: rgba(0, 0, 0, 0.7);
}

.search-section {
    padding: 40px;
    background: #f8f9fa;
}

.search-form {
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.input-group input {
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.home-cta-hint {
    font-size: 0.8rem;
    color: #6c757d;
    margin: -2px 0 2px 0;
}

.input-group button {
    padding: 24px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.input-group button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #5a67d8;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.input-group button:disabled {
    cursor: not-allowed;
}

.search-tagline {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
}

.home-friction {
    font-size: 0.9rem;
    color: #6c757d;
    margin: -4px 0 4px 0;
}

/* Bloque "Qué obtienes" (Home) */
.home-feature-bullets {
    max-width: 800px;
    margin: 20px auto 0;
}
.home-feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 18px 0;
}
.home-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}
.home-feature-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.home-feature-hint {
    width: 100%;
    padding-left: 28px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
    margin-top: -2px;
}
.home-feature-icon {
    font-size: 1.15rem;
    color: #667eea;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.home-feature-explainer {
    margin: 10px 0 0 0;
    font-size: 0.88rem;
    color: #6c757d;
    line-height: 1.45;
    max-width: 520px;
}

/* Microcopy bajo input */
.home-microcopy {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 4px 0 0;
    font-weight: 600;
}
.home-microcopy-cities {
    margin-top: 2px;
    margin-bottom: 4px;
}
.home-microcopy-free-note {
    font-weight: 400;
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Error validación URL inline */
.home-validation-error {
    max-width: 800px;
    margin: 8px auto 0;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #c62828;
    background: #ffebee;
    border-radius: 6px;
    border-left: 4px solid #f44336;
}

/* City pills */
.home-city-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.home-city-pill {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #667eea;
    background: rgba(102, 126, 234, 0.12);
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.home-city-pill:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #5568d3;
}

/* Bloque ejemplo real (Home) */
.home-example-card {
    max-width: 800px;
    margin: 20px auto 0;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.home-example-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 8px 0;
}
.home-example-kpis-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.7;
}
.home-example-kpis-list li {
    padding: 5px 0;
}
.home-example-bajadas {
    color: #667eea;
    font-weight: 600;
    margin-right: 4px;
}
.home-example-note {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    margin: 0 0 10px 0;
}
.home-example-cta {
    margin: 8px 0 0;
    text-align: center;
}
.home-example-link {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.home-example-link:hover {
    transform: translateY(-1px);
    background: #5a67d8;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Bloque diferencial */
.home-differential-block {
    max-width: 800px;
    margin: 16px auto 0;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}
.home-differential-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 8px 0;
}
.home-differential-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.6;
}
.home-differential-list li {
    padding: 2px 0;
    padding-left: 1.2em;
    position: relative;
}
.home-differential-list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
}

/* Portales soportados */
.home-portales-wrap {
    max-width: 800px;
    margin: 12px auto 0;
}
.home-portales-text {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}
.home-portales-next {
    font-size: 0.75rem;
    color: #adb5bd;
    margin: 2px 0 0 0;
}

/* ¿Por qué a veces no hay datos? */
.home-why-no-data {
    max-width: 800px;
    margin: 12px auto 0;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #495057;
}
.home-why-no-data summary {
    list-style: none;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
}
.home-why-no-data summary::-webkit-details-marker { display: none; }
.home-why-no-data summary::marker { content: none; }
.home-why-no-data summary::after {
    content: '▶';
    margin-left: 6px;
    font-size: 0.7rem;
    color: #adb5bd;
}
.home-why-no-data[open] summary::after {
    content: '▼';
}
.home-why-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    line-height: 1.5;
}
.home-why-content p {
    margin: 0 0 4px 0;
}
.home-why-content p:last-child {
    margin-bottom: 0;
}

/* Bloque SEO histórico por ciudad (Home) */
.home-barcelona-block {
    max-width: 800px;
    margin: 16px auto 0;
    padding: 16px 20px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
}
.home-barcelona-h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}
.home-barcelona-link {
    display: inline-block;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    background: #667eea;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}
.home-barcelona-link:hover {
    transform: translateY(-1px);
    background: #5a67d8;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.home-city-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.home-city-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e8;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}
.home-city-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #667eea;
}
.home-city-card-desc {
    font-size: 0.82rem;
    color: #666;
    margin-top: 4px;
}
.footer-brands {
    font-size: 0.78rem;
    color: #999;
}
.home-other-cities {
    max-width: 800px;
    margin: 32px auto 0;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Sección de pricing (Free / Pro) */
.pricing-section {
    max-width: 820px;
    margin: 32px auto 0;
    padding: 40px 20px;
    text-align: center;
}
.pricing-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}
.pricing-subtitle {
    font-size: 1rem;
    color: #6c757d;
    margin: 0 0 28px 0;
}
.pricing-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.pricing-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 32px 28px 28px;
    text-align: left;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.pricing-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.pricing-card-pro {
    border: 2px solid #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}
.pricing-card-pro:hover {
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.22);
}
.pricing-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}
.pricing-card-header {
    margin-bottom: 20px;
}
.pricing-plan-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}
.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.pricing-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}
.pricing-period {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 500;
}
.pricing-plan-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 8px 0 0 0;
}
.pricing-features {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    color: #495057;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}
.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}
.pricing-check {
    color: #667eea;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.pricing-card-pro .pricing-check {
    color: #667eea;
}
.pricing-card-footer {
    margin-top: auto;
}
.pricing-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
}
.pricing-btn-free {
    background: #f1f5f9;
    color: #495057;
}
.pricing-btn-free:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}
.pricing-btn-pro {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
.pricing-btn-pro:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}

/* Bloque colapsable "¿Qué es FlatDetective?" */
.what-is-flatdetective {
    margin: 20px 40px 24px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #495057;
}
.what-is-flatdetective summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #6c757d;
}
.what-is-flatdetective summary::-webkit-details-marker { display: none; }
.what-is-flatdetective summary::marker { content: none; }
.what-is-flatdetective summary::after {
    content: '▶';
    margin-left: auto;
    font-size: 0.75rem;
    color: #adb5bd;
    transition: transform 0.2s ease;
}
.what-is-flatdetective[open] summary::after {
    transform: rotate(90deg);
}
.what-is-icon {
    font-size: 1rem;
    opacity: 0.85;
}
.what-is-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    line-height: 1.6;
}
.what-is-content p {
    margin: 0 0 8px 0;
}
.what-is-content p:last-child {
    margin-bottom: 0;
}

.historic-intro {
    margin: 24px 40px 16px;
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
    text-align: center;
}

.error-message {
    margin: 20px 40px;
    padding: 16px 20px;
    background: #fee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #c62828;
    font-weight: 500;
}

.not-found-panel {
    max-width: 600px;
    margin: 24px auto;
    padding: 32px 28px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    text-align: center;
}
.not-found-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 12px;
}
.not-found-text {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 8px;
}
.not-found-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0 16px;
}
.not-found-btn-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    min-width: 220px;
}
.not-found-btn-secondary {
    padding: 10px 24px;
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 220px;
    transition: background 0.2s, color 0.2s;
}
.not-found-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.08);
}
.not-found-cities {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 8px;
    line-height: 1.5;
}
.not-found-cities a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}
.not-found-cities a:hover {
    text-decoration: underline;
}

#results {
    padding: 40px;
}

section {
    margin-bottom: 50px;
}

section:last-child {
    margin-bottom: 0;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 4px 0 0 0;
    font-weight: 400;
}

.characteristics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.negotiation-hint {
    margin: 16px 0 0;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    background: rgba(102, 126, 234, 0.06);
    border-left: 3px solid #667eea;
    border-radius: 4px;
}

.characteristic-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.characteristic-card:hover {
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.characteristic-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 10px;
    color: #667eea;
}
.characteristic-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.75;
}

.lock-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    color: #cbd5e1;
    stroke-width: 2;
}

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

.characteristic-card-highlighted {
    background: #fffbeb;
    border-color: #fcd34d;
}

.characteristic-card-highlighted .characteristic-icon {
    background: #fef3c7;
    color: #d97706;
}

.characteristic-card-highlighted:hover {
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.2);
}

.characteristic-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.characteristic-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.characteristic-info-icon {
    margin-left: 3px;
    cursor: help;
    vertical-align: middle;
    display: inline-flex;
}
.info-icon {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    stroke-width: 2;
}

.characteristic-note {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 5px 0 0 0;
    line-height: 1.35;
    font-weight: 400;
}

.characteristic-card-locked {
    opacity: 0.85;
    border-style: dashed;
    border-color: #cbd5e1;
}
.characteristic-card-locked .characteristic-icon {
    opacity: 0.5;
}
.characteristic-card-locked .characteristic-value-locked {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 1.1rem;
}
.characteristic-card-locked .characteristic-pro-cta {
    font-size: 0.75rem;
    color: #667eea;
    margin-top: 4px;
    font-weight: 600;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    margin-top: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px;
}
.chart-placeholder-inner {
    text-align: center;
    max-width: 420px;
    width: 100%;
}
/* Micro-pista visual: mini-eje sin valores + línea difuminada + puntos borrosos */
.chart-placeholder-preview {
    width: 100%;
    max-width: 280px;
    height: 120px;
    margin: 0 auto 20px;
    opacity: 0.5;
}
.chart-placeholder-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.chart-placeholder-axis {
    stroke: #adb5bd;
    stroke-width: 1;
    opacity: 0.7;
}
.chart-placeholder-line {
    stroke: rgba(102, 126, 234, 0.5);
    stroke-width: 2;
    stroke-dasharray: 6 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: blur(0.5px);
}
.chart-placeholder-dot {
    fill: rgba(102, 126, 234, 0.4);
    filter: blur(0.8px);
}
.chart-placeholder-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 8px;
}
.chart-placeholder-sub {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 24px;
}
.btn-chart-cta {
    margin-top: 0;
}
.chart-placeholder-hint {
    font-size: 0.82rem;
    color: #6c757d;
    margin-top: 16px;
    line-height: 1.4;
}

.history-table-intro {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 16px;
    line-height: 1.5;
}
.history-free-cta {
    margin-top: 24px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.history-free-cta .history-free-cta-text {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}
.history-free-cta-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 14px;
}
.history-free-cta-intro {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 14px;
}
.history-free-cta-subtitle {
    font-size: 0.82rem;
    color: #6c757d;
    margin-top: 10px;
    line-height: 1.4;
}
.history-free-cta ul {
    margin: 0 0 20px 1.2em;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.7;
}
.history-free-cta-footer {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 14px;
    line-height: 1.4;
}
.history-row-skeleton .skeleton-cell {
    color: #adb5bd;
    font-weight: 500;
}

/* Botón descarga PDF (Pro) */
.pdf-download-section {
    text-align: center;
    margin: 32px 0 8px;
    padding: 0 20px;
}
.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
}
.btn-download-pdf:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.btn-download-pdf:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
.btn-download-pdf .pdf-btn-icon {
    width: 18px;
    height: 18px;
}

.search-again-container {
    text-align: center;
    margin: 18px 0 8px;
}
.btn-search-again {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    background: transparent;
    border: 1.5px solid #667eea;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-search-again:hover {
    background: #667eea;
    color: #fff;
}

/* KPIs de resumen del gráfico */
.chart-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 0;
}
.chart-kpi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: box-shadow 0.2s ease;
}
.chart-kpi:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}
.chart-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 600;
}
.chart-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}
.chart-kpi-value.kpi-negative {
    color: #ef4444;
}
.chart-kpi-value.kpi-positive {
    color: #22c55e;
}

.chart-single-msg {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #64748b;
}

.chart-container {
    position: relative;
    height: 420px;
    margin-top: 16px;
    background: #fff;
    padding: 24px 20px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    margin-top: 12px;
    padding: 8px 16px;
    font-size: 0.82rem;
    color: #6b7280;
}
.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chart-legend-line {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2.5px solid;
    vertical-align: middle;
}
.chart-legend-line--price {
    border-color: #667eea;
}
.chart-legend-line--market {
    border-color: rgba(234, 88, 12, 0.7);
    border-top-style: dashed;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody td {
    padding: 14px 16px;
    font-size: 0.95rem;
}

.event-badge {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
}

.event-badge.new {
    color: #1976d2;
}

.event-badge.price-change {
    color: #f57c00;
}

.event-badge.republication {
    color: #7b1fa2;
}

.event-badge.reactivation {
    color: #2e7d32;
}

.event-badge.inferred {
    opacity: 0.7;
    font-style: italic;
}

.inferred-row {
    opacity: 0.8;
    background-color: rgba(102, 126, 234, 0.04);
}

.fecha-desconocida {
    font-style: italic;
    color: #9ca3af;
}

/* Variación: verde = bajada, rojo = subida */
.price-change-positive {
    color: #2e7d32;
    font-weight: 600;
}

.price-change-negative {
    color: #c62828;
    font-weight: 600;
}

.price-above-market {
    color: #f44336;
    font-weight: 700;
    font-size: 1.1em;
}

.price-below-market {
    color: #4caf50;
    font-weight: 700;
    font-size: 1.1em;
}

.negotiation-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 0.02em;
}

.negotiation-high {
    background: rgba(76, 175, 80, 0.13);
    color: #2e7d32;
}

.negotiation-medium {
    background: rgba(255, 152, 0, 0.13);
    color: #e65100;
}

.negotiation-low {
    background: rgba(158, 158, 158, 0.13);
    color: #616161;
}

/* Tablet y móvil */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .header-brand-and-user {
        margin-left: 0;
    }

    .header-text-container {
        align-items: center;
        text-align: center;
    }

    .header-legal .header-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
    .header-legal .header-logo-block {
        justify-self: center;
        align-items: center;
    }
    .header-legal .header-logo-block a {
        align-items: center !important;
    }
    .header-legal .header-text-container {
        grid-column: 1;
        justify-self: center;
    }

    .header-logo-block {
        margin-left: 0;
        align-items: center;
    }

    .header-logo {
        height: 50px;
    }

    header h1 {
        font-size: 1.8rem;
    }
    header h1.main-title {
        font-size: 1.6rem;
    }

    .search-section,
    #results {
        padding: 20px;
    }

    .home-other-cities .home-city-pills {
        margin-top: 10px;
        gap: 6px 8px;
    }
    .home-city-pill {
        padding: 3px 7px;
        font-size: 0.78rem;
    }

    .pricing-section {
        padding: 28px 16px;
    }
    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .pricing-title {
        font-size: 1.35rem;
    }

    .characteristics-grid {
        grid-template-columns: 1fr;
    }

    .chart-kpis {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .chart-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }

    .chart-container {
        height: 320px;
    }

    /* Tabla: vista tarjetas en móvil */
    .table-container thead {
        display: none;
    }

    .table-container tbody tr {
        display: block;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        background: white;
    }

    .table-container tbody tr:hover {
        background: #f8f9fa;
    }

    .table-container tbody td {
        display: block;
        padding: 6px 0;
        border: none;
        font-size: 0.9rem;
    }

    .table-container tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: block;
        margin-bottom: 2px;
    }

    .table-container tbody td:first-child {
        padding-top: 0;
    }

    .table-container tbody td:last-child {
        padding-bottom: 0;
    }

    .table-container tbody tr td[data-label]:first-child::before {
        margin-top: 0;
    }

    /* Footer en tablet/móvil: más aire y legibilidad */
    .site-footer {
        padding: 28px 24px 32px;
    }
    .footer-disclaimer {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 20px;
        padding: 0 4px;
    }
    .footer-links {
        gap: 24px;
        row-gap: 12px;
    }
    .footer-links a {
        font-size: 0.95rem;
        padding: 4px 0;
    }
}

/* Móvil pequeño: formulario full-width y touch targets */
@media (max-width: 576px) {
    body {
        padding: 12px;
    }

    header {
        padding: 24px 20px;
    }

    .search-section,
    #results {
        padding: 16px;
    }

    .error-message {
        margin: 12px 16px;
    }

    header h1 {
        font-size: 1.5rem;
    }
    header h1.main-title {
        font-size: 1.35rem;
    }

    .subtitle,
    .hero-tension {
        font-size: 0.95rem;
    }
    .hero-emotional {
        font-size: 0.88rem;
    }
    .hero-tension-cta {
        font-size: 0.85rem;
    }
    .hero-authority {
        font-size: 0.85rem;
    }

    .input-group input,
    .input-group button {
        width: 100%;
        min-height: 48px;
        padding: 14px 16px;
    }

    .input-group button {
        justify-content: center;
    }

    .home-example-card {
        margin-top: 16px;
        padding: 12px 14px;
    }
    .home-barcelona-block {
        margin-top: 12px;
        padding: 14px 16px;
    }
    .home-barcelona-link {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .section-header {
        margin-bottom: 16px;
    }
    .section-header h2 {
        font-size: 1.2rem;
    }

    .chart-kpis {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .chart-kpi {
        padding: 10px 12px;
    }
    .chart-kpi-value {
        font-size: 1.05rem;
    }

    .chart-container {
        height: 280px;
        padding: 12px;
    }

    .characteristic-card {
        padding: 14px;
        gap: 12px;
    }
    .characteristic-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .characteristic-icon svg {
        width: 18px;
        height: 18px;
    }
    .characteristic-value {
        font-size: 1.05rem;
    }

    .table-container tbody tr {
        padding: 12px;
    }

    /* Footer en móvil: más padding y espacio entre texto y enlaces */
    .site-footer {
        padding: 32px 20px 40px;
    }
    .footer-disclaimer {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 24px;
        padding: 0 8px;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .footer-links a {
        font-size: 1rem;
        padding: 8px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Móvil muy pequeño */
@media (max-width: 375px) {
    body {
        padding: 8px;
    }

    header {
        padding: 20px 16px;
    }

    .search-section,
    #results {
        padding: 12px;
    }

    header h1 {
        font-size: 1.35rem;
    }
    header h1.main-title {
        font-size: 1.2rem;
    }
    .hero-tension {
        font-size: 0.9rem;
    }
    .hero-emotional {
        font-size: 0.82rem;
    }
    .hero-tension-cta {
        font-size: 0.8rem;
    }
    .hero-authority {
        font-size: 0.8rem;
    }

    .container {
        border-radius: 12px;
    }

    .chart-kpi-value {
        font-size: 1rem;
    }

    .chart-container {
        height: 260px;
    }

    /* Footer en móvil muy pequeño */
    .site-footer {
        padding: 28px 16px 36px;
    }
    .footer-disclaimer {
        padding: 0 4px;
    }
}

/* Footer legal y disclaimer */
.site-footer {
    padding: 24px 40px 32px;
    border-top: 1px solid #eee;
    background: #fafafa;
    text-align: center;
}
.footer-disclaimer {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto 16px;
}
.footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
@media (min-width: 769px) {
    .footer-links-row {
        flex-wrap: nowrap;
    }
}
.footer-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* Banner de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
}
.cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.cookie-banner a {
    color: #a5b4fc;
    text-decoration: underline;
}
.cookie-accept {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover {
    background: #5a67d8;
}

/* Banner discreto: confirmar email para mantener Pro (no modal) */
.confirm-email-banner {
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
    color: #92400e;
    padding: 10px 24px;
    font-size: 0.9rem;
    text-align: center;
}
.confirm-email-banner p {
    margin: 0;
}

/* Mensaje suave tras volver del pago */
.payment-confirm-message {
    background: #ecfdf5;
    border-bottom: 1px solid #10b981;
    color: #065f46;
    padding: 12px 24px;
    font-size: 0.9rem;
    text-align: center;
}
