/**
 * AlertaIncidencia.com - Tema moderno y colorido
 * Se carga DESPUÉS de main.css / feed.css / mobile.css y los redefine:
 *  - paleta de marca (rojo alarma, naranja, amarillo rayo, azul y violeta)
 *  - modo claro / oscuro  (html[data-tema="oscuro"], botón en la cabecera)
 *  - columna de publicidad, banners horizontales
 *  - hero, mascota «Alerti», footer, botones de subir/bajar
 */

/* ============================================
   PALETA
   ============================================ */
:root {
    --rojo: #E5231B;
    --naranja: #FF6B00;
    --naranja-dark: #E55A00;
    --amarillo: #FFC400;
    --azul: #2563EB;
    --violeta: #7C3AED;
    --verde: #16A34A;
    --rosa: #DB2777;

    --grad-marca: linear-gradient(135deg, #FF6B00 0%, #E5231B 100%);
    --grad-arcoiris: linear-gradient(90deg, #E5231B, #FF6B00, #FFC400, #16A34A, #2563EB, #7C3AED);
    --grad-hero: linear-gradient(135deg, #FF6B00 0%, #E5231B 45%, #7C3AED 100%);

    --bg: #FFF8F2;
    --bg-alt: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #FFF1E6;
    --linea: #F1DCCB;
    --tinta: #1A1A1A;
    --tinta-suave: #5A5148;
    --sombra-card: 0 6px 22px rgba(229, 90, 0, 0.10);
    --sombra-card-hover: 0 14px 34px rgba(229, 35, 27, 0.18);
    --radio-card: 18px;
    --rail: 200px;
}

html[data-tema="oscuro"] {
    color-scheme: dark;
    --bg: #0E1118;
    --bg-alt: #141824;
    --surface: #171C29;
    --surface-2: #1F2535;
    --linea: #2B3347;
    --tinta: #EEF0F6;
    --tinta-suave: #A9B0C3;
    --sombra-card: 0 6px 22px rgba(0, 0, 0, 0.45);
    --sombra-card-hover: 0 14px 34px rgba(255, 107, 0, 0.22);

    /* Variables del CSS anterior (solo las usadas como TEXTO o borde; las blancas se dejan para texto sobre color) */
    --gris-texto: #EEF0F6;
    --color-gray-dark: #EEF0F6;
    --gris-medio: #A9B0C3;
    --color-gray-medium: #A9B0C3;
    --gris-claro: #232A3B;
    --color-gray-light: #232A3B;
    --gris-borde: #2B3347;
    --naranja-light: rgba(255, 107, 0, 0.16);
    --color-primary-light: rgba(255, 107, 0, 0.16);
    --sombra: 0 2px 8px rgba(0, 0, 0, 0.5);
    --box-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
    --box-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --box-shadow-lg: 0 10px 26px rgba(0, 0, 0, 0.6);
}

/* ============================================
   BASE
   ============================================ */
html { transition: background-color .3s ease; }

body {
    background:
        radial-gradient(1100px 520px at 8% -8%, rgba(255, 107, 0, 0.13), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(124, 58, 237, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--tinta);
    transition: background-color .3s ease, color .3s ease;
}

html[data-tema="oscuro"] body {
    background:
        radial-gradient(1100px 520px at 8% -8%, rgba(255, 107, 0, 0.14), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(124, 58, 237, 0.16), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

a { transition: color .2s ease; }

/* ============================================
   SUPERFICIES EN MODO OSCURO
   (las que el CSS antiguo pinta con blanco fijo)
   ============================================ */
html[data-tema="oscuro"] .main-nav,
html[data-tema="oscuro"] .dropdown-menu,
html[data-tema="oscuro"] .card,
html[data-tema="oscuro"] .card-incidencia,
html[data-tema="oscuro"] .search-overlay,
html[data-tema="oscuro"] .search-header,
html[data-tema="oscuro"] .no-results,
html[data-tema="oscuro"] .category-bar,
html[data-tema="oscuro"] .incidencia-card,
html[data-tema="oscuro"] .incidencia-item,
html[data-tema="oscuro"] .profile-tabs,
html[data-tema="oscuro"] .user-info-section,
html[data-tema="oscuro"] .incidencia-description-full,
html[data-tema="oscuro"] .comments-section-full,
html[data-tema="oscuro"] .related-card,
html[data-tema="oscuro"] .modal-content,
html[data-tema="oscuro"] .mobile-search-overlay,
html[data-tema="oscuro"] .info-section,
html[data-tema="oscuro"] .perfil-header,
html[data-tema="oscuro"] .modal-alert-box {
    background-color: var(--surface) !important;
    color: var(--tinta);
}

html[data-tema="oscuro"] main.login-container { background-color: var(--bg) !important; }
html[data-tema="oscuro"] .login-card { background-color: var(--surface) !important; color: var(--tinta); }
html[data-tema="oscuro"] .input-with-icon input,
html[data-tema="oscuro"] .input-with-icon input:focus,
html[data-tema="oscuro"] .search-input,
html[data-tema="oscuro"] .search-input:focus,
html[data-tema="oscuro"] .search-btn,
html[data-tema="oscuro"] .filter-select,
html[data-tema="oscuro"] input[type="text"],
html[data-tema="oscuro"] input[type="email"],
html[data-tema="oscuro"] input[type="password"],
html[data-tema="oscuro"] input[type="search"],
html[data-tema="oscuro"] input[type="tel"],
html[data-tema="oscuro"] input[type="number"],
html[data-tema="oscuro"] textarea,
html[data-tema="oscuro"] select {
    background-color: var(--surface-2) !important;
    color: var(--tinta) !important;
    border-color: var(--linea) !important;
}
html[data-tema="oscuro"] ::placeholder { color: var(--tinta-suave); opacity: .8; }

html[data-tema="oscuro"] .modal-alert-btn.secondary { background: var(--surface-2); color: var(--tinta); }
html[data-tema="oscuro"] .mobile-search-close { background-color: var(--surface-2); color: var(--tinta); }
html[data-tema="oscuro"] .alert-error, html[data-tema="oscuro"] .alerta-error { background-color: rgba(220, 53, 69, .18); color: #ffb3bb; }
html[data-tema="oscuro"] .alert-warning { background-color: rgba(255, 193, 7, .16); color: #ffe08a; }
html[data-tema="oscuro"] .alert-success { background-color: rgba(40, 167, 69, .18) !important; color: #9be7b0 !important; }
html[data-tema="oscuro"] .adsense-placeholder { background-color: var(--surface-2); }

/* Los fondos «gris oscuro» del CSS antiguo seguían siendo oscuros: se mantienen oscuros */
html[data-tema="oscuro"] .hamburger,
html[data-tema="oscuro"] .media-container,
html[data-tema="oscuro"] .main-photo,
html[data-tema="oscuro"] .photo-thumbnails,
html[data-tema="oscuro"] .media-preview { background-color: #0a0d14 !important; }
html[data-tema="oscuro"] .btn-secondary:hover { background-color: #2b3347; color: #fff; }
@media (max-width: 768px) { html[data-tema="oscuro"] .nav-menu { background-color: #0a0d14; } }

html[data-tema="oscuro"] .category-chip { background-color: var(--surface-2); color: var(--tinta); }
html[data-tema="oscuro"] .btn-outline-naranja:hover { background-color: rgba(255, 107, 0, .16); }

/* ============================================
   NAVEGACIÓN
   ============================================ */
.main-nav {
    border-bottom: 3px solid transparent;
    border-image: var(--grad-arcoiris) 1;
    box-shadow: 0 4px 18px rgba(229, 35, 27, 0.10);
}
.logo-link { gap: 8px; }
.logo-mascota { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(229, 35, 27, .35)); transition: transform .25s; }
.logo-link:hover .logo-mascota { transform: rotate(-10deg) scale(1.1); }
.logo-text { font-weight: 800; background: var(--grad-marca); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; letter-spacing: -.01em; }
html[data-tema="oscuro"] .logo-text { background: linear-gradient(135deg, #FFB067 0%, #FF6B6B 100%); -webkit-background-clip: text; background-clip: text; }

.btn-naranja { background: var(--grad-marca); box-shadow: 0 4px 12px rgba(229, 35, 27, .28); font-weight: 700; }
.btn-naranja:hover { background: var(--grad-marca); filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(229, 35, 27, .35); }
.btn-outline-naranja { font-weight: 700; }

/* Botón de tema claro/oscuro */
.theme-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%; cursor: pointer;
    border: 1.5px solid var(--linea); background: var(--surface-2); color: var(--tinta);
    font-size: 1.05rem; transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
}
.theme-btn:hover { border-color: var(--naranja); transform: rotate(18deg) translateY(-1px); box-shadow: 0 6px 16px rgba(255, 107, 0, .3); }
.theme-btn .i-sun { display: none; color: #FFC400; }
.theme-btn .i-moon { color: #7C3AED; }
html[data-tema="oscuro"] .theme-btn .i-sun { display: inline-block; }
html[data-tema="oscuro"] .theme-btn .i-moon { display: none; }
.nav-actions { gap: 10px; }

/* Desktop: la barra y el contenido dejan sitio a la columna de publicidad */
@media (min-width: 1200px) {
    body.has-rail { padding-right: var(--rail); }
    body.has-rail .main-nav { width: calc(100% - var(--rail)); }
    body.has-rail .category-bar { top: var(--altura-nav); }
}

/* ============================================
   HERO (página de inicio)
   ============================================ */
.hero {
    position: relative; overflow: hidden;
    max-width: 1800px; margin: 18px auto 6px; padding: 0 var(--spacing-md);
}
.hero-in {
    position: relative; display: grid; grid-template-columns: 1.4fr .8fr; align-items: center; gap: 12px;
    background: var(--grad-hero); color: #fff; border-radius: 28px; padding: 34px 40px 30px;
    box-shadow: 0 18px 44px rgba(229, 35, 27, .28); overflow: hidden;
}
.hero-in::before {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(420px 260px at 82% 30%, rgba(255, 212, 0, .38), transparent 65%),
        radial-gradient(360px 240px at 5% 105%, rgba(255, 255, 255, .20), transparent 65%);
    pointer-events: none;
}
.hero-in > * { position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 99px; backdrop-filter: blur(4px); }
.hero h1 { font-size: clamp(1.7rem, 3.2vw, 2.9rem); line-height: 1.08; font-weight: 900; margin: 14px 0 10px; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: #FFE14D; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.hero p { max-width: 560px; font-size: 1.05rem; opacity: .96; margin-bottom: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 99px; font-weight: 800; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.hero-btn.primario { background: #FFD400; color: #1a1a1a; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.hero-btn.secundario { background: rgba(255, 255, 255, .18); color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); }
.hero-btn:hover { transform: translateY(-3px); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 22px; }
.hero-stats div b { display: block; font-size: 1.5rem; font-weight: 900; color: #FFE14D; line-height: 1; }
.hero-stats div span { font-size: .8rem; opacity: .92; }
.hero-art { display: flex; justify-content: center; align-items: flex-end; min-height: 250px; }
.hero-art > img, .hero-art > .alerti-vivo { width: min(100%, 300px); height: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .35)); animation: flotar 4.2s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-12px) rotate(1.5deg); } }

/* ============================================
   FEED
   ============================================ */
.category-bar { border-bottom: 1px solid var(--linea); }
.category-chip { font-weight: 700; border: 1.5px solid transparent; border-radius: 99px; }
.category-chip:hover { border-color: var(--chip, var(--naranja)); color: var(--chip, var(--naranja)); transform: translateY(-1px); }
.category-chip.active { background: var(--chip, var(--naranja)) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.category-chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chip, var(--naranja)); margin-right: 7px; }
.category-chip.active .dot { background: #fff; }

.incidencia-card {
    border-radius: var(--radio-card);
    border: 1px solid var(--linea);
    box-shadow: var(--sombra-card);
    position: relative;
}
.incidencia-card::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
    background: var(--cat, var(--naranja)); opacity: .9;
}
.incidencia-card:hover { box-shadow: var(--sombra-card-hover); transform: translateY(-6px); }
.featured-badge { background: linear-gradient(135deg, #FFC400, #FF6B00) !important; color: #1a1a1a !important; font-weight: 800; box-shadow: 0 4px 10px rgba(255, 107, 0, .4); }

.pagination-btn { border-radius: 99px; font-weight: 700; }

/* ============================================
   PUBLICIDAD
   ============================================ */
.ad-box { position: relative; display: block; margin: 12px auto; text-align: center; }
.ad-tag { position: absolute; top: 6px; left: 8px; z-index: 2; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none; }
.ad-top { max-width: 728px; min-height: 90px; }
.ad-top:not(.ad-house) img { display: block; width: 100%; height: auto; border-radius: 14px; }
.ad-feed { width: 100%; }
.ad-feed:not(.ad-house) img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 14px; }
.ad-adsense { min-height: 50px; }

.ad-house {
    display: flex; align-items: center; gap: 16px; text-decoration: none; color: #fff; text-align: left;
    background: linear-gradient(120deg, var(--ad-c, #FF6B00), #1b1032); border-radius: 16px; overflow: hidden;
    padding: 12px 18px; box-shadow: var(--sombra-card); transition: transform .2s, box-shadow .2s;
}
.ad-house:hover { transform: translateY(-3px); box-shadow: var(--sombra-card-hover); }
.ad-sys-advertise { background: linear-gradient(120deg, #FF6B00, #B91C1C 60%, #7C3AED); }
.ad-sys-reportar { background: linear-gradient(120deg, #7C3AED, #DB2777 70%, #FF6B00); }
.ad-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ad-copy small { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .9; }
.ad-copy b { font-size: 1.35rem; font-weight: 900; color: #FFE14D; text-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.ad-copy em { font-style: normal; font-size: .92rem; opacity: .95; }
.ad-cta { flex-shrink: 0; background: #FFD400; color: #1a1a1a; font-weight: 800; padding: 10px 18px; border-radius: 99px; font-size: .9rem; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); }
.ad-mascot { width: 62px; height: 62px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.ad-project-img { width: 52px; height: 72px; object-fit: cover; object-position: top; border-radius: 8px; flex-shrink: 0; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }

/* publicidad dentro del feed: franja horizontal 728×90 en una fila completa de la cuadrícula */
.card-anuncio { grid-column: 1 / -1; display: block; }
.card-anuncio .ad-box { margin: 4px auto; }

/* Columna derecha (solo escritorio ancho) */
.ad-rail {
    position: fixed; top: 0; right: 0; bottom: 0; width: var(--rail); z-index: 900;
    display: none; flex-direction: column; align-items: center; padding: 8px 10px 6px;
    background: var(--surface); border-left: 1px solid var(--linea); overflow-y: auto; scrollbar-width: thin;
}
@media (min-width: 1200px) { .ad-rail { display: flex; } }
.ad-rail-label { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tinta-suave); font-weight: 800; margin-bottom: 4px; }
.ad-slot { width: 180px; margin-bottom: 8px; }
.ad-slot iframe { display: block; border: 0; width: 180px; border-radius: 14px; background: var(--surface-2); }
.ad-rail-here { margin-top: auto; display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; font-weight: 800; color: var(--tinta-suave); text-decoration: none; padding: 4px 6px; }
.ad-rail-here:hover { color: var(--naranja); }

/* ============================================
   MASCOTA «ALERTI»
   ============================================ */
.alerti { position: fixed; left: 16px; bottom: 16px; z-index: 1100; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
.alerti > * { pointer-events: auto; }
.alerti-bubble {
    position: relative; max-width: 270px; background: var(--surface); color: var(--tinta);
    border: 2px solid var(--naranja); border-radius: 18px 18px 18px 4px; padding: 12px 34px 12px 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2); font-size: .9rem; line-height: 1.35;
    animation: alerti-in .35s cubic-bezier(.2, 1.4, .4, 1);
}
.alerti-bubble[hidden] { display: none; }
.alerti-bubble strong { color: var(--rojo); }
html[data-tema="oscuro"] .alerti-bubble strong { color: #ff8a80; }
.alerti-x { position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; border: 0; background: transparent; color: var(--tinta-suave); cursor: pointer; font-size: 1.1rem; line-height: 1; border-radius: 50%; }
.alerti-x:hover { background: var(--surface-2); color: var(--tinta); }
.alerti-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.alerti-actions a { font-size: .78rem; font-weight: 800; text-decoration: none; padding: 6px 11px; border-radius: 99px; background: var(--grad-marca); color: #fff; }
.alerti-actions a.alt { background: var(--surface-2); color: var(--tinta); border: 1px solid var(--linea); }
.alerti-btn { position: relative; width: 86px; height: 104px; border: 0; padding: 0; background: transparent; cursor: pointer; transition: transform .25s; }
.alerti-btn > img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); animation: flotar 3.6s ease-in-out infinite; }
.alerti-btn > .alerti-vivo { width: auto; height: 100%; margin: 0 auto; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); animation: flotar 3.6s ease-in-out infinite; }
.alerti-btn:hover { transform: scale(1.08) rotate(-4deg); }
.alerti-btn:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 4px; border-radius: 16px; }
.alerti-dot { position: absolute; top: 6px; right: 8px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; animation: pulso 1.8s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes alerti-in { from { opacity: 0; transform: translateY(12px) scale(.9); } to { opacity: 1; transform: none; } }

/* ============================================
   SUBIR / BAJAR
   ============================================ */
.jump { position: fixed; right: 16px; bottom: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1200px) { body.has-rail .jump { right: calc(var(--rail) + 16px); } }
.jump-btn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--linea); background: var(--surface); color: var(--tinta); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); transition: transform .2s, background .2s, color .2s; }
.jump-btn:hover { background: var(--grad-marca); color: #fff; border-color: transparent; transform: translateY(-3px); }

/* ============================================
   FOOTER (estructura tipo Akrahanza)
   ============================================ */
.main-footer.foot { position: relative; background: var(--bg-alt); color: var(--tinta); border-top: 1px solid var(--linea); padding: 0; margin-top: 56px; overflow: hidden; }
html[data-tema="oscuro"] .main-footer.foot { background: #0A0D14; }
.foot-glow { position: absolute; left: 0; right: 0; top: -1px; height: 4px; background: var(--grad-arcoiris); }
.foot-wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--spacing-md); }
.foot-cta {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between;
    margin: 34px auto 0; padding: 22px 28px; border-radius: 22px; color: #fff; background: var(--grad-hero);
    box-shadow: 0 14px 34px rgba(229, 35, 27, .25);
}
.foot-cta h3 { font-size: 1.35rem; font-weight: 900; margin: 0; color: #fff; text-transform: none; letter-spacing: 0; }
.foot-cta p { margin: 2px 0 0; opacity: .95; font-size: .95rem; }
.foot-cta .hero-btn { padding: 11px 22px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr .8fr .9fr 1.1fr; gap: 34px; padding: 40px 0 28px; }
.foot-brand .foot-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 14px; }
.foot-brand .foot-logo img { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(229, 35, 27, .4)); }
.foot-brand .foot-logo span { font-size: 1.35rem; font-weight: 900; background: var(--grad-marca); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.foot-brand p, .foot-note { color: var(--tinta-suave); font-size: .93rem; line-height: 1.55; }
.main-footer.foot h3 { font-size: .85rem; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .12em; color: var(--tinta-suave); font-weight: 800; }
.main-footer.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.main-footer.foot a { text-decoration: none; color: var(--tinta); }
.main-footer.foot ul a:hover { color: var(--naranja); }
.foot-contact li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; color: var(--tinta); }
.foot-contact i { color: var(--naranja); margin-top: 4px; width: 16px; text-align: center; }
.foot-contact small { display: block; color: var(--tinta-suave); font-size: .82rem; }
.foot-social { display: flex !important; flex-wrap: wrap; gap: 10px !important; }
.foot-social a, .foot-social button {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--linea); color: var(--tinta); font-size: 1.1rem; transition: transform .2s, background .2s, color .2s;
}
.foot-social a:hover, .foot-social button:hover { transform: translateY(-4px) rotate(-6deg); background: var(--grad-marca); color: #fff !important; border-color: transparent; }
.foot-bottom { border-top: 1px solid var(--linea); padding: 16px 0; font-size: .86rem; color: var(--tinta-suave); }
.foot-bottom .foot-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 18px; }
.main-footer.foot .foot-admin { color: var(--tinta-suave); text-decoration: underline; text-underline-offset: 3px; }
.main-footer.foot .foot-admin:hover { color: var(--tinta); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
    .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .hero-in { grid-template-columns: 1fr; padding: 26px 22px 18px; text-align: center; }
    .hero p { margin-left: auto; margin-right: auto; }
    .hero-cta, .hero-stats { justify-content: center; }
    .hero-art { min-height: 0; order: -1; }
    .hero-art > img, .hero-art > .alerti-vivo { width: 150px; }
}
@media (max-width: 768px) {
    .hero { padding: 0 var(--spacing-sm); margin-top: 10px; }
    .logo-mascota { width: 32px; height: 32px; }
    .theme-btn { width: 36px; height: 36px; }
    .alerti-btn { width: 64px; height: 78px; }
    .alerti-bubble { max-width: 220px; font-size: .84rem; }
    /* el botón + y el buscador móvil siguen en la barra: dejamos aire */
    .alerti { left: 8px; bottom: 8px; }
    .jump { right: 10px; bottom: 10px; }
    .jump-btn { width: 38px; height: 38px; }
    .ad-house { padding: 10px 12px; gap: 10px; }
    .ad-copy b { font-size: 1.05rem; }
    .ad-copy em { font-size: .8rem; }
    .ad-cta { padding: 8px 12px; font-size: .8rem; }
    .ad-mascot { width: 44px; height: 44px; }
    .ad-project-img { display: none; }
}
@media (max-width: 600px) {
    .foot-grid { grid-template-columns: 1fr; gap: 26px; }
    .foot-cta { text-align: center; justify-content: center; }
    .foot-bottom .foot-wrap { flex-direction: column; text-align: center; }
}
@media (max-width: 420px) {
    .ad-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-art > img, .hero-art > .alerti-vivo, .alerti-btn > img, .alerti-btn > .alerti-vivo, .alerti-dot { animation: none; }
    * { scroll-behavior: auto !important; }
}
@media print { .ad-rail, .alerti, .jump, .ad-box { display: none !important; } }

/* AdSense sin anuncio disponible: no dejamos un hueco vacío */
.ad-adsense:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.card-anuncio:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* La mascota flota abajo a la izquierda: dejamos su sitio en la barra inferior del footer */
.foot-bottom .foot-wrap { padding-left: 110px; }
@media (max-width: 600px) {
    .foot-bottom .foot-wrap { padding-left: var(--spacing-md); }
    .foot-bottom { padding-bottom: 96px; }
}

/* Hero más compacto en celular */
@media (max-width: 600px) {
    .hero-in { padding: 18px 16px 14px; border-radius: 22px; gap: 4px; }
    .hero-art > img, .hero-art > .alerti-vivo { width: 104px; }
    .hero-eyebrow { font-size: .66rem; padding: 5px 10px; }
    .hero h1 { font-size: 1.45rem; margin: 10px 0 8px; }
    .hero p { font-size: .9rem; margin-bottom: 14px; }
    .hero-btn { padding: 10px 16px; font-size: .88rem; }
    .hero-cta { gap: 8px; }
    .hero-stats { margin-top: 14px; gap: 8px 20px; }
    .hero-stats div b { font-size: 1.2rem; }
}

/* La etiqueta «Publicidad» no tapa el texto de las tarjetas propias */
.ad-house { padding-top: 24px; }
.ad-house .ad-tag { top: 5px; left: 12px; }

/* Celular: la barra superior ahora tiene tema + mapa + perfil + buscar + «+»; se compacta para que quepa todo */
@media (max-width: 480px) {
    .nav-container { padding: 0 10px; }
    .nav-actions { gap: 5px; }
    .nav-actions .theme-btn { width: 34px; height: 34px; font-size: .95rem; }
    .logo-link { gap: 5px; }
    .logo-mascota { width: 28px; height: 28px; }
    .logo-text { font-size: .92rem; }
}
@media (max-width: 360px) { .logo-text { display: none; } }

/* Login / registro en modo oscuro: el CSS antiguo fija estos textos en gris oscuro con !important */
html[data-tema="oscuro"] .login-card h1,
html[data-tema="oscuro"] .login-card h2,
html[data-tema="oscuro"] .login-card .form-group label { color: var(--tinta) !important; }
html[data-tema="oscuro"] .login-subtitle,
html[data-tema="oscuro"] .checkbox-container,
html[data-tema="oscuro"] .login-footer { color: var(--tinta-suave) !important; }
html[data-tema="oscuro"] .login-footer { border-top-color: var(--linea) !important; }

/* ============================================
   LOGIN / REGISTRO: tarjeta de tamaño cómodo
   (el CSS antiguo la dejaba en 235 px con textos de 10–12 px)
   ============================================ */
main.login-container { padding: 90px 20px 50px !important; }
.login-card {
    max-width: 440px !important; width: 100% !important;
    padding: 34px 32px 28px !important; border-radius: 22px !important;
    box-shadow: var(--sombra-card-hover) !important;
    border: 1px solid var(--linea) !important;
}
.login-header { margin-bottom: 22px !important; }
.login-icon { font-size: 2.6rem !important; margin-bottom: 8px !important; }
.login-card h1 { font-size: 1.7rem !important; margin-bottom: 6px !important; }
.login-subtitle { font-size: .95rem !important; line-height: 1.4 !important; }
.login-card .form-group { margin-bottom: 18px !important; }
.login-card .form-group label { font-size: .92rem !important; font-weight: 700 !important; margin-bottom: 7px !important; display: block; }
.input-with-icon i.fas { left: 15px !important; font-size: 1rem !important; }
.input-with-icon input {
    height: 50px !important; font-size: 1rem !important; border-radius: 12px !important;
    padding: 10px 46px 10px 44px !important; border-width: 2px !important;
}
.toggle-password { right: 8px !important; width: 38px !important; height: 38px !important; font-size: 1rem !important; }
.form-options { margin: 16px 0 22px !important; font-size: .92rem !important; flex-wrap: wrap !important; gap: 8px 14px !important; }
.checkbox-container { gap: 10px !important; font-size: .92rem !important; }
.checkbox-container input { width: 20px !important; height: 20px !important; }
.forgot-link { font-size: .92rem !important; white-space: normal !important; }
.btn-login {
    width: 100% !important; padding: 14px !important; font-size: 1.05rem !important; border-radius: 12px !important;
    background: var(--grad-marca) !important; box-shadow: 0 8px 20px rgba(229, 35, 27, .28) !important; margin-top: 6px !important;
}
.btn-login:hover { background: var(--grad-marca) !important; filter: brightness(1.07); }
.login-footer { margin-top: 20px !important; padding-top: 18px !important; font-size: .95rem !important; }
.login-card .alert { font-size: .92rem !important; }
@media (max-width: 480px) {
    main.login-container { padding: 76px 14px 36px !important; }
    .login-card { max-width: 100% !important; padding: 26px 20px 22px !important; border-radius: 18px !important; }
    .login-card h1 { font-size: 1.45rem !important; }
    .login-subtitle { font-size: .9rem !important; }
    .input-with-icon input { height: 48px !important; font-size: 1rem !important; }
    .forgot-link { font-size: .88rem !important; }
}

/* ============================================
   ALERTI: ASISTENTE-GUÍA CON VOZ
   ============================================ */
.alerti-panel {
    width: min(380px, calc(100vw - 24px)); max-width: none !important; padding: 0 !important;
    display: flex; flex-direction: column; max-height: min(78vh, 640px); overflow: hidden;
    border-radius: 20px 20px 20px 6px; font-size: .92rem;
}
.alerti-panel[hidden] { display: none; }
.alerti-head { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; color: #fff; background: var(--grad-hero); }
.alerti-head img { width: 34px; height: 42px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.alerti-head div { flex: 1; min-width: 0; line-height: 1.2; }
.alerti-head b { display: block; font-size: 1.02rem; font-weight: 900; }
.alerti-head small { opacity: .92; font-size: .74rem; }
.alerti-ic { width: 34px; height: 34px; flex-shrink: 0; border: 0; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; color: #fff; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
.alerti-ic:hover { background: rgba(255, 255, 255, .35); }
.alerti-close { font-size: 1.5rem; }
.alerti-body { padding: 14px 14px 10px; overflow-y: auto; flex: 1; scrollbar-width: thin; line-height: 1.45; }
.alerti-body p { margin: 0 0 10px; }
.al-hi { font-size: 1rem; }
.al-title { display: flex; align-items: center; gap: 8px; font-size: 1.12rem; font-weight: 900; margin-bottom: 10px; }
.al-title span { font-size: 1.4rem; }
.al-menu { display: grid; gap: 8px; margin: 6px 0 12px; }
.al-menu button { display: flex; align-items: center; gap: 11px; text-align: left; padding: 11px 13px; border-radius: 14px; border: 1.5px solid var(--linea); background: var(--surface-2); color: var(--tinta); font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.al-menu button span { font-size: 1.3rem; }
.al-menu button:hover { border-color: var(--naranja); transform: translateX(3px); box-shadow: 0 4px 12px rgba(255, 107, 0, .18); }
.al-note { font-size: .84rem; color: var(--tinta-suave); background: var(--surface-2); border-radius: 12px; padding: 9px 11px; }
.al-steps { list-style: none; counter-reset: p; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.al-steps li { counter-increment: p; position: relative; padding: 8px 10px 8px 42px; background: var(--surface-2); border-radius: 12px; min-height: 38px; }
.al-steps li::before { content: counter(p); position: absolute; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: #fff; background: var(--grad-marca); }
.al-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.al-duo > div { border-radius: 14px; padding: 10px; font-size: .82rem; line-height: 1.35; }
.al-duo b { display: block; margin-bottom: 4px; font-size: .88rem; }
.al-bad { background: rgba(229, 35, 27, .1); border: 1px solid rgba(229, 35, 27, .3); }
.al-good { background: rgba(22, 163, 74, .1); border: 1px solid rgba(22, 163, 74, .3); }
.al-list { border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; background: var(--surface-2); border: 1px solid var(--linea); }
.al-list > b { display: block; margin-bottom: 6px; }
.al-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .88rem; }
.al-list.bad { border-color: rgba(229, 35, 27, .35); } .al-list.good { border-color: rgba(22, 163, 74, .35); }
.al-list .al-steps { margin: 0; }
.al-bul { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 8px; }
.al-more { margin: 4px 0 10px; } .al-more summary { cursor: pointer; font-weight: 800; color: var(--naranja); padding: 6px 0; }
.al-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.al-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 800; font-size: .84rem; padding: 9px 14px; border-radius: 99px; color: #fff; background: var(--grad-marca); box-shadow: 0 4px 12px rgba(229, 35, 27, .25); }
.al-cta.alt { background: var(--surface-2); color: var(--tinta); border: 1px solid var(--linea); box-shadow: none; }
.al-cta.big { width: 100%; padding: 13px; font-size: 1rem; margin: 2px 0 12px; }
.al-nav { display: flex; gap: 6px; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linea); }
.al-nav button { flex: 1; border: 1px solid var(--linea); background: var(--surface-2); color: var(--tinta); border-radius: 99px; padding: 8px 6px; font: inherit; font-weight: 700; font-size: .78rem; cursor: pointer; }
.al-nav button:hover { border-color: var(--naranja); }
.al-voice { display: block; font-size: .8rem; color: var(--tinta-suave); margin-top: 8px; }
.al-voice select { width: 100%; margin-top: 4px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--linea); background: var(--surface-2); color: var(--tinta); font: inherit; }
.alerti-ask { display: flex; gap: 6px; align-items: center; padding: 9px 10px; border-top: 1px solid var(--linea); background: var(--surface); }
.alerti-ask input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 99px; border: 1.5px solid var(--linea); background: var(--surface-2); color: var(--tinta); font: inherit; font-size: .88rem; }
.alerti-ask .alerti-ic { color: var(--tinta); background: var(--surface-2); border: 1px solid var(--linea); }
.alerti-ask .alerti-ic.on { background: var(--rojo); color: #fff; animation: pulso 1.2s infinite; }
.alerti-send { width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: var(--grad-marca); font-size: .95rem; flex-shrink: 0; }
/* la mascota «habla»: se mueve mientras suena la voz */
.alerti-btn.hablando > img, .alerti-btn.hablando > .alerti-vivo { animation: hablar .5s ease-in-out infinite alternate; }
@keyframes hablar { from { transform: translateY(0) scale(1) rotate(-2deg); } to { transform: translateY(-6px) scale(1.06) rotate(2deg); } }
/* etiqueta «Guía» para quien aún no abrió la guía (no abre nada) */
.alerti-tag { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); background: var(--grad-marca); color: #fff; font-size: .68rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; box-shadow: 0 4px 10px rgba(229, 35, 27, .4); animation: pulso-tag 2s infinite; white-space: nowrap; }
.alerti-tag[hidden] { display: none; }
@keyframes pulso-tag { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.1); } }
@media (max-width: 768px) {
    .alerti-panel { font-size: .9rem; max-height: min(74vh, 560px); width: min(360px, calc(100vw - 16px)); }
    .al-duo { grid-template-columns: 1fr; }
    .alerti { left: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .alerti-btn.hablando > img, .alerti-btn.hablando > .alerti-vivo, .alerti-tag { animation: none; } }

/* Formulario de registro: ayuda bajo los campos y casilla «mismo número» */
.form-hint { display: block; margin-top: 6px; font-size: .82rem; line-height: 1.4; color: var(--tinta-suave); }
.mismo-num { display: flex !important; align-items: center; gap: 8px; margin: 8px 0 0 !important; font-size: .88rem !important; font-weight: 600 !important; cursor: pointer; color: var(--tinta-suave); }
.mismo-num input { width: 18px; height: 18px; accent-color: var(--naranja); }
.input-with-icon input[readonly] { opacity: .75; }
.input-with-icon i.fab { position: absolute !important; left: 15px !important; top: 50% !important; transform: translateY(-50%) !important; color: #999 !important; font-size: 1.05rem !important; pointer-events: none !important; z-index: 5 !important; }

/* Crédito de propiedad intelectual en el footer */
.main-footer.foot .foot-owner { font-weight: 800; color: var(--naranja); text-decoration: underline; text-underline-offset: 3px; }
.main-footer.foot .foot-owner:hover { color: var(--rojo); }

/* ============================================
   CABECERA: nada se desborda sobre la columna de publicidad
   (el buscador se encoge y, en pantallas medianas, los botones se compactan)
   ============================================ */
.nav-container { min-width: 0; gap: 12px; }
.nav-brand { min-width: 0; }
.nav-search { min-width: 0; flex: 1 1 120px; margin: 0 var(--spacing-sm); }
.search-form { min-width: 0; width: 100%; }
.search-input { min-width: 0; width: 100%; }
.nav-actions { flex-shrink: 0; }
.nav-actions .btn { white-space: nowrap; }
.user-dropdown-trigger .user-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 769px) and (max-width: 1500px) {
    .nav-container { padding: 0 14px; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn { padding: 8px 14px; font-size: .86rem; }
    .logo-text { font-size: 18px; }
    .user-dropdown-trigger .user-name { max-width: 130px; }
}
@media (min-width: 769px) and (max-width: 1360px) {
    .nav-actions .btn { padding: 7px 11px; font-size: .8rem; }
    .logo-mascota { width: 32px; height: 32px; }
    .logo-text { font-size: 16px; }
    .user-dropdown-trigger .user-name { max-width: 90px; }
    .nav-search { margin: 0 8px; }
}

/* ============================================
   BOTÓN «COMPARTE» EN LA CABECERA (panel con redes, como SPF Training)
   ============================================ */
.share-wrap { position: relative; flex-shrink: 0; }
.share-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 40px; padding: 0 1rem;
    border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 800; font-size: .88rem; color: #fff;
    background: var(--grad-marca); box-shadow: 0 6px 18px rgba(229, 35, 27, .3); transition: transform .2s, box-shadow .2s; white-space: nowrap;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(229, 35, 27, .4); }
.share-btn:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; }
/* Mensaje al pasar el puntero / dedo */
.tip {
    position: absolute; right: 0; top: calc(100% + 14px); width: min(300px, 86vw); background: #1f2430; color: #fff;
    padding: .85rem 1rem; border-radius: 16px; font-size: .88rem; line-height: 1.45; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
    opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transition: opacity .2s, transform .2s, visibility .2s; pointer-events: none; z-index: 1100;
}
.tip::before { content: ""; position: absolute; right: 26px; top: -7px; width: 14px; height: 14px; background: #1f2430; transform: rotate(45deg); border-radius: 3px; }
html[data-tema="oscuro"] .tip { background: #fff; color: #15151a; }
html[data-tema="oscuro"] .tip::before { background: #fff; }
.share-wrap:hover .tip, .share-btn:focus-visible + .tip, .share-wrap.tip-on .tip { opacity: 1; visibility: visible; transform: none; }
.share-wrap.menu-on .tip { opacity: 0; visibility: hidden; }
.share-menu {
    position: absolute; right: 0; top: calc(100% + 12px); width: min(330px, calc(100vw - 24px)); background: var(--surface); color: var(--tinta);
    border: 1px solid var(--linea); border-radius: 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .28); padding: 1rem; z-index: 1200; text-align: left;
}
.share-menu[hidden] { display: none; }
.share-title { margin: 0; font-size: 1.1rem; font-weight: 900; color: var(--rojo); }
html[data-tema="oscuro"] .share-title { color: #ff9a8a; }
.share-sub { margin: .15rem 0 .8rem; font-size: .88rem; color: var(--tinta-suave); }
.share-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.share-grid .wide { grid-column: 1 / -1; }
.share-grid a, .share-grid button {
    display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--linea); border-radius: 12px;
    background: var(--surface-2); color: var(--tinta); font: inherit; font-weight: 800; font-size: .9rem; text-decoration: none; cursor: pointer; text-align: left;
}
.share-grid a i, .share-grid button i { width: 18px; text-align: center; color: var(--naranja); }
.share-grid a:hover, .share-grid button:hover { border-color: var(--rojo); background: var(--naranja-light); }
.share-aviso { margin: .7rem 0 0; font-weight: 800; font-size: .88rem; color: var(--verde); }
.share-aviso:empty { display: none; }
.share-manual { width: 100%; margin-top: .5rem; padding: .55rem .7rem; border-radius: 10px; border: 1.5px solid var(--linea); background: var(--surface-2); color: var(--tinta); font: inherit; font-size: .82rem; }
/* pantallas medianas: solo el icono (el texto queda en el mensaje) */
@media (min-width: 769px) and (max-width: 1500px) { .share-label { display: none; } .share-btn { width: 40px; padding: 0; } }
/* celular: icono y panel a lo ancho bajo la barra */
@media (max-width: 768px) {
    .share-label { display: none; }
    .share-btn { width: 36px; height: 36px; padding: 0; }
    .share-wrap { position: static; }
    .share-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--altura-nav) + 8px); width: auto; max-width: 380px; margin-inline: auto; max-height: calc(100dvh - var(--altura-nav) - 24px); overflow-y: auto; }
    .tip { display: none; }
}
@media (max-width: 480px) { .nav-actions .share-btn { width: 34px; height: 34px; } }
