:root {
    /* Paleta corporativa — 9 colores de marca */
    --brand-navy: #0D3B66;
    --brand-teal: #41B29A;
    --brand-green: #6CC28E;
    --brand-mint: #8ED1C5;
    --brand-gold: #F4C542;
    --brand-coral: #FF7A59;
    --brand-pink: #F78DB3;
    --brand-purple: #B37AC7;
    --brand-blue: #2EA7C8;

    --primary-color: var(--brand-blue);
    --primary-hover: #227E96;
    --primary-light: #E2F3F7;
    --secondary-color: var(--brand-teal);
    --secondary-light: #E1F5F0;
    --accent-color: var(--brand-gold);
    --accent-light: #FDF3D9;
    --cta-color: var(--brand-coral);
    --cta-hover: #E85F3F;
    --cta-light: #FFE7E0;
    --bg-primary: #ffffff;
    --bg-secondary: #F8FAF8;
    --text-primary: var(--brand-navy);
    --text-secondary: #4F6178;
    --border-color: #E3E9EC;
    --success-color: var(--brand-teal);
    --error-color: #D64545;

    /* Rueda de condiciones — cada color identifica una condición real, no decoración */
    --cond-tea: var(--brand-blue);
    --cond-tdah: var(--brand-coral);
    --cond-di: var(--brand-teal);
    --cond-dislexia: var(--brand-gold);
    --cond-dispraxia: var(--brand-pink);
    --cond-lenguaje: var(--brand-mint);
    --cond-altas: var(--brand-purple);
    --cond-otras: var(--brand-green);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 999px;
    --shadow-sm: 0 2px 6px rgba(45, 55, 72, 0.06);
    --shadow-md: 0 10px 24px rgba(45, 55, 72, 0.09);
    --shadow-lg: 0 20px 44px rgba(45, 55, 72, 0.14);
    --font-heading: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 1000;
}
.skip-link:focus { left: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

img { max-width: 100%; }

a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Decorative organic blobs */
.blob {
    position: absolute;
    border-radius: 42% 58% 65% 35% / 45% 45% 55% 55%;
    filter: blur(2px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

/* Header */
.header {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .container {
    max-width: 1440px;
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}
.logo {
    flex-shrink: 0;
}
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}
.logo a:hover { text-decoration: none; }
.logo span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
}
.logo .logo-accent { color: var(--secondary-color); }
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: flex-end;
}
.nav-links {
    display: flex;
    gap: 13px;
    flex-wrap: nowrap;
}
.nav-links a {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--primary-color); text-decoration: none; border-color: var(--accent-color); }
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}
.nav-donate-btn { padding: 9px 18px; font-size: 0.88rem; white-space: nowrap; }
.user-welcome { color: var(--text-secondary); font-weight: 600; }
.btn-icon.nav-toggle { display: none; }
.nav-collapse { display: contents; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--primary-color); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 10px 20px rgba(47, 111, 143, 0.28); }
.btn-cta { background: var(--cta-color); color: #fff; box-shadow: var(--shadow-sm); }
.btn-cta:hover { background: var(--cta-hover); box-shadow: 0 10px 20px rgba(233, 139, 115, 0.35); }
.btn-outline { background: transparent; color: var(--primary-color); border-color: var(--primary-color); }
.btn-outline:hover { background: var(--primary-light); box-shadow: none; }
.btn-lg { padding: 17px 38px; font-size: 1.1rem; }
.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn-icon:hover { border-color: var(--primary-color); transform: translateY(-1px); }

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 64px;
}
.hero .blob-a { width: 420px; height: 420px; background: var(--secondary-light); top: -140px; right: -120px; }
.hero .blob-b { width: 280px; height: 280px; background: var(--accent-light); bottom: -100px; left: -80px; }
.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    color: #7a5a10;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 22px;
}
.hero-eyebrow::before { content: '✦'; color: var(--accent-color); }
.hero h1 {
    font-size: 3.2rem;
    line-height: 1.12;
    margin: 0 0 20px;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}
.hero h1 span { color: var(--cta-color); }
.hero p.lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 46ch;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stats .stat strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary-color);
}
.hero-stats .stat span { color: var(--text-secondary); font-size: 0.88rem; font-weight: 600; }

