/*
 * CARTILLA DIGITAL — Pie de página clínico estático y de bajo ruido visual
 * Anclado al final del documento, sin animaciones ni elementos flotantes,
 * con tipografía pequeña-mediana y opacidad atenuada acorde al sistema hospitalario.
 */

@media screen {
    .site-footer {
        --footer-surface-ref: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        position: static;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px 20px;
        width: 100%;
        margin: auto 0 0 0;
        padding: 14px 0 18px;
        color: var(--clinic-text-muted, #607789);
        background: transparent;
        border: 0;
        border-top: 1px solid var(--clinic-line, #dbe7ef);
        border-radius: 0;
        box-shadow: none;
        font-family: inherit;
        font-size: 12px;
        line-height: 1.45;
        opacity: 0.72;
    }

    .site-footer::before,
    .site-footer::after {
        display: none !important;
        content: none !important;
    }

    .site-footer-brand,
    .site-footer-links,
    .site-footer-meta {
        position: static;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        margin: 0;
    }

    .site-footer-brand {
        gap: 8px;
        text-align: left;
    }

    .site-footer-brand strong {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        color: var(--clinic-text-muted, #607789);
        font-family: inherit;
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1.3;
    }

    .site-footer-brand strong::before {
        content: "CD";
        display: inline-grid;
        flex: 0 0 18px;
        width: 18px;
        height: 18px;
        place-items: center;
        color: var(--clinic-text-muted, #607789);
        background: rgba(100, 116, 139, 0.12);
        border: 1px solid var(--clinic-line, #dbe7ef);
        border-radius: 4px;
        box-shadow: none;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .site-footer-brand span {
        max-width: none;
        color: var(--clinic-text-muted, #607789);
        font-size: 12px;
        font-weight: 400;
        line-height: 1.4;
    }

    .site-footer-links {
        justify-content: center;
        gap: 6px 14px;
        text-align: center;
    }

    .site-footer-links a {
        display: inline-flex;
        min-height: 0;
        align-items: center;
        padding: 2px 0;
        color: var(--clinic-text-muted, #607789);
        background: transparent;
        border: 0;
        border-radius: 3px;
        box-shadow: none;
        font-size: 12px;
        font-weight: 450;
        line-height: 1.4;
        text-decoration: none;
        transform: none !important;
        transition: color 0.14s ease;
    }

    .site-footer-links a:hover {
        color: var(--clinic-text, #0f172a);
        background: transparent;
        border: 0;
        box-shadow: none;
        text-decoration: underline;
        text-underline-offset: 3px;
        transform: none !important;
    }

    .site-footer-links a:focus-visible {
        color: var(--clinic-text, #0f172a);
        background: transparent;
        outline: 2px solid var(--primary-focus, rgba(11, 92, 171, 0.22));
        outline-offset: 2px;
    }

    .site-footer-meta {
        justify-content: flex-end;
        gap: 6px 12px;
        text-align: right;
    }

    .site-footer-meta span,
    .site-footer-meta span:last-child {
        display: inline-flex;
        min-height: 0;
        align-items: center;
        gap: 12px;
        padding: 0;
        color: var(--clinic-text-muted, #607789);
        background: transparent;
        border: 0;
        border-radius: 0;
        font-size: 11.5px;
        font-weight: 450;
        line-height: 1.4;
    }

    .site-footer-meta span::before {
        display: none;
        content: none;
    }

    .site-footer-meta span + span::before {
        content: "·";
        display: inline;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        color: var(--clinic-text-muted, #607789);
        opacity: 0.6;
    }

    body.dark-theme .site-footer {
        color: #94a3b8;
        background: transparent;
        border-top-color: #1e293b;
        box-shadow: none;
        opacity: 0.68;
    }

    body.dark-theme .site-footer-brand strong,
    body.dark-theme .site-footer-brand span,
    body.dark-theme .site-footer-meta span,
    body.dark-theme .site-footer-meta span:last-child,
    body.dark-theme .site-footer-links a {
        color: #94a3b8;
        background: transparent;
        border-color: transparent;
    }

    body.dark-theme .site-footer-brand strong::before {
        color: #94a3b8;
        background: rgba(148, 163, 184, 0.10);
        border-color: #1e293b;
    }

    body.dark-theme .site-footer-links a:hover,
    body.dark-theme .site-footer-links a:focus-visible {
        color: #e2e8f0;
        background: transparent;
    }
}

@media screen and (max-width: 1180px) {
    body:not(.public-view):not(.tutor-view):not(.lost-pet-view) .site-footer {
        width: 100% !important;
        max-width: none !important;
        justify-content: center;
        gap: 8px 16px;
        margin: auto 0 0 0 !important;
        padding: 14px 0 18px !important;
        text-align: center;
    }

    .site-footer-brand,
    .site-footer-links,
    .site-footer-meta {
        justify-content: center;
        text-align: center;
    }
}

@media screen and (max-width: 768px) {
    body:not(.public-view):not(.tutor-view):not(.lost-pet-view) .site-footer {
        flex-direction: column;
        gap: 6px;
        margin: auto 0 0 0 !important;
        padding: 14px 0 calc(16px + env(safe-area-inset-bottom)) !important;
        border-radius: 0;
        font-size: 11.5px;
    }

    .site-footer-links {
        gap: 4px 12px;
    }

    .site-footer-links a {
        min-height: 0;
        padding: 2px 0;
    }
}

@media screen and (max-width: 430px) {
    body:not(.public-view):not(.tutor-view):not(.lost-pet-view) .site-footer {
        padding: 12px 0 calc(14px + env(safe-area-inset-bottom)) !important;
        font-size: 11px;
    }

    .site-footer-brand {
        flex-direction: column;
        gap: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-footer-links a {
        transition: none;
    }
}
