/*
 * VHIVHE DS â€” componentes (F-DS-C).
 * ConsolidaciÃ³n de clusters idÃ©nticos (paridad visual).
 * Duales compuestos: .vh-ds-X.legacy â€” nunca .vh-ds-X solo si hay varios legacy.
 */

/* --- Hero band: avatar idÃ©ntico (cat / entorno / fÃ­sico / parque) --- */
.vh-cat-hero__avatar,
.vh-entorno-hero__avatar,
.vh-fisico-hero__avatar,
.vh-parque-hero__avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--vh-ds-primary-strong), var(--vh-ds-primary-soft));
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: var(--vh-ds-shadow-primary);
}

.vh-cat-hero__avatar .ti,
.vh-entorno-hero__avatar .ti,
.vh-fisico-hero__avatar .ti,
.vh-parque-hero__avatar .ti {
    font-size: 22px;
}

/* --- Hero band chrome compartido (mismo computed style) --- */
.vh-ds-hero.vh-entorno-hero,
.vh-entorno-hero,
.vh-ds-hero.vh-fisico-hero,
.vh-fisico-hero,
.vh-ds-hero.vh-parque-hero,
.vh-parque-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--vh-ds-primary-bg) 0%, var(--vh-ds-surface) 100%);
    border-bottom: 1px solid var(--vh-ds-hairline);
}

/* === F-PREF-B: Preferencias — paridad visual PA (ia-onb-*), CSS propio VHIVHE === */
body.vh-ds-modal-open {
    overflow: hidden;
}

.vh-ds-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--vh-ds-z-modal, 9000);
    background: #0f172a8c;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.vh-ds-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--vh-ds-surface, #fff);
    color: var(--vh-ds-text, #0f172a);
    border-radius: 18px;
    box-shadow: 0 20px 50px #00000059;
    overflow: hidden;
    outline: none;
    padding: 0;
    gap: 0;
}

.vh-ds-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 18px 4px;
}

.vh-ds-modal__heading {
    flex: 1;
    min-width: 0;
}

.vh-ds-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.25;
    color: var(--vh-ds-text, #0f172a);
}

.vh-ds-modal__sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--vh-ds-text-3, #64748b);
    line-height: 1.4;
}

.vh-ds-modal__close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, 0.12);
    color: var(--vh-ds-text-2, #475569);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.vh-ds-step-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 0;
}

.vh-ds-step-progress__dot {
    width: 28px;
    height: 4px;
    border-radius: 2px;
    background: var(--vh-ds-border, #e2e8f0);
    flex-shrink: 0;
}

.vh-ds-step-progress__dot--done {
    background: #9333ea;
}

.vh-ds-step-progress__dot--active {
    background: #4285f4;
}

.vh-ds-step-progress__label {
    margin: 0 0 0 auto;
    font-size: 11.5px;
    color: var(--vh-ds-text-3, #64748b);
    font-weight: 600;
    white-space: nowrap;
}

.vh-ds-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
}

.vh-ds-pref-question {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vh-ds-pref-question__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--vh-ds-text, #0f172a);
}

.vh-ds-pref-question__sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--vh-ds-text-3, #64748b);
    line-height: 1.4;
}

.vh-ds-choice-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.vh-ds-choice-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--vh-ds-border, #e2e8f0);
    background: var(--vh-ds-surface, #fff);
    cursor: pointer;
    font: inherit;
    color: var(--vh-ds-text-2, #475569);
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.vh-ds-choice-tile:hover {
    border-color: #9ca3af;
    background: #f1f5f9;
    color: var(--vh-ds-text, #0f172a);
}

.vh-ds-choice-tile:active {
    transform: scale(0.98);
}

.vh-ds-choice-tile--active {
    border-color: #9ca3af;
    background: #f1f5f9;
    color: var(--vh-ds-text, #0f172a);
}

.vh-ds-choice-tile__icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #8f8f8f1a;
    color: #141414;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.vh-ds-choice-tile--active .vh-ds-choice-tile__icon {
    background: #4285f4;
    color: #fff;
}

.vh-ds-choice-tile__label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.vh-ds-choice-tile__sub {
    font-size: 11.5px;
    color: var(--vh-ds-text-3, #64748b);
    line-height: 1.3;
}

.vh-ds-pref-priorities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vh-ds-priority {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--vh-ds-border, #e2e8f0);
    background: var(--vh-ds-surface, #fff);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--vh-ds-text-2, #475569);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.vh-ds-priority:hover:not(:disabled) {
    border-color: #9333ea;
}

.vh-ds-priority:active {
    transform: scale(0.97);
}

.vh-ds-priority--active {
    border-color: transparent;
    background: linear-gradient(135deg, #4285f41a, #9333ea24, #ea43351a);
    color: var(--vh-ds-text, #0f172a);
    box-shadow: 0 0 0 1.5px #9333ea, 0 4px 12px -4px #9333ea59;
}

.vh-ds-priority:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.vh-ds-priority__rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #9333ea, #ea4335);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.vh-ds-priority__icon {
    font-size: 14px;
    color: #7c3aed;
}

.vh-ds-priority--active .vh-ds-priority__icon {
    color: var(--vh-ds-text, #0f172a);
}

.vh-ds-modal__close:hover {
    background: var(--vh-ds-border, #e2e8f0);
}

.vh-ds-modal__close .ti {
    font-size: 18px;
}

/*
 * Footer del modal de preferencias.
 * Especificidad alta a propósito: informes-report.css redefine .vh-ds-btn / --primary
 * (barra de acciones del informe) y no debe pisar estos botones.
 */
.vh-ds-modal__footer {
    display: flex;
    gap: 10px;
    padding: 14px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--vh-ds-border, #e2e8f0);
}

.vh-ds-modal__footer .vh-ds-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    min-width: 0;
    box-shadow: none;
    transition: transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.vh-ds-modal__footer .vh-ds-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.vh-ds-modal__footer .vh-ds-btn--ghost {
    background: transparent;
    color: var(--vh-ds-text-2, #475569);
    border: 1px solid var(--vh-ds-border-strong, #cbd5e1);
}

.vh-ds-modal__footer .vh-ds-btn--primary {
    flex: 1 1 auto;
    background: #4285f4;
    color: #fff;
    border: none;
}

.vh-ds-modal__footer .vh-ds-btn--primary:hover:not(:disabled) {
    filter: brightness(1.03);
}

.vh-ds-modal__footer .vh-ds-btn--disabled,
.vh-ds-modal__footer .vh-ds-btn:disabled {
    background: var(--vh-ds-border, #e2e8f0) !important;
    color: var(--vh-ds-text-muted, #94a3b8) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    filter: none !important;
}

/* Paso 1: sin Atrás (display: del report anula a veces el UA [hidden]) */
.vh-ds-modal__footer .vh-ds-btn[hidden],
.vh-ds-modal__footer .vh-ds-btn.is-hidden {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .vh-ds-choice-tile,
    .vh-ds-modal__footer .vh-ds-btn,
    .vh-ds-priority {
        transition: none;
    }
}