/* Hero illustration */
.hero-illustration {
    position: relative;
    height: 420px;
}
.hero-illustration .core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-illustration .core img { width: 152px; height: auto; }
.hero-illustration .chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    padding: 12px 20px 12px 12px;
    box-shadow: var(--shadow-md);
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
}
.hero-illustration .chip .chip-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.hero-illustration .chip-1 { top: 0; left: 6%; }
.hero-illustration .chip-1 .chip-dot { background: var(--secondary-light); }
.hero-illustration .chip-2 { top: 14%; right: 0; }
.hero-illustration .chip-2 .chip-dot { background: var(--accent-light); }
.hero-illustration .chip-3 { bottom: 12%; left: 0; }
.hero-illustration .chip-3 .chip-dot { background: var(--cta-light); }
.hero-illustration .chip-4 { bottom: -4px; right: 8%; }
.hero-illustration .chip-4 .chip-dot { background: var(--primary-light); }

/* Hero carousel — full-bleed: no .container wrapper, so the track spans 100% of the page width */
.hero-carousel { padding-bottom: 0; padding-top: 0; }
.carousel-track { position: relative; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease;
    pointer-events: none;
    padding: 56px 0;
    display: flex;
    align-items: center;
    height: 660px;
    overflow: hidden;
}
.hero-slide.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.hero-slide .hero-content { position: relative; z-index: 1; width: 100%; }
.hero-slide .blob { opacity: 0.5; }

