/* Modales compartidos visor v2 */

.vv2-modal-root {
    position: fixed;
    inset: 0;
    z-index: var(--vv2-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.vv2-modal-root.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.vv2-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 30, 65, 0.5);
    backdrop-filter: blur(4px);
}

.vv2-modal {
    position: relative;
    z-index: 1;
    container-type: inline-size;
    container-name: vv2-modal;
    width: min(100%, 520px);
    max-height: calc(100dvh - var(--vv2-navbar-h) - 28px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--vv2-border);
    box-shadow: 0 24px 48px rgba(1, 30, 65, 0.2);
    overflow: hidden;
    min-height: 0;
}

.vv2-modal--info {
    width: min(100%, 680px);
}

@media (min-width: 900px) {
    .vv2-modal--info {
        width: min(100%, 720px);
    }
}

.vv2-modal--wide {
    width: min(100%, 820px);
}

.vv2-modal--irpf.vv2-modal--wide {
    width: min(calc(100vw - 48px), 920px);
}

@media (min-width: 1200px) {
    .vv2-modal--irpf.vv2-modal--wide {
        width: min(calc(100vw - 80px), 980px);
    }
}

.vv2-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--vv2-border);
}

.vv2-modal-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.vv2-modal-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.vv2-modal-title {
    margin: 0;
    font-size: clamp(1rem, 2.8cqi, 1.12rem);
    font-weight: 700;
    color: var(--vv2-navy);
    line-height: 1.35;
}

.vv2-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--vv2-surface-muted);
    color: var(--vv2-navy);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.vv2-modal-close:hover {
    background: var(--vv2-border);
}

.vv2-modal-body {
    flex: 1;
    min-height: 0;
    padding: 20px 24px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/* Cabecera Cruz Roja */
.vv2-modal--cre .vv2-modal-header {
    background: var(--vv2-cre-red);
    border-bottom: none;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.vv2-modal--cre .vv2-modal-title {
    color: #fff;
}

.vv2-modal--cre .vv2-modal-close {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.vv2-modal--cre .vv2-modal-close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.vv2-modal--cre .vv2-modal-icon {
    filter: brightness(0) invert(1);
}

.vv2-modal-intro {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #475569;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-left: 4px solid var(--vv2-blue);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 4px;
}

.vv2-modal--cre .vv2-modal-intro {
    background: linear-gradient(135deg, #fff5f6 0%, #fffafb 100%);
    border-color: rgba(200, 16, 46, 0.12);
    border-left-color: var(--vv2-cre-red);
}

.vv2-modal-intro .vv2-modal-desc {
    margin: 0;
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.65;
}

.vv2-modal-intro .vv2-modal-desc + .vv2-modal-desc {
    margin-top: 12px;
}

.vv2-text-cre {
    color: var(--vv2-cre-red-dark, #c8102e);
    font-weight: 700;
}

.vv2-modal-intro strong {
    color: var(--vv2-navy);
    font-weight: 700;
}

.vv2-modal-intro .vv2-text-cre {
    color: var(--vv2-cre-red-dark, #c8102e);
}

.vv2-modal-desc {
    margin: 0 0 14px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--vv2-text);
}

.vv2-modal--info .vv2-modal-body {
    padding: 22px 28px 28px;
}

.vv2-modal--info .vv2-modal-header {
    padding: 20px 28px;
}

.vv2-modal-subtitle {
    margin: 22px 0 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vv2-navy);
}

.vv2-modal-list--objectives {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.vv2-modal-list--objectives li {
    position: relative;
    padding: 12px 16px 12px 38px;
    margin-bottom: 8px;
    background: var(--vv2-surface-muted);
    border-radius: 10px;
    border: 1px solid var(--vv2-border);
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--vv2-text);
}

.vv2-modal-list--objectives li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--vv2-cre-red);
}

.vv2-modal-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--vv2-text);
}

.vv2-modal-list li + li {
    margin-top: 6px;
}

body.vv2-modal-open {
    overflow: hidden;
}

@container vv2-modal (max-width: 520px) {
    .vv2-modal-header {
        padding: 16px 18px;
    }

    .vv2-modal-body {
        padding: 16px 18px 20px;
    }
}

@media (max-width: 640px) {
    .vv2-modal-root {
        padding: calc(var(--vv2-navbar-h) + 8px) 10px 10px;
    }

    .vv2-modal {
        max-height: calc(100dvh - var(--vv2-navbar-h) - 18px);
        border-radius: 14px;
    }
}

/* Botón info en cabecera del panel */
.vv2-pane-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.vv2-info-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    font-size: 0.95rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.vv2-info-btn:hover {
    background: rgba(37, 99, 235, 0.16);
    transform: scale(1.04);
}

.vv2-info-btn:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

/* .vv2-back-btn → ver 11-back-button.css */
