/* ============================================================
   COMMADIS Portal — Sitio Público
   Palette: primary #4361ee | green #22c55e | amber #f59e0b | dark #1e2235
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --pp-primary:   #4361ee;
    --pp-primary-d: #3451d1;
    --pp-green:     #22c55e;
    --pp-amber:     #f59e0b;
    --pp-dark:      #1e2235;
    --pp-text:      #374151;
    --pp-muted:     #6b7280;
    --pp-bg:        #f8fafc;
    --pp-card:      #ffffff;
    --pp-border:    #e5e7eb;
    --pp-radius:    14px;
    --pp-shadow:    0 4px 24px rgba(0,0,0,0.07);
    --pp-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* ── BASE ── */
.portal-root {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--pp-text);
    background: var(--pp-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-root main { flex: 1; }

.portal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── NAVBAR ── */
.portal-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--pp-border);
    padding: 1rem 0;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

.portal-navbar .portal-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.45rem;
    color: var(--pp-primary);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.portal-brand i { color: var(--pp-green); font-size: 1.25rem; }

.portal-brand .brand-sub {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--pp-muted);
    letter-spacing: 0.5px;
    display: block;
    line-height: 1;
    margin-top: 2px;
}

.portal-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.portal-nav-links a {
    text-decoration: none;
    color: var(--pp-text);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.portal-nav-links a:hover,
.portal-nav-links a.active {
    background: rgba(67,97,238,0.08);
    color: var(--pp-primary);
}

/* ── HERO ── */
.portal-hero {
    background: linear-gradient(135deg, var(--pp-primary) 0%, #1a1d38 100%);
    color: white;
    padding: 5.5rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.portal-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 55%;
    height: 200%;
    background: rgba(255,255,255,0.025);
    border-radius: 50%;
    pointer-events: none;
}

.portal-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 40%;
    height: 150%;
    background: rgba(255,255,255,0.015);
    border-radius: 50%;
    pointer-events: none;
}

.portal-hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.portal-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(34,197,94,0.18);
    color: #a5f3c1;
    border: 1px solid rgba(165,243,193,0.3);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.portal-hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -1.5px;
}

.portal-hero h1 span { color: #a5f3c1; }

.portal-hero p.lead {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.75;
    max-width: 560px;
    margin-bottom: 2.25rem;
}

.portal-hero-deco {
    font-size: 11rem;
    color: rgba(255,255,255,0.05);
    line-height: 1;
    user-select: none;
}

.portal-hero-actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn-portal-primary {
    background: var(--pp-green);
    color: white !important;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    cursor: pointer;
}

.btn-portal-primary:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34,197,94,0.35);
}

.btn-portal-ghost {
    background: rgba(255,255,255,0.1);
    color: white !important;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-portal-ghost:hover { background: rgba(255,255,255,0.18); }

.btn-portal-outline {
    background: transparent;
    color: var(--pp-primary) !important;
    border: 2px solid var(--pp-primary);
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, color 0.2s;
}

.btn-portal-outline:hover {
    background: var(--pp-primary);
    color: white !important;
}

/* ── STATS STRIP ── */
.portal-stats {
    background: white;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--pp-border);
}

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.portal-stat-item {
    padding: 1.5rem 1rem;
    border-radius: var(--pp-radius);
    background: var(--pp-bg);
    border: 1px solid var(--pp-border);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--pp-shadow);
}

.portal-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
    display: block;
}

.portal-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--pp-primary);
    line-height: 1;
    margin-bottom: 0.35rem;
    letter-spacing: -1px;
}

.portal-stat-label {
    font-size: 0.82rem;
    color: var(--pp-muted);
    font-weight: 500;
}

/* ── SECTIONS ── */
.portal-section { padding: 5rem 0; }
.portal-section.alt { background: white; }
.portal-section.dark {
    background: var(--pp-dark);
    color: white;
}

.portal-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.portal-section-tag {
    display: inline-block;
    background: rgba(67,97,238,0.1);
    color: var(--pp-primary);
    border-radius: 999px;
    padding: 0.25rem 0.875rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.portal-section-header h2 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--pp-dark);
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.portal-section.dark .portal-section-header h2 { color: white; }
.portal-section.dark .portal-section-header p { color: rgba(255,255,255,0.65); }

.portal-section-header p {
    color: var(--pp-muted);
    font-size: 1rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── EVENT CARDS ── */
.portal-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.portal-event-card {
    background: var(--pp-card);
    border-radius: var(--pp-radius);
    border: 1px solid var(--pp-border);
    box-shadow: var(--pp-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pp-shadow-lg);
}

.portal-event-date-bar {
    background: var(--pp-primary);
    color: white;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-event-date-bar.past { background: var(--pp-muted); }

.date-day {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.date-month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.85;
    letter-spacing: 0.3px;
}

.portal-event-body {
    padding: 1.375rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portal-event-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pp-dark);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.portal-event-body p {
    font-size: 0.875rem;
    color: var(--pp-muted);
    line-height: 1.65;
    margin-bottom: 1rem;
    flex: 1;
}

.portal-event-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--pp-muted);
    margin-top: auto;
}

.portal-event-meta i { color: var(--pp-primary); font-size: 0.78rem; }

/* ── PROJECT CARDS ── */
.portal-project-card {
    background: var(--pp-card);
    border-radius: var(--pp-radius);
    border: 1px solid var(--pp-border);
    border-top: 4px solid var(--pp-green);
    box-shadow: var(--pp-shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pp-shadow-lg);
}

.portal-project-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pp-dark);
    margin: 0;
    line-height: 1.3;
}