.hero-slide.slide-primary { background: linear-gradient(155deg, #5DC3DD, var(--primary-color) 65%); }
.hero-slide.slide-secondary { background: linear-gradient(155deg, #6FD1B8, var(--secondary-color) 65%); }
.hero-slide.slide-cta { background: linear-gradient(155deg, #FF9C80, var(--cta-color) 65%); }

.hero-slide .hero-eyebrow { background: rgba(255, 255, 255, 0.22); color: #fff; }
.hero-slide .hero-eyebrow::before { color: var(--accent-color); }
.hero-slide h1 { color: #fff; }
.hero-slide h1 span {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 4px;
    text-underline-offset: 6px;
}
.hero-slide p.lead { color: rgba(255, 255, 255, 0.92); }
.hero-slide .hero-stats strong { color: #fff; }
.hero-slide .hero-stats span { color: rgba(255, 255, 255, 0.8); }

.hero-slide .btn-cta { background: #fff; color: var(--cta-color); }
.hero-slide .btn-cta:hover { background: var(--accent-light); }
.hero-slide .btn-outline { border-color: rgba(255, 255, 255, 0.8); color: #fff; }
.hero-slide .btn-outline:hover { background: rgba(255, 255, 255, 0.15); }

/* Landing pages por tipo de actor — hero de una pantalla, mismo lenguaje
   visual que .hero-slide (degradado + blobs + texto blanco) sin la mecánica
   de carrusel, porque son páginas de una sola pantalla, no un slider. */
.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 88px 0 80px;
}
.landing-hero .hero-content { position: relative; z-index: 1; }
.landing-hero .hero-eyebrow { background: rgba(255, 255, 255, 0.22); color: #fff; }
.landing-hero .hero-eyebrow::before { color: var(--accent-color); }
.landing-hero h1 { color: #fff; font-size: 2.9rem; line-height: 1.15; margin: 0 0 20px; letter-spacing: -0.5px; }
.landing-hero p.lead { color: rgba(255, 255, 255, 0.92); font-size: 1.15rem; margin-bottom: 32px; max-width: 46ch; }
.landing-hero .btn-cta { background: #fff; color: var(--cta-color); }
.landing-hero .btn-cta:hover { background: var(--accent-light); }
.landing-hero .btn-outline { border-color: rgba(255, 255, 255, 0.8); color: #fff; }
.landing-hero .btn-outline:hover { background: rgba(255, 255, 255, 0.15); }

.landing-hero-profesional { background: linear-gradient(155deg, #5DC3DD, var(--primary-color) 65%); }
.landing-hero-colegios { background: linear-gradient(155deg, #6FD1B8, var(--secondary-color) 65%); }
.landing-hero-organizaciones { background: linear-gradient(155deg, #FF9C80, var(--cta-color) 65%); }
.landing-hero-salud { background: linear-gradient(155deg, #C9A0D9, var(--brand-purple) 65%); }
.landing-hero-comercios { background: linear-gradient(155deg, #FBC0D9, var(--brand-pink) 65%); }
.landing-hero-comenzar { background: linear-gradient(155deg, var(--brand-mint), var(--secondary-color) 65%); }
.landing-hero-donar { background: linear-gradient(155deg, var(--brand-gold), var(--cta-color) 65%); }

.landing-hero-illustration { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; }
.landing-hero-icon {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5.5rem;
    box-shadow: var(--shadow-lg);
}

.hero-slide .hero-illustration .core { background: rgba(255, 255, 255, 0.97); }
.hero-slide .conditions-ring { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.95), var(--shadow-lg); }

.conditions-ring-sm { width: 240px; height: 240px; margin: 0 auto; }
.conditions-ring-sm .ring-label { font-size: 0.92rem; }

@media (max-width: 860px) {
    .hero-slide { padding: 36px 0; height: auto; }
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 0 28px;
    position: relative;
    z-index: 2;
}

/* Flechas superpuestas sobre el banner, siempre visibles a los costados */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 4px 16px rgba(13, 59, 102, 0.18);
    transition: background 0.18s ease, transform 0.18s ease;
}
.carousel-arrow svg { width: 24px; height: 24px; }
.carousel-arrow.prev { left: 20px; }
.carousel-arrow.next { right: 20px; }
.carousel-arrow:hover { background: rgba(255, 255, 255, 0.5); transform: translateY(-50%) scale(1.06); }

@media (max-width: 860px) {
    /* El slide crece de alto en mobile (contenido apilado): una flecha centrada
       verticalmente terminaría superpuesta al texto. Se navega con los puntos. */
    .carousel-arrow { display: none; }
}
.carousel-dots { display: flex; gap: 10px; }
.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: width 0.2s ease, background 0.2s ease;
}
.carousel-dots .dot.is-active { background: var(--primary-color); width: 26px; border-radius: var(--radius-full); }
.carousel-pause {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}
.carousel-pause:hover { border-color: var(--primary-color); }

@media (max-width: 860px) {
    .carousel-track { min-height: 0; }
}

/* Sections */
.section { position: relative; padding: 88px 0; }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-eyebrow {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #A87D0A;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}
.section-header h2 { font-size: 2.2rem; color: var(--primary-color); margin-bottom: 14px; }
.section-header p { color: var(--text-secondary); font-size: 1.08rem; }
.section-alt { background: var(--bg-primary); }
.section-blue { background: var(--primary-light); }
/* "Nuestra visión" — fila de personas de distintas edades conectadas por una
   línea punteada, mismo lenguaje visual que el conector de .steps, en vez de
   una ilustración custom (illustration-community.svg nunca existió). */
.vision-people {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    max-width: 420px;
    margin: 0 auto 48px;
}
.vision-people::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background-image: linear-gradient(to right, var(--border-color) 50%, transparent 50%);
    background-size: 16px 2px;
    transform: translateY(-50%);
    z-index: 0;
}
.vision-person {
    position: relative;
    z-index: 1;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: var(--shadow-sm);
    border: 4px solid var(--bg-primary);
}
.vision-person:nth-child(1) { background: color-mix(in srgb, var(--brand-mint) 55%, white); }
.vision-person:nth-child(2) { background: color-mix(in srgb, var(--brand-gold) 45%, white); }
.vision-person:nth-child(3) { background: color-mix(in srgb, var(--brand-coral) 40%, white); }
.vision-person:nth-child(4) { background: color-mix(in srgb, var(--brand-purple) 40%, white); }

@media (max-width: 480px) {
    .vision-people { gap: 12px; max-width: 300px; }
    .vision-person { width: 52px; height: 52px; font-size: 1.4rem; border-width: 3px; }
}

/* Cards grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
}
.card {
    display: block;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.card { text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
}
.card:nth-child(4n+1) .card-icon { background: var(--primary-light); }
.card:nth-child(4n+2) .card-icon { background: var(--secondary-light); }
.card:nth-child(4n+3) .card-icon { background: var(--accent-light); }
.card:nth-child(4n+4) .card-icon { background: var(--cta-light); }
.card h3 { font-size: 1.18rem; color: var(--text-primary); margin-bottom: 8px; }
.card p { color: var(--text-secondary); margin: 0; font-size: 0.96rem; }

/* Actor cards: cada tarjeta usa un color distinto de la rueda de condiciones */
.card-actor:nth-child(8n+1) .card-icon { background: color-mix(in srgb, var(--cond-tea) 16%, white); }
.card-actor:nth-child(8n+2) .card-icon { background: color-mix(in srgb, var(--cond-tdah) 16%, white); }
.card-actor:nth-child(8n+3) .card-icon { background: color-mix(in srgb, var(--cond-di) 16%, white); }
.card-actor:nth-child(8n+4) .card-icon { background: color-mix(in srgb, var(--cond-dislexia) 18%, white); }
.card-actor:nth-child(8n+5) .card-icon { background: color-mix(in srgb, var(--cond-dispraxia) 16%, white); }
.card-actor:nth-child(8n+6) .card-icon { background: color-mix(in srgb, var(--cond-lenguaje) 16%, white); }
.card-actor:nth-child(8n+7) .card-icon { background: color-mix(in srgb, var(--cond-altas) 16%, white); }
.card-actor:nth-child(8n+8) .card-icon { background: color-mix(in srgb, var(--cond-otras) 16%, white); }

/* Sección Comunidad (home): tarjetas de tamaño consistente centradas —
   evita que filas incompletas se estiren o dejen un hueco vacío a un lado —
   y una afordancia de "Conocer más" en las que enlazan a una landing dedicada. */
#actores-tabs .tab-list { justify-content: center; }
#actores-tabs .tab-panel { background: transparent; border: none; padding: 0; }
#actores-tabs .card-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 260px)); justify-content: center; }
#actores-tabs a.card.card-actor { position: relative; padding-bottom: 56px; }
#actores-tabs a.card.card-actor::after {
    content: 'Conocer más →';
    position: absolute;
    left: 30px;
    bottom: 24px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-color);
}
#actores-tabs a.card.card-actor:hover::after { text-decoration: underline; }

/* Condiciones que acompañamos — rueda de color */
.conditions-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 44px;
}
.conditions-ring-wrap { display: flex; justify-content: center; }
.conditions-ring {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: conic-gradient(
        var(--cond-tea) 0deg 45deg,
        var(--cond-tdah) 45deg 90deg,
        var(--cond-di) 90deg 135deg,
        var(--cond-dislexia) 135deg 180deg,
        var(--cond-dispraxia) 180deg 225deg,
        var(--cond-lenguaje) 225deg 270deg,
        var(--cond-altas) 270deg 315deg,
        var(--cond-otras) 315deg 360deg
    );
    box-shadow: var(--shadow-lg);
}
.conditions-ring::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 58%;
    height: 58%;
    border-radius: 50%;
    background: var(--bg-primary);
    box-shadow: inset 0 0 0 1px var(--border-color);
    display: flex;
}
.conditions-ring .ring-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.05rem;
    line-height: 1.25;
    width: 50%;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.legend-item .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}
.legend-item strong { display: block; font-size: 0.95rem; color: var(--text-primary); }
.legend-item span { font-size: 0.82rem; color: var(--text-secondary); }

@media (max-width: 860px) {
    .conditions-layout { grid-template-columns: 1fr; }
    .legend-grid { grid-template-columns: 1fr; }
}

/* Banners informativos */
.banners {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.banner {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 272px;
    border-radius: var(--radius-md);
    padding: 28px;
    color: #fff;
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.banner:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.banner .blob { opacity: 0.3; }
.banner-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.26);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.banner h3 { position: relative; z-index: 1; color: #fff; font-size: 1.12rem; margin-bottom: 8px; }
.banner p { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.94); font-size: 0.92rem; margin: 0; }
.banner .banner-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.55);
    padding-bottom: 2px;
    background: none;
    border-left: none; border-right: none; border-top: none;
    cursor: pointer;
    font-family: inherit;
    margin-top: auto;
    padding-top: 16px;
}
.banner .banner-link:hover { text-decoration: none; border-color: #fff; }
.banner-tag {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-top: auto;
    padding-top: 16px;
}
.banner-primary { background: var(--primary-color); background: linear-gradient(155deg, #5DC3DD, var(--primary-color) 65%); }
.banner-secondary { background: var(--secondary-color); background: linear-gradient(155deg, #6FD1B8, var(--secondary-color) 65%); }
.banner-cta { background: var(--cta-color); background: linear-gradient(155deg, #FF9C80, var(--cta-color) 65%); }

@media (max-width: 860px) {
    .banners { grid-template-columns: 1fr; }
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 12%;
    right: 12%;
    height: 2px;
    background-image: linear-gradient(to right, var(--border-color) 50%, transparent 50%);
    background-size: 16px 2px;
    z-index: 0;
}
.step { position: relative; z-index: 1; text-align: center; padding: 0 12px; }
.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.step:nth-child(2) .step-number { border-color: var(--accent-color); color: #A87D0A; }
.step:nth-child(3) .step-number { border-color: var(--cta-color); color: var(--cta-color); }
.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: 0.95rem; margin: 0; }

/* Manifesto */
.manifesto {
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 64px 48px;
    text-align: center;
    color: #fff;
}
.manifesto .blob-a { width: 300px; height: 300px; background: rgba(255,255,255,0.08); top: -100px; left: -60px; opacity: 1; }
.manifesto .blob-b { width: 220px; height: 220px; background: rgba(244,211,94,0.16); bottom: -80px; right: -40px; opacity: 1; }
.manifesto blockquote {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 720px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1.45;
}
.manifesto blockquote::before { content: '“'; color: var(--accent-color); font-size: 3rem; line-height: 0; position: relative; top: 18px; }
.manifesto cite {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 24px;
    font-weight: 700;
    font-style: normal;
    opacity: 0.85;
}

/* Final CTA */
.final-cta {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cta-color), #f0a488);
    color: #fff;
    text-align: center;
    padding: 76px 24px;
    border-radius: var(--radius-lg);
    margin: 0 24px;
}
.final-cta .blob-a { width: 260px; height: 260px; background: rgba(255,255,255,0.14); top: -90px; right: -60px; opacity: 1; }
.final-cta h2 { font-size: 2.1rem; margin-bottom: 14px; position: relative; z-index: 1; }
.final-cta p { font-size: 1.1rem; opacity: 0.95; margin-bottom: 32px; position: relative; z-index: 1; }
.final-cta .btn-primary { background: #fff; color: var(--cta-color); position: relative; z-index: 1; }
.final-cta .btn-primary:hover { background: var(--accent-light); }

/* Footer */
.footer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(165deg, #14477A, var(--brand-navy));
    margin-top: 48px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.footer .blob { opacity: 0.5; }
.footer-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 56px 24px 32px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-logo span { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; color: #fff; }
.footer-logo .logo-accent { color: var(--brand-mint); }
.footer-brand p { color: rgba(255, 255, 255, 0.75); margin-top: 14px; max-width: 32ch; }
.footer-col h4 { font-family: var(--font-heading); margin: 0 0 14px; color: #fff; font-size: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.75); font-weight: 600; }
.footer-col a:hover { color: var(--accent-color); }
.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 20px 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.75); }
.footer-bottom a:hover { color: var(--accent-color); }

/* Forms */
.form-page { position: relative; padding: 72px 0; display: flex; justify-content: center; overflow: hidden; }
.form-page .blob-a { width: 320px; height: 320px; background: var(--secondary-light); top: -100px; left: -100px; }
.form-page .blob-b { width: 240px; height: 240px; background: var(--accent-light); bottom: -80px; right: -60px; }
.form-container {
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px;
    max-width: 460px;
    width: 100%;
}
.form-container h1 { color: var(--primary-color); margin-top: 0; font-size: 1.7rem; }
.form-container .subtitle { color: var(--text-secondary); margin-bottom: 28px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.95em; }
/* Checkbox con texto largo (ej. aceptar términos) — el label por defecto de
   arriba asume una etiqueta corta sobre un campo, no un checkbox en línea
   con una oración larga, así que el checkbox y el texto quedan mal alineados
   apenas el texto pasa a una segunda línea. */
.form-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
}
.form-group .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.form-error { color: var(--error-color); font-size: 0.85em; margin-top: 6px; }
.form-actions { margin-top: 28px; }
.form-actions .btn { width: 100%; text-align: center; justify-content: center; }
.form-footer { text-align: center; margin-top: 24px; color: var(--text-secondary); }

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 200;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-weight: 700;
}
.notification.show { opacity: 1; transform: translateY(0); }
.notification-success { background: var(--secondary-color); color: #1f3d2b; }
.notification-error { background: #fbdcd6; color: #7a2c1d; }

/* Panel de administración */
.admin-header { margin-bottom: 32px; }
.admin-header p { color: var(--text-secondary); margin-top: 8px; }

/* Variante liviana para el encabezado de páginas públicas de contenido
   (ayuda, beneficios, blog) — un poco de color para que no luzcan tan
   planas al lado de las landing con hero de gradiente, sin llegar al
   tratamiento full-bleed de esas landings. */
.admin-header-public {
    background: linear-gradient(135deg, var(--primary-light), var(--bg-primary));
    border-radius: var(--radius-lg);
    padding: 32px 36px;
}

/* Breadcrumb de vuelta */
.breadcrumb-link {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.breadcrumb-link:hover { color: var(--primary-color); }

/* Menú de acciones secundarias (details/summary) */
.actions-menu { position: relative; }
.actions-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-primary);
}
.actions-menu > summary::-webkit-details-marker { display: none; }
.actions-menu > summary:hover { border-color: var(--primary-color); }
.actions-menu[open] > summary { border-color: var(--primary-color); color: var(--primary-color); }
.actions-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    z-index: 20;
}
.actions-menu-list a,
.actions-menu-list button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
}
.actions-menu-list a:hover,
.actions-menu-list button:hover { background: var(--bg-secondary); text-decoration: none; }

.badge-alerta { background: var(--cta-light); color: #8a3423; }

.admin-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.admin-filters input,
.admin-filters select {
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.admin-filters input { flex: 1 1 220px; }

.admin-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
}
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.admin-panel-header h3 { font-size: 1.2em; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}
.admin-table tr:hover td { background: var(--bg-secondary); }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8em;
    font-weight: 700;
}
.badge-active { background: var(--secondary-light); color: #1f5c45; }
.badge-inactive { background: var(--cta-light); color: #8a3423; }
/* Distinta de .badge-inactive (que significa "cancelado/pausado") — esta es
   para contadores neutros (mensajes/notificaciones sin leer), no un estado. */
.badge-count { background: var(--primary-light); color: #145E7D; }
.badge-pendiente,
.badge-programada { background: var(--accent-light); color: #7a5a10; }
.badge-en_progreso { background: var(--primary-light); color: #145E7D; }
.badge-logrado,
.badge-completada { background: var(--secondary-light); color: #1f5c45; }
.badge-cancelada,
.badge-cancelado,
.badge-no_asistio { background: var(--cta-light); color: #8a3423; }
.badge-en_espera { background: var(--accent-light); color: #7a5a10; }
.badge-promovido { background: var(--secondary-light); color: #1f5c45; }

.admin-table-actions { display: flex; align-items: center; gap: 8px; }
.admin-table-actions select {
    padding: 8px 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85em;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.tab-empty { color: var(--text-secondary); margin-bottom: 20px; }

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}
.admin-pagination-info { color: var(--text-secondary); font-size: 0.9em; }
.btn-disabled { opacity: 0.4; pointer-events: none; }

/* Pestañas del perfil de beneficiario */
.tabs { margin-top: 8px; }
.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}
.tab-button {
    padding: 10px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.tab-button:hover { border-color: var(--primary-color); text-decoration: none; }
.tab-button.is-active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.tab-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
}
.tab-panel h3 { font-size: 1.15rem; margin-bottom: 18px; }

/* Acordeón de preguntas frecuentes (Ayuda) */
.faq-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0 32px;
}
.faq-category { margin-bottom: 36px; }
.faq-category h3 {
    font-size: 1.25rem;
    margin-bottom: 14px;
    scroll-margin-top: 90px;
}
.faq-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 20px;
    margin-bottom: 10px;
}
.faq-item summary {
    padding: 14px 0;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding-bottom: 16px; color: var(--text-secondary); }

/* Formulario compacto de alta al pie de cada pestaña */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.inline-form .form-group { margin-bottom: 0; flex: 1 1 180px; }
.inline-form .form-group-wide { flex: 2 1 320px; }
.inline-form .form-actions { margin-top: 0; }
.inline-form .form-actions .btn { width: auto; }

@media (max-width: 860px) {
    /* flex-basis (el "220px"/"180px" en flex: 1 1 __px) pasa a ser la altura,
       no el ancho, en cuanto el contenedor cambia a flex-direction: column —
       sin este reset los inputs/selects quedan gigantes en mobile. */
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form .form-group,
    .inline-form .form-group-wide { flex-basis: auto; }
}

@media (max-width: 860px) {
    .admin-filters { flex-direction: column; align-items: stretch; }
    .admin-filters input,
    .admin-filters select { flex-basis: auto; }
}

@media (max-width: 860px) {
    .hero { padding: 64px 0 48px; }
    .hero h1 { font-size: 2.3rem; }
    .hero-content { grid-template-columns: 1fr; }
    .hero-illustration { height: 320px; margin-top: 24px; }
    .landing-hero { padding: 56px 0 48px; }
    .landing-hero h1 { font-size: 2.1rem; }
    .landing-hero-illustration { margin-top: 32px; }
    .landing-hero-icon { width: 150px; height: 150px; font-size: 3.6rem; }
    .steps { grid-template-columns: 1fr; gap: 48px; }
    .steps::before { display: none; }
    .footer-content { grid-template-columns: 1fr; }
}

/* El header pasa a menú hamburguesa en un umbral más ancho que el resto de
   los bloques @media de esta hoja: con el botón "Donar" sumado a logo +
   6 links + buscador + 3 botones, el ancho mínimo real que necesita todo
   junto (~1300px sin achicarse) ya no entra ni dentro del propio
   max-width del header (ver .header .container arriba), así que este
   umbral tiene que coincidir con ese max-width para que la transición a
   hamburguesa sea siempre limpia, nunca un solape a mitad de camino. */
@media (max-width: 1440px) {
    .header-content { flex-wrap: wrap; row-gap: 12px; }
    .btn-icon.nav-toggle { display: inline-flex; margin-left: auto; }
    .nav { flex-basis: 100%; }
    .nav-collapse { display: none; flex-direction: column; align-items: stretch; gap: 18px; width: 100%; }
    .nav-collapse.is-open { display: flex; }
    .nav-links { flex-direction: column; align-items: center; gap: 16px; flex-wrap: wrap; }
    .search-box { max-width: none; }
    .auth-buttons { flex-direction: column; align-items: stretch; margin-left: 0; flex-wrap: wrap; }
}

/* ============================================
   Persona neurodivergente: componentes grandes,
   visuales, con mínimo texto y áreas táctiles amplias.
   ============================================ */

.points-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    color: #7a5a10;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

/* Navegación de fecha (agenda / calendario) */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
}
.date-nav-label {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary-color);
    min-width: 220px;
    text-align: center;
}

/* Barra de progreso (rutinas) */
.progress-bar {
    width: 100%;
    height: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 10px 0;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Filas grandes con casilla táctil (agenda del día y pasos de rutina) */
.agenda-list, .step-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}
.agenda-item, .step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}
.agenda-item.is-done, .step-item.is-done { background: var(--secondary-light); border-color: var(--secondary-color); }
.agenda-check-form { display: contents; }
.agenda-check {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.agenda-check:hover { border-color: var(--primary-color); }
.agenda-icon { font-size: 1.8rem; flex-shrink: 0; }
.agenda-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.agenda-info strong { font-family: var(--font-heading); font-size: 1.05rem; color: var(--text-primary); }
.agenda-info span { color: var(--text-secondary); font-size: 0.9rem; }

/* Calendario mensual */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 32px;
}
.calendar-weekday {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-bottom: 8px;
}
.calendar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: 76px;
    padding: 10px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: inherit;
    text-decoration: none;
}
.calendar-cell:hover { border-color: var(--primary-color); }
.calendar-cell-empty { background: transparent; border: none; }
.calendar-cell.is-today { border-color: var(--primary-color); border-width: 2px; }
.calendar-day-number { font-family: var(--font-heading); font-weight: 800; }
.calendar-day-icons { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; font-size: 0.9rem; }

/* Selector de emociones */
.emotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.emotion-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}
.emotion-tile:hover { border-color: var(--primary-color); transform: translateY(-2px); transition: transform 0.15s ease, border-color 0.15s ease; }
.emotion-tile-emoji { font-size: 2.4rem; }
.emotion-history { display: flex; gap: 10px; flex-wrap: wrap; }
.emotion-chip { font-size: 1.8rem; }

/* Tablero de comunicación aumentativa */
.sentence-strip {
    min-height: 72px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    font-size: 1.3rem;
}
.sentence-placeholder { color: var(--text-secondary); font-size: 1rem; }
.sentence-word {
    background: var(--primary-light);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    font-family: var(--font-heading);
    font-weight: 700;
}
.sentence-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sentence-actions .btn { width: auto; }

.pictogram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}
.pictogram-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}
.pictogram-tile:hover { border-color: var(--primary-color); transform: translateY(-2px); transition: transform 0.15s ease, border-color 0.15s ease; }
.pictogram-emoji { font-size: 2.2rem; }

@media (max-width: 860px) {
    .calendar-grid { grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 4px; overflow-x: auto; }
    .calendar-cell { min-height: 56px; padding: 6px 3px; font-size: 0.85rem; }
    .agenda-item, .step-item { flex-wrap: wrap; }
}

/* ============================================
   Profesional: disponibilidad semanal (propia y directorio público)
   ============================================ */
.availability-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}
.availability-day {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}
.availability-day h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}
.availability-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}
.availability-slot .btn-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    border: none;
    background: transparent;
    flex-shrink: 0;
}

@media (max-width: 860px) {
    .availability-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Shell de aplicación (topbar + sidebar del área logueada) */
.topbar {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 110;
}
.topbar-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
}
.sidebar-toggle { display: none; }

.app-shell {
    display: flex;
    align-items: flex-start;
    max-width: 1440px;
    margin: 0 auto;
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 67px;
    height: calc(100vh - 67px);
    overflow-y: auto;
    padding: 28px 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    border-right: 1px solid var(--border-color);
}
.sidebar-section { display: flex; flex-direction: column; gap: 4px; }
.sidebar-section .section-eyebrow { display: block; padding: 0 14px; margin-bottom: 6px; }
details.sidebar-section > summary.section-eyebrow {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
details.sidebar-section > summary.section-eyebrow::-webkit-details-marker { display: none; }
details.sidebar-section > summary.section-eyebrow::after {
    content: '▸';
    font-size: 0.9em;
    transition: transform 0.15s ease;
}
details.sidebar-section[open] > summary.section-eyebrow::after { transform: rotate(90deg); }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92em;
}
.sidebar-link:hover { background: var(--bg-secondary); text-decoration: none; }
.sidebar-link.is-active { background: var(--primary-color); color: #fff; }
.sidebar-link-icon { font-size: 1.05em; line-height: 1; flex-shrink: 0; }
.sidebar-link-label { flex: 1; }
.sidebar-link .badge { flex-shrink: 0; }

.app-content { flex: 1; min-width: 0; }

.sidebar-backdrop { display: none; }

@media (max-width: 860px) {
    .sidebar-toggle { display: inline-flex; }
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 200;
        background: var(--bg-primary);
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 30, 40, 0.4);
        z-index: 190;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
    .topbar-content { padding: 12px 16px; flex-wrap: wrap; }
    .user-welcome { display: none; }
    .search-box { flex-basis: 100%; max-width: none; order: 3; }
}

/* Página de videollamada (Telemedicina) */
.video-call-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #10161c;
}
.video-call-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}
.video-call-frame {
    flex: 1;
    width: 100%;
    border: 0;
}

/* Búsqueda global (navbar + topbar) */
.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 320px;
    position: relative;
}
.header .search-box {
    max-width: 180px;
}
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 50;
    padding: 8px 0;
}
.search-suggestions-group {
    padding: 6px 16px 2px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-secondary);
}
.search-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-primary);
    text-decoration: none;
}
.search-suggestion:hover, .search-suggestion:focus {
    background: var(--bg-secondary);
    text-decoration: none;
}
.search-suggestions-more {
    display: block;
    padding: 10px 16px;
    text-align: center;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    margin-top: 6px;
    color: var(--primary-color);
    text-decoration: none;
}
.search-suggestions-empty {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.search-box input {
    flex: 1;
    min-width: 0;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.search-box input:focus { outline: none; border-color: var(--primary-color); }
.search-box button {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 1rem;
}
.search-box button:hover { border-color: var(--primary-color); }