.portal-project-card p {
    font-size: 0.875rem;
    color: var(--pp-muted);
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

.portal-project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.875rem;
    border-top: 1px solid var(--pp-border);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-project-date {
    font-size: 0.8rem;
    color: var(--pp-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ── BADGES ── */
.portal-badge-upcoming {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-badge-past {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-badge-active {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,0.2);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.portal-badge-finished {
    background: rgba(107,114,128,0.1);
    color: var(--pp-muted);
    border: 1px solid rgba(107,114,128,0.18);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ── ALLIANCE GRID ── */
.portal-alliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.portal-alliance-card {
    background: white;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    padding: 1.375rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.625rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portal-alliance-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pp-shadow);
    border-color: rgba(67,97,238,0.3);
}

.portal-alliance-icon {
    width: 52px;
    height: 52px;
    background: rgba(67,97,238,0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-primary);
    font-size: 1.35rem;
}

.portal-alliance-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--pp-dark);
    line-height: 1.3;
}

.portal-alliance-type {
    font-size: 0.76rem;
    color: var(--pp-muted);
}

/* ── MISSION ── */
.portal-mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.portal-mission-text .portal-section-tag { margin-bottom: 0.75rem; }

.portal-mission-text h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--pp-dark);
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.portal-mission-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.625rem;
}

.portal-mission-item-icon {
    width: 46px;
    height: 46px;
    background: rgba(67,97,238,0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.portal-mission-item-text h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pp-dark);
    margin-bottom: 0.2rem;
}

.portal-mission-item-text p {
    font-size: 0.875rem;
    color: var(--pp-muted);
    margin: 0;
    line-height: 1.65;
}

.portal-mission-visual {
    background: linear-gradient(145deg, var(--pp-primary) 0%, #1a1d38 100%);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portal-mission-visual::before {
    content: '';
    position: absolute;
    bottom: -25%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portal-mission-visual .deco-icon {
    font-size: 5rem;
    opacity: 0.12;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

.portal-mission-visual blockquote {
    font-size: 1.1rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.88);
    font-style: italic;
    margin: 0 0 1.5rem;
    position: relative;
    z-index: 1;
}

.portal-mission-visual blockquote::before {
    content: '"';
    font-size: 5rem;
    color: rgba(255,255,255,0.1);
    line-height: 0;
    position: absolute;
    top: 1rem;
    left: -0.75rem;
}

.portal-mission-visual .attribution {
    font-weight: 700;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    position: relative;
    z-index: 1;
}

.portal-mission-visual .values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.portal-mission-visual .value-chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ── CTA SECTION ── */
.portal-cta {
    background: linear-gradient(135deg, #16a34a 0%, #166534 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portal-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.portal-cta h2 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 0.875rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.portal-cta p {
    font-size: 1.05rem;
    opacity: 0.82;
    margin-bottom: 2.25rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.portal-cta .btn-portal-primary {
    background: white;
    color: #16a34a !important;
    position: relative;
    z-index: 1;
}

.portal-cta .btn-portal-primary:hover {
    background: #f0fdf4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ── PAGE HEADER ── */
.portal-page-header {
    background: linear-gradient(135deg, var(--pp-primary) 0%, #1a1d38 100%);
    color: white;
    padding: 3.5rem 0 3rem;
}

.portal-page-header h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 0.375rem;
    letter-spacing: -0.5px;
}

.portal-page-header p {
    opacity: 0.75;
    margin: 0;
    font-size: 1rem;
}

/* ── EMPTY STATE ── */
.portal-empty {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--pp-muted);
}

.portal-empty i {
    font-size: 3.5rem;
    opacity: 0.2;
    margin-bottom: 1.25rem;
    display: block;
    color: var(--pp-primary);
}

.portal-empty p {
    font-size: 1.05rem;
    font-weight: 500;
}

/* ── FOOTER ── */
.portal-footer {
    background: var(--pp-dark);
    color: rgba(255,255,255,0.65);
    padding: 4rem 0 2rem;
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.portal-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.3rem;
    color: white;
    margin-bottom: 1rem;
}

.portal-footer-brand i { color: var(--pp-green); }

.portal-footer p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.5rem;
}

.portal-footer h6 {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 1.125rem;
}

.portal-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-footer ul li { margin-bottom: 0.6rem; }

.portal-footer ul li a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.portal-footer ul li a:hover { color: white; }

.portal-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-footer-bottom p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.3);
    margin: 0;
}

/* ── DIVIDER ── */
.portal-divider {
    width: 60px;
    height: 4px;
    background: var(--pp-green);
    border-radius: 2px;
    margin: 1rem auto 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .portal-mission-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .portal-footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
    .portal-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-hero-grid { grid-template-columns: 1fr; }
    .portal-hero-deco { display: none; }
    .portal-nav-links { gap: 0; }
    .portal-nav-links a { font-size: 0.82rem; padding: 0.35rem 0.6rem; }
    .portal-cards-grid { grid-template-columns: 1fr; }
    .portal-alliance-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .portal-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-hero { padding: 3.5rem 0 3rem; }
    .portal-section { padding: 3.5rem 0; }
    .portal-nav-links { display: none; }
}

/* ── Registro y perfil de familias (formulario interno reutilizado dentro del portal claro) ── */
.portal-nav-cta { background: var(--pp-primary); color: #fff !important; padding: .35rem .9rem; border-radius: 999px; font-weight: 600; }
.portal-nav-cta:hover { filter: brightness(1.1); }
.portal-reg { max-width: 1100px; }
body.dark-mode .portal-reg .card { background: #fff !important; color: #1f2937 !important; border: 1px solid #e5e7eb !important; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
body.dark-mode .portal-reg .card-body { background: #fff !important; color: #1f2937 !important; }
body.dark-mode .portal-reg .card-header { background: #f8fafc !important; color: #0f172a !important; border-bottom: 1px solid #e5e7eb !important; font-weight: 600; }
body.dark-mode .portal-reg .form-control, body.dark-mode .portal-reg .form-select, body.dark-mode .portal-reg textarea {
    background-color: #fff !important; color: #111827 !important; border: 1px solid #cbd5e1 !important;
}
body.dark-mode .portal-reg .form-control:focus, body.dark-mode .portal-reg .form-select:focus { border-color: var(--pp-primary) !important; box-shadow: 0 0 0 .2rem rgba(67,97,238,.15); }
body.dark-mode .portal-reg .form-floating > label, body.dark-mode .portal-reg label, body.dark-mode .portal-reg .form-label,
body.dark-mode .portal-reg .form-check-label, body.dark-mode .portal-reg dt, body.dark-mode .portal-reg .bootstrap-switch-label { color: #334155 !important; }
body.dark-mode .portal-reg dd, body.dark-mode .portal-reg p, body.dark-mode .portal-reg h4, body.dark-mode .portal-reg h5 { color: #111827; }
body.dark-mode .portal-reg .text-muted, body.dark-mode .portal-reg .small.text-muted { color: #64748b !important; }
body.dark-mode .portal-reg .alert-info { background: #eff6ff !important; color: #1e40af !important; border-color: #bfdbfe !important; }
body.dark-mode .portal-reg .alert-warning { background: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
body.dark-mode .portal-reg .alert-success { background: #ecfdf5 !important; color: #065f46 !important; border-color: #a7f3d0 !important; }
body.dark-mode .portal-reg .alert-danger { background: #fef2f2 !important; color: #991b1b !important; border-color: #fecaca !important; }
body.dark-mode .portal-reg .form-check-input { background-color: #cbd5e1; border-color: #94a3b8; }
body.dark-mode .portal-reg .form-check-input:checked { background-color: var(--pp-primary); border-color: var(--pp-primary); }
body.dark-mode .portal-reg .btn-group .btn-secondary { background: #e2e8f0 !important; border-color: #e2e8f0 !important; color: #334155 !important; }
body.dark-mode .portal-reg .btn-group .btn-primary { background: var(--pp-primary) !important; color: #fff !important; }
body.dark-mode .portal-reg a:not(.btn) { color: var(--pp-primary); }
body.dark-mode .portal-reg .text-danger { color: #dc2626 !important; }

/* ═══ Portada estilo COMMADIS (prefijo cm-) ═══ */
.cm-home { font-family: 'Roboto', system-ui, sans-serif; color: #424242; }
.cm-home h1, .cm-home h2, .cm-home h3 { font-family: 'Playfair Display', Georgia, serif; color: #1f4f60; margin: 0 0 .8rem; line-height: 1.2; }
.cm-home p { line-height: 1.75; font-size: 1.05rem; margin: 0 0 1.2rem; white-space: pre-line; }
.cm-hero { background: linear-gradient(135deg, #eaf6fa 0%, #ffffff 70%); padding: 4.5rem 0 4rem; }
.cm-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.cm-hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 700; }
.cm-hero-img img { width: 100%; border-radius: 22px; box-shadow: 0 18px 50px rgba(41,111,134,.25); display: block; max-height: 460px; object-fit: cover; }
.cm-kicker { text-transform: uppercase; letter-spacing: 2px; font-size: .78rem; font-weight: 700; color: var(--pp-primary); margin-bottom: .6rem; }
.cm-btn { display: inline-block; background: var(--pp-primary); color: #fff !important; padding: .8rem 1.7rem; border-radius: 999px; font-weight: 500; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cm-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.cm-btn-line { background: transparent; color: var(--pp-primary) !important; border: 2px solid var(--pp-primary); }
.cm-btn-line:hover { background: var(--pp-primary); color: #fff !important; }
.cm-btn-light { background: #fff; color: #1f4f60 !important; }
.cm-band { padding: 4.5rem 0; }
.cm-tint { background: #f1f8fb; }
.cm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.cm-split-rev .cm-split-text { order: 0; }
.cm-split h2, .cm-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 600; }
.cm-split-img img { width: 100%; border-radius: 18px; display: block; box-shadow: 0 12px 36px rgba(0,0,0,.14); max-height: 440px; object-fit: cover; }
.cm-head { text-align: center; max-width: 760px; margin: 0 auto 2.5rem; }
.cm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.6rem; }
.cm-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 28px rgba(0,0,0,.09); display: flex; flex-direction: column; transition: transform .2s; }
.cm-card:hover { transform: translateY(-5px); }
.cm-card img { width: 100%; height: 190px; object-fit: cover; display: block; }
.cm-card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.cm-card h3 { font-size: 1.25rem; font-weight: 600; }
.cm-card p { font-size: .96rem; flex: 1; }
.cm-link { color: var(--pp-primary); font-weight: 500; text-decoration: none; }
.cm-link:hover { text-decoration: underline; }
.cm-banner { background: #296f86 center/cover no-repeat; }
.cm-banner-shade { background: linear-gradient(90deg, rgba(31,79,96,.92) 0%, rgba(31,79,96,.55) 100%); padding: 6rem 0; color: #fff; }
.cm-banner h2 { color: #fff !important; font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.cm-banner p { max-width: 620px; color: rgba(255,255,255,.92); }
.cm-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.6rem; }
.cm-quote { margin: 0; background: #f1f8fb; border-radius: 18px; padding: 1.8rem 1.6rem; border-top: 4px solid var(--pp-primary); }
.cm-quote > i { color: var(--pp-primary); font-size: 1.6rem; opacity: .55; }
.cm-quote blockquote { margin: .8rem 0 1rem; font-style: italic; line-height: 1.7; }
.cm-quote figcaption b { display: block; color: #1f4f60; }
.cm-quote figcaption span { font-size: .85rem; color: #737373; }
.cm-contact { background: #1f4f60; color: #fff; }
.cm-contact h2, .cm-contact .cm-head p { color: #fff !important; }
.cm-contact-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-bottom: 2rem; }
.cm-contact-row a { background: rgba(255,255,255,.1); border-radius: 16px; padding: 1.1rem 1.6rem; color: #fff; text-decoration: none; min-width: 230px; text-align: center; transition: background .15s; }
.cm-contact-row a:hover { background: rgba(255,255,255,.2); }
.cm-contact-row i { display: block; font-size: 1.5rem; margin-bottom: .4rem; color: #8fd3e8; }
.cm-contact-row span { display: block; font-size: .8rem; opacity: .8; }
.cm-social { display: flex; justify-content: center; gap: .8rem; }
.cm-social a { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #1f4f60; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; text-decoration: none; transition: transform .15s, background .15s, color .15s; }
.cm-social a:hover { transform: translateY(-3px); background: var(--pp-primary); color: #fff; }
@media (max-width: 860px) {
  .cm-hero-grid, .cm-split { grid-template-columns: 1fr; gap: 1.8rem; }
  .cm-hero { padding: 2.5rem 0; }
  .cm-band { padding: 3rem 0; }
  .cm-split-img { order: -1; }
}

/* ── DONACIONES Y PATROCINIO ── */
.portal-nav-donar { background: var(--pp-green); color: #fff !important; border-radius: 999px; padding: .4rem 1rem !important; }
.portal-donate-strip { background: #fff7ed; border-top: 1px solid #fed7aa; padding: .9rem 0; }
.portal-donate-strip .portal-container { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; text-align: center; }
.portal-donate-strip span { color: #7c2d12; font-weight: 600; font-size: .95rem; }
.portal-donate-strip i.fa-heart { color: #ea580c; margin-right: .35rem; }
.portal-donate-strip .btn-portal-primary { padding: .5rem 1.25rem; font-size: .85rem; }

.ev-link { text-decoration: none !important; color: inherit; }
.ev-more { display: block; padding: 0 1.25rem 1.1rem; color: var(--pp-primary); font-weight: 600; font-size: .85rem; }
.sp-back { color: rgba(255,255,255,.8); font-size: .85rem; text-decoration: none; display: inline-block; margin-bottom: .75rem; }
.ev-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: start; }
.ev-desc { margin: 1rem 0; line-height: 1.75; white-space: pre-line; }
.ev-cta { background: var(--pp-card, #fff); border: 1px solid var(--pp-border, #e5e7eb); border-radius: 16px; padding: 1.5rem; box-shadow: var(--pp-shadow); }
.ev-cta h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.ev-cta p { color: #6b7280; font-size: .92rem; }
.ev-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.ev-gallery img { width: 100%; height: 170px; object-fit: cover; border-radius: 12px; }

.sp-layout { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.75rem; align-items: start; max-width: 1050px; margin: 0 auto; }
.sp-card, .sp-accounts { background: var(--pp-card, #fff); border: 1px solid var(--pp-border, #e5e7eb); border-radius: 16px; padding: 1.5rem; box-shadow: var(--pp-shadow); }
.sp-accounts h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: .9rem; }
.sp-account { background: #f8fafc; border-left: 4px solid var(--pp-green); border-radius: 8px; padding: .7rem .9rem; margin-bottom: .6rem; font-size: .9rem; }
.sp-note { color: #6b7280; font-size: .82rem; margin-top: .9rem; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; margin-bottom: 1rem; }
.sp-f { display: flex; flex-direction: column; gap: .3rem; font-size: .83rem; font-weight: 600; color: #374151; }
.sp-f.sp-w2 { grid-column: 1 / -1; }
.sp-f input[type=text], .sp-f input[type=email], .sp-f input[type=tel], .sp-f input[type=number], .sp-f input[type=date], .sp-f select, .sp-f textarea {
    border: 1px solid #d1d5db; border-radius: 10px; padding: .6rem .75rem; font-size: .92rem; font-weight: 400; width: 100%; background: #fff; }
.sp-f small { font-weight: 400; color: #6b7280; }
.sp-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .85rem; margin-bottom: 1rem; }
.sp-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .88rem; }
.sp-done { text-align: center; padding: 1.5rem .5rem; }
.sp-done > i { font-size: 3rem; color: var(--pp-green); }
.sp-done h4 { margin: .75rem 0 .5rem; font-weight: 700; }
.sp-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.sp-logo { background: #fff; border: 1px solid var(--pp-border, #e5e7eb); border-radius: 14px; padding: 1rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; min-height: 140px; box-shadow: var(--pp-shadow); }
.sp-logo img { max-width: 100%; max-height: 80px; object-fit: contain; }
.sp-logo .sp-ico { font-size: 2.2rem; color: var(--pp-primary); }
.sp-logo span { font-weight: 600; font-size: .85rem; color: #374151; }
@media (max-width: 820px) {
    .ev-detail, .sp-layout { grid-template-columns: 1fr; }
    .sp-grid { grid-template-columns: 1fr; }
    .portal-nav-donar { display: inline-block; }
}

/* ── CONTADORES ── */
.pstats { background: linear-gradient(135deg, var(--pp-primary) 0%, #1a1d38 100%); color: #fff; padding: 2.6rem 0; }
.pstats-title { text-align: center; font-size: .8rem; letter-spacing: 3px; font-weight: 700; text-transform: uppercase; opacity: .8; margin-bottom: 1.4rem; }
.pstats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .8rem; }
.pstat { text-align: center; padding: 1.1rem .75rem; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.pstat i { font-size: 1.4rem; opacity: .85; margin-bottom: .4rem; display: block; }
.pstat b { display: block; font-size: 2.1rem; line-height: 1.1; font-weight: 800; }
.pstat span { font-size: .8rem; opacity: .85; }
.pstats-inline { margin-top: 2rem; }
.pstats-inline .pstat { background: var(--pp-card, #fff); border-color: var(--pp-border, #e5e7eb); color: var(--pp-dark, #1e2235); box-shadow: var(--pp-shadow); }
.pstats-inline .pstat i { color: var(--pp-primary); }
.portal-project-card.ev-link { display: block; }

/* ── APORTE EN ESPECIE ── */
.sp-kind { display: flex; gap: .5rem; }
.sp-kind button { flex: 1; border: 1.5px solid #d1d5db; background: #fff; border-radius: 12px; padding: .65rem .8rem; font-weight: 600; font-size: .92rem; color: #374151; cursor: pointer; }
.sp-kind button.on { background: var(--pp-primary); border-color: var(--pp-primary); color: #fff; }
.sp-kind-tag { font-weight: 500; font-size: .72rem; color: var(--pp-primary); background: rgba(14,159,196,.1); border-radius: 999px; padding: .1rem .55rem; }

/* Contenido institucional y servicios administrables */
.portal-summary { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; overflow:hidden; }
.institution-text { white-space:pre-line; line-height:1.85; }
.service-cover { width:100%; height:210px; object-fit:cover; }
.service-detail { max-width:980px; }
.service-detail > .public-image img { width:100%; max-height:480px; object-fit:cover; border-radius:16px; margin-bottom:2rem; }
.public-image { display:block; cursor:zoom-in; }
.public-image img { max-width:100%; }
.ev-gallery .public-image img { width:100%; height:220px; object-fit:cover; border-radius:12px; }
.hero-controls { display:flex; align-items:center; justify-content:center; gap:1rem; padding-bottom:1.5rem; }
.hero-controls button { border:1px solid currentColor; background:white; color:var(--pp-dark); border-radius:50%; width:44px; height:44px; }
.public-image:focus-visible, .hero-controls button:focus-visible { outline:3px solid var(--pp-primary); outline-offset:4px; }
.portal-root .cm-home { --cm-teal:var(--pp-primary); }
@media(min-width:1000px) { .portal-cards-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:600px) { .service-cover { height:180px; } .portal-nav-links { flex-wrap:wrap; gap:.8rem; } }

/* Portada basada en la referencia visual de COMMADIS. El contenido continúa administrable. */
.portal-navbar { padding: .45rem 0; }
.portal-brand { font-size: 1.13rem; color: #067bc2; }
.portal-brand .brand-sub { font-size: .59rem; letter-spacing: 0; }
.portal-nav-links a { font-size: .83rem; padding: .38rem .72rem; }
.portal-nav-donar { border-radius: 7px; background: linear-gradient(135deg,#12c9aa,#0baf87); box-shadow: 0 3px 10px #10b89935; }
.cm-home-reference { font-family: Inter, system-ui, sans-serif; color: #53647e; }
.cm-home-reference h1, .cm-home-reference h2, .cm-home-reference h3 { font-family: Inter, system-ui, sans-serif; color: #063c78; letter-spacing: -.035em; }
.cm-home-reference h2 { font-size: clamp(1.05rem,1.35vw,1.4rem); font-weight: 800; line-height: 1.18; margin: 0 0 .38rem; }
.cm-home-reference p { margin: 0; font-size: .78rem; line-height: 1.36; white-space: normal; }
.cm-home-reference .portal-container { max-width: 1480px; }
.cm-ref-section-copy { min-width: 0; }
.cm-ref-section-copy p { max-width: 310px; }
.cm-ref-link { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; color: #075cb5; border: 1px solid #2587d0; background: white; border-radius: 999px; padding: .35rem .9rem; text-decoration: none; font-size: .7rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.cm-ref-link:hover { color: white; background: #075cb5; }
.cm-ref-hero { min-height: 285px; position: relative; overflow: hidden; background: radial-gradient(circle at 0 0,#d9f2ff 0,#f5fbff 32%,#fff 54%); }
.cm-ref-hero::before { content: ''; position: absolute; left: -80px; top: -60px; width: 240px; height: 160px; border-radius: 60%; background: #84d9f5a3; transform: rotate(-28deg); }
.cm-ref-hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 210px; height: 150px; border-radius: 50%; background: #74dedaca; }
.cm-ref-hero-photo { position: absolute; inset: 0 0 0 38%; background-position: center 47%; background-size: cover; -webkit-mask-image: linear-gradient(90deg,transparent 0,#000 22%); mask-image: linear-gradient(90deg,transparent 0,#000 22%); }
.cm-ref-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 47%; display: block; }
.cm-ref-hero-inner { max-width: 1200px !important; min-height: 285px; display: flex; align-items: center; position: relative; z-index: 1; }
.cm-ref-hero-copy { width: min(365px,38%); padding: 1.3rem 0; }
.cm-ref-eyebrow { display: block; color: #1299c8; font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .25rem; }
.cm-ref-hero h1 { font-size: clamp(2rem,2.8vw,3rem); line-height: .99; margin: 0 0 .55rem; font-weight: 850; }
.cm-ref-hero h1::first-line { color: #063c78; }
.cm-ref-hero-copy p { font-size: .83rem; line-height: 1.33; max-width: 355px; }
.cm-ref-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .6rem; }
.cm-ref-button { display: inline-flex; gap: .55rem; align-items: center; justify-content: center; border: 1px solid #11bfa5; border-radius: 999px; background: linear-gradient(135deg,#16cdb4,#08ad8e); color: white !important; text-decoration: none; padding: .48rem 1.03rem; font-size: .71rem; font-weight: 800; box-shadow: 0 3px 10px #0ea8882c; }
.cm-ref-button-outline { background: #fffffff0; border-color: #2381ca; color: #0b4f95 !important; box-shadow: none; }
.cm-ref-button-outline i { color: #ff7778; }
.cm-ref-hero-note { position: absolute; right: -1.5rem; top: 2.3rem; width: 160px; transform: rotate(-8deg); font: italic 1.3rem/1.25 Georgia,serif; color: #345176; text-align: center; text-shadow: 0 1px 5px white; }
.cm-ref-hero-note span { color: #ff7778; font-size: 1.8rem; }
.cm-ref-hero-controls { position: absolute; z-index: 2; bottom: .45rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .5rem; color: #073d74; font-size: .7rem; background: #ffffffe8; border-radius: 99px; padding: .18rem .3rem; }
.cm-ref-hero-controls button { border: 0; background: transparent; color: inherit; font-size: .68rem; width: 25px; height: 25px; border-radius: 50%; }
.cm-ref-hero-controls button:hover { background: #d8eefb; }
.cm-ref-intro { background: #fff; padding: 1.05rem 0; }
.cm-ref-intro-grid { display: grid; grid-template-columns: 28% 1fr; gap: 2rem; align-items: stretch; }
.cm-ref-intro-copy { border-right: 1px solid #dbe6ef; padding-right: 2rem; }
.cm-ref-intro-copy p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin-bottom: .48rem; }
.cm-ref-pillars { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1.25rem; align-items: start; }
.cm-ref-pillar { text-align: center; min-width: 0; }
.cm-ref-pillar-icon { display: grid; place-items: center; margin: 0 auto .26rem; width: 48px; height: 48px; border-radius: 50%; color: #179bf0; background: #dcf3ff; font-size: 1.45rem; }
.cm-ref-pillar-icon-1, .cm-ref-pillar-icon-4 { color: #ff7476; background: #ffe9e8; }
.cm-ref-pillar-icon-2 { color: #20bcc6; background: #dff8f8; }
.cm-ref-pillar h3 { font-size: .76rem; line-height: 1.13; margin: 0 0 .25rem; font-weight: 800; }
.cm-ref-pillar p { font-size: .68rem; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.cm-ref-impact { background: linear-gradient(105deg,#e0f7fd,#f7fdff 50%,#e1f7fc); padding: .9rem 0; }
.cm-ref-impact-grid { display: grid; grid-template-columns: 24% repeat(3,1fr); align-items: center; gap: 1.3rem; }
.cm-ref-impact-copy p { max-width: 290px; }
.cm-ref-metric { min-height: 67px; display: flex; align-items: center; justify-content: center; gap: .9rem; border-right: 1px solid #a8c7da; }
.cm-ref-metric:last-child { border: 0; }
.cm-ref-metric > i { color: #269ee8; font-size: 2rem; }
.cm-ref-metric:nth-child(3) > i { color: #2ac0c6; }
.cm-ref-metric:nth-child(4) > i { color: #ff777a; }
.cm-ref-metric strong { display: block; color: #064580; font-size: 1.85rem; line-height: 1; letter-spacing: -.05em; }
.cm-ref-metric span { display: block; color: #2e5b83; font-size: .69rem; }
.cm-ref-services { background: #fff; padding: .65rem 0; }
.cm-ref-services-grid, .cm-ref-community-grid, .cm-ref-highlights-grid, .cm-ref-allies-grid { display: grid; grid-template-columns: 19% 1fr; gap: 1.25rem; align-items: center; }
.cm-ref-services .cm-ref-link { margin-top: .65rem; }
.cm-ref-service-list { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .55rem; }
.cm-ref-service { min-width: 0; min-height: 145px; position: relative; overflow: hidden; display: block; background: #fff; border: 1px solid #e2e8ee; border-radius: 7px; box-shadow: 0 2px 6px #08396715; color: #284866; text-decoration: none; }
.cm-ref-service:hover { color: #284866; transform: translateY(-2px); box-shadow: 0 6px 16px #08396721; }
.cm-ref-service > img { display: block; width: 100%; height: 58px; object-fit: cover; }
.cm-ref-service-icon { position: absolute; top: 40px; left: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #dff3ff; color: #168ddb; font-size: 1rem; box-shadow: 0 2px 6px #08396722; }
.cm-ref-service:not(:has(img)) .cm-ref-service-icon { top: 10px; }
.cm-ref-service-icon-0, .cm-ref-service-icon-3 { background: #ffe8e8; color: #ff7476; }
.cm-ref-service-icon-2, .cm-ref-service-icon-5 { background: #e0f9f8; color: #17bac0; }
.cm-ref-service-body { display: block; padding: 1.05rem .57rem .55rem; }
.cm-ref-service:not(:has(img)) .cm-ref-service-body { padding-top: 3.5rem; }
.cm-ref-service-body strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: #063c78; font-size: .72rem; line-height: 1.12; min-height: 1.6rem; }
.cm-ref-service-body > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: .25rem; color: #526782; font-size: .67rem; line-height: 1.17; }
.cm-ref-community { background: linear-gradient(95deg,#e0f6ff,#f8fdff 50%,#dff7f5); padding: .55rem 0; }
.cm-ref-photo-strip { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .55rem; }
.cm-ref-photo-strip .public-image { overflow: hidden; border-radius: 7px; }
.cm-ref-photo-strip .public-image img { width: 100%; height: 90px; object-fit: cover; display: block; }
.cm-ref-highlights { background: #fff; padding: .65rem 0 1rem; }
.cm-ref-highlight-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; }
.cm-ref-highlight { min-width: 0; height: 112px; display: flex; overflow: hidden; background: #fff; border: 1px solid #e3eaf1; border-radius: 7px; box-shadow: 0 2px 6px #08396712; }
.cm-ref-highlight-photo { flex: 0 0 39%; background: #daf3f4; display: grid; place-items: center; }
.cm-ref-highlight-photo img { width: 100%; height: 100%; object-fit: cover; }
.cm-ref-highlight-placeholder i { color: #2cb9b6; font-size: 2.4rem; }
.cm-ref-highlight-body { padding: .5rem .6rem; min-width: 0; }
.cm-ref-highlight-date { color: #3f6489; font-size: .56rem; font-weight: 700; }
.cm-ref-highlight-date i { color: #116dc1; }
.cm-ref-highlight h3 { font-size: .67rem; font-weight: 800; line-height: 1.1; margin: .16rem 0; }
.cm-ref-highlight h3 a { color: inherit; text-decoration: none; }
.cm-ref-highlight p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .58rem; line-height: 1.2; }
.cm-ref-highlight .cm-ref-link { font-size: .56rem; padding: .22rem .58rem; margin-top: .35rem; }
.cm-ref-allies { background: #fff; padding: .6rem 0 1.2rem; }
.cm-ref-allies-list { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .7rem; }
.cm-ref-allies-list a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 65px; color: #296184; text-decoration: none; text-align: center; font-size: .65rem; font-weight: 700; }
.cm-ref-allies-list i { font-size: 1.35rem; color: #28bfc4; }
.cm-ref-extra { padding: 2.5rem 0; background: white; }
.cm-ref-extra-tint { background: #ecf8fc; }
.cm-ref-extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.cm-ref-extra p { max-width: 570px; margin-bottom: .8rem; }
.cm-ref-extra .public-image img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; }
@media (max-width: 1200px) {
  .cm-ref-services-grid,.cm-ref-community-grid,.cm-ref-highlights-grid,.cm-ref-allies-grid { grid-template-columns: 1fr; align-items: start; }
  .cm-ref-section-copy p { max-width: 650px; }
  .cm-ref-service-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cm-ref-photo-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .cm-ref-allies-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .cm-ref-hero-photo { inset: 0 0 0 25%; opacity: .45; }
  .cm-ref-hero-copy { width: min(430px,75%); }
  .cm-ref-hero-note { display: none; }
  .cm-ref-intro-grid { grid-template-columns: 1fr; gap: 1rem; }
  .cm-ref-intro-copy { border-right: 0; border-bottom: 1px solid #dbe6ef; padding: 0 0 1rem; }
  .cm-ref-impact-grid { grid-template-columns: repeat(3,1fr); }
  .cm-ref-impact-copy { grid-column: 1/-1; }
  .cm-ref-highlight-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cm-ref-hero { min-height: 370px; }
  .cm-ref-hero-inner { min-height: 370px; }
  .cm-ref-hero-photo { inset: 30% 0 0 0; -webkit-mask-image: linear-gradient(#0000,#000 60%); mask-image: linear-gradient(#0000,#000 60%); opacity: .55; }
  .cm-ref-hero-copy { width: 100%; align-self: flex-start; }
  .cm-ref-hero h1 { font-size: 2.1rem; }
  .cm-ref-pillars { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cm-ref-impact-grid { gap: .5rem; }
  .cm-ref-metric { display: block; text-align: center; }
  .cm-ref-metric > i { font-size: 1.3rem; }
  .cm-ref-metric strong { font-size: 1.3rem; }
  .cm-ref-service-list,.cm-ref-photo-strip,.cm-ref-allies-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cm-ref-extra-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ============ Portada v3 (amigable) + ampliador de imágenes ============ */
.v3-home {
  --v3-cyan: #0ec0e0; --v3-aqua: #5ce1e6; --v3-pink: #ff6b81;               /* colores del logo */
  --v3-blue: var(--pp-primary, #0891b2);
  --v3-blue-d: color-mix(in srgb, var(--v3-blue) 72%, #000);
  --v3-navy: var(--pp-dark, #0f3a4f);
  --v3-ink: #14304a; --v3-muted: #52687a; --v3-bg: #f1fafc; --v3-line: #d6ebf0;
  color: var(--v3-ink); background: var(--v3-bg); line-height: 1.6; font-size: 16.5px;
}
.v3-home h1, .v3-home h2, .v3-home h3 { line-height: 1.2; margin: 0; color: inherit; }
.v3-home a { text-decoration: none; }
.v3-home img { display: block; max-width: 100%; }
body:has(.v3-home) .portal-donate-strip { display: none; }                  /* la portada ya trae su propio llamado a donar */

.v3-tag { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--v3-blue-d); margin-bottom: 14px; }
.v3-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 13px 24px; font-weight: 600; font-size: 15.5px; transition: .2s; border: 1.5px solid transparent; cursor: pointer; }
.v3-btn-primary { background: var(--v3-blue); color: #fff; box-shadow: 0 4px 0 var(--v3-blue-d); }
.v3-btn-primary:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--v3-blue-d); color: #fff; }
.v3-btn-heart { background: #ee5670; color: #fff; box-shadow: 0 4px 0 #d94560; }
.v3-btn-heart:hover { transform: translateY(2px); box-shadow: 0 2px 0 #d94560; color: #fff; }
.v3-btn-ghost { background: #fff; border-color: var(--v3-ink); color: var(--v3-ink); box-shadow: 3px 3px 0 var(--v3-ink); }
.v3-btn-ghost:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--v3-ink); color: var(--v3-ink); }
.v3-btn-ghost-light { background: transparent; border-color: #fff; color: #fff; box-shadow: 3px 3px 0 #fff; }
.v3-btn-ghost-light:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #fff; color: #fff; }

/* fotos: rectangulares, más anchas que altas, con borde y sombra suave */
.v3-photo { position: relative; display: block; border-radius: 14px; border: 5px solid #fff; outline: 1px solid var(--v3-line); box-shadow: 0 14px 34px rgba(15,58,79,.14); background: #d6ebf0; cursor: zoom-in; overflow: hidden; }
.v3-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.v3-hero .v3-photo img { aspect-ratio: 5/4; }
.v3-dots { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; background: rgba(255,255,255,.92); padding: 7px 11px; border-radius: 999px; }
.v3-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.v3-dots i:nth-child(1) { background: var(--v3-pink); } .v3-dots i:nth-child(2) { background: var(--v3-aqua); } .v3-dots i:nth-child(3) { background: var(--v3-cyan); }
.v3-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 20px 14px; background: linear-gradient(transparent, rgba(8,40,56,.78)); color: #fff; font-size: 14.5px; }
.v3-photo-cap strong { font-size: 21px; margin-right: 6px; }

.v3-hero { padding: 56px 0 70px; }
.v3-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.v3-hero h1 { font-size: clamp(32px, 4.2vw, 52px); font-weight: 700; letter-spacing: -.5px; }
.v3-hero h1 em { font-style: normal; color: var(--v3-blue); }
.v3-hero-copy p { font-size: 18px; color: var(--v3-muted); margin: 20px 0 28px; max-width: 32em; }
.v3-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.v3-actions-center { justify-content: center; }
.v3-follow { display: inline-flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--v3-line); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14.5px; color: var(--v3-muted); }
.v3-follow a { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--v3-bg); color: var(--v3-blue-d); }
.v3-follow a:hover { background: var(--v3-cyan); color: #fff; }

.v3-about { background: #fff; padding: 78px 0; border-block: 1px solid var(--v3-line); }
.v3-about-grid { display: grid; grid-template-columns: 150px 400px 1fr; gap: 40px; align-items: center; }
.v3-stats { display: flex; flex-direction: column; gap: 16px; }
.v3-stat { background: #fff; border: 1.5px solid var(--v3-ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--v3-ink); padding: 14px 10px; text-align: center; }
.v3-stat strong { display: block; font-size: 26px; font-weight: 700; }
.v3-stat span { font-size: 12.5px; color: var(--v3-muted); line-height: 1.2; display: block; }
.v3-about h2 { font-size: clamp(26px, 3vw, 36px); margin: 4px 0 16px; }
.v3-about-copy p { color: var(--v3-muted); margin: 0 0 24px; }

.v3-section { padding: 78px 0; }
.v3-white { background: #fff; border-block: 1px solid var(--v3-line); }
.v3-head { text-align: center; max-width: 640px; margin: 0 auto 54px; }
.v3-head h2 { font-size: clamp(26px, 3.2vw, 38px); }
.v3-head p { color: var(--v3-muted); margin: 12px 0 0; }
.v3-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px 26px; }
.v3-card { position: relative; background: #fff; border: 1.5px solid var(--v3-ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--v3-ink); padding: 44px 24px 24px; text-align: center; }
.v3-card-icon { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); width: 54px; height: 54px; border-radius: 16px; border: 1.5px solid var(--v3-ink); display: grid; place-items: center; font-size: 22px; box-shadow: 2px 2px 0 var(--v3-ink); color: var(--v3-blue-d); }
.v3-card-0 .v3-card-icon { background: #c4f0f8; } .v3-card-1 .v3-card-icon { background: #cdf8f9; } .v3-card-2 .v3-card-icon { background: #ffdbe1; }
.v3-card h3 { font-size: 18.5px; margin-bottom: 8px; }
.v3-card p { margin: 0 0 14px; color: var(--v3-muted); font-size: 15.5px; }
.v3-card > a { font-weight: 600; font-size: 14.5px; color: var(--v3-blue-d); }

.v3-story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.v3-story-grid h2 { font-size: clamp(26px, 3.2vw, 38px); margin: 6px 0 16px; }
.v3-story-grid p { color: var(--v3-muted); margin: 0 0 24px; }

.v3-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 26px; }
.v3-event { background: #fff; border: 1.5px solid var(--v3-ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--v3-ink); overflow: hidden; }
.v3-event-photo { display: block; cursor: zoom-in; }
.v3-event-photo img { width: 100%; height: 200px; object-fit: cover; }
.v3-event-empty { height: 200px; display: grid; place-items: center; background: #c4f0f8; color: var(--v3-blue-d); font-size: 42px; cursor: pointer; }
.v3-event-body { padding: 18px 20px 22px; }
.v3-chip { display: inline-block; background: var(--v3-bg); color: var(--v3-blue-d); font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 3px 10px; margin-bottom: 10px; }
.v3-chip.up { background: #ffdbe1; color: #b3304a; }
.v3-event h3 { font-size: 17.5px; margin-bottom: 6px; }
.v3-event h3 a { color: var(--v3-ink); } .v3-event h3 a:hover { color: var(--v3-blue-d); }
.v3-event p { margin: 0; color: var(--v3-muted); font-size: 14.5px; }
.v3-center { text-align: center; margin-top: 38px; }

.v3-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px; }
.v3-step { background: var(--v3-bg); border: 1.5px solid var(--v3-ink); border-radius: 16px; box-shadow: 4px 4px 0 var(--v3-ink); padding: 26px 22px; }
.v3-step b { display: inline-block; font-size: 30px; color: var(--v3-blue); margin-bottom: 8px; }
.v3-step h3 { font-size: 17.5px; margin-bottom: 6px; } .v3-step p { margin: 0; color: var(--v3-muted); font-size: 15px; }

.v3-allies { padding: 56px 0 70px; text-align: center; }
.v3-allies b { display: block; font-weight: 500; color: var(--v3-muted); margin-bottom: 14px; font-size: 15px; }
.v3-allies a { display: inline-block; margin: 5px 7px; padding: 9px 20px; border: 1.5px solid var(--v3-line); border-radius: 12px; background: #fff; font-weight: 500; font-size: 14.5px; color: var(--v3-ink); }
.v3-allies a:hover { border-color: var(--v3-cyan); }

.v3-cta { background: var(--v3-navy); color: #fff; text-align: center; padding: 74px 0; position: relative; overflow: hidden; }
.v3-cta::before, .v3-cta::after { content: ""; position: absolute; border-radius: 50%; opacity: .14; }
.v3-cta::before { width: 300px; height: 300px; background: var(--v3-cyan); left: -90px; top: -100px; }
.v3-cta::after { width: 240px; height: 240px; background: var(--v3-pink); right: -60px; bottom: -90px; }
.v3-cta .portal-container { position: relative; z-index: 1; }
.v3-cta h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 14px; color: #fff; }
.v3-cta p { max-width: 34em; margin: 0 auto 28px; color: #c9e6ee; font-size: 18px; }

@media (max-width: 900px) {
  .v3-hero-grid, .v3-story-grid { grid-template-columns: 1fr; gap: 36px; }
  .v3-hero-visual { order: -1; }
  .v3-about-grid { grid-template-columns: 1fr; gap: 30px; }
  .v3-stats { flex-direction: row; } .v3-stat { flex: 1; }
}

/* ampliador de imágenes (js/lightbox.js) */
.zoom-box { position: fixed; inset: 0; z-index: 2000; background: rgba(15,22,43,.88); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 24px; }
.zoom-box[hidden] { display: none; }
.zoom-box img { max-width: min(92vw, 1100px); max-height: 80vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.zoom-x { position: absolute; top: 12px; right: 20px; background: none; border: 0; color: #fff; font-size: 44px; line-height: 1; cursor: pointer; }
.zoom-n { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; cursor: pointer; }
.zoom-n:hover, .zoom-x:hover { background: rgba(255,255,255,.3); }
.zoom-p { left: 18px; } .zoom-s { right: 18px; }
.zoom-c { color: #dff4f8; margin: 14px 0 0; font-size: 15px; text-align: center; }
