/* VoucherGratis Patch 030 — Accessibility / Responsive / Consistency QA
 * Cross-cutting presentation hardening only. No domain or transactional behavior.
 */

:root {
    --vg030-focus-color: var(--vg-primary, #F45A07);
    --vg030-focus-ring: 0 0 0 3px color-mix(in srgb, var(--vg030-focus-color) 28%, transparent);
}

.vg-public-body {
    --vg030-focus-color: var(--campaign-primary, var(--vg-primary, #F45A07));
}

.vg030-skip-link {
    position: fixed;
    inset-block-start: max(8px, env(safe-area-inset-top));
    inset-inline-start: max(8px, env(safe-area-inset-left));
    z-index: 1000;
    max-width: calc(100vw - 16px);
    padding: 10px 14px;
    border: 2px solid currentColor;
    border-radius: 10px;
    background: var(--vg-surface-raised, #FFFFFF);
    color: var(--vg-text-primary, #0F172A);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform 140ms ease;
}

.vg030-skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--vg030-focus-color);
    outline-offset: 2px;
}

.vg030-a11y-ready :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--vg030-focus-color) !important;
    outline-offset: 2px !important;
    box-shadow: var(--vg030-focus-ring);
}

.vg030-a11y-ready :where([aria-disabled="true"], button:disabled, input:disabled, select:disabled, textarea:disabled) {
    cursor: not-allowed;
}

.vg030-a11y-ready :where(.vg-app__content, .vg-auth, .vg-public-shell)[tabindex="-1"]:focus {
    outline: none;
}

.vg030-a11y-ready :where(.vg-app__content, .vg-auth, .vg-public-shell) {
    min-width: 0;
}

.vg030-a11y-ready :where(.vg-app__content, .vg-auth, .vg-public-shell) :where(img, svg, video, canvas) {
    max-width: 100%;
}

.vg030-a11y-ready :where(.vg-app__content, .vg-public-shell) :where(p, li, dd, td, th, code, pre, a) {
    overflow-wrap: anywhere;
}

.vg030-a11y-ready :where(.vg-table-wrap, .vg-campaign-table-wrap, .vg-vcc-table-wrap, .vg-rx-table-wrap, .vg024-table-wrap, .vg030-scroll-region) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.vg030-a11y-ready .vg030-scroll-region:focus-visible {
    border-radius: 8px;
}

.vg030-a11y-ready :where(.vg-page-header, .vg-section__header, .vg-card__header, .vg-form-actions, .vg-modal-actions) > * {
    min-width: 0;
}

.vg030-a11y-ready :where(.vg-page-header__actions, .vg-section__actions, .vg-form-actions, .vg-modal-actions) {
    flex-wrap: wrap;
}

.vg030-a11y-ready :where(.vg-status, .vg-badge) {
    white-space: normal;
    text-wrap: balance;
}

.vg030-a11y-ready :where(.vg-modal__panel, .vg-sheet__panel) {
    overscroll-behavior: contain;
}

.vg030-a11y-ready :where(.vg-modal__body, .vg-sheet__body) {
    min-width: 0;
}

.vg030-a11y-ready :where(.vg-input, .vg-select, .vg-textarea, .vg-search__input) {
    max-width: 100%;
}

.vg030-a11y-ready .vg-field__error {
    font-weight: 650;
}

.vg030-a11y-ready [aria-invalid="true"] {
    border-color: var(--vg-danger, #DC2626);
}

.vg030-a11y-ready [aria-busy="true"] {
    cursor: progress;
}

@media (max-width: 767px) {
    .vg030-a11y-ready :where(.vg-button, .vg-icon-button, .vg-modal__close, .vg-sheet__close, [data-vg-sheet-open], [data-modal-open]) {
        min-height:44px;
    }

    .vg030-a11y-ready :where(
        input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
        select,
        textarea
    ) {
        min-height:44px;
        font-size: max(16px, 1em);
    }

    .vg030-a11y-ready :where(.vg-page-header, .vg-section__header) {
        gap: 12px;
    }

    .vg030-a11y-ready :where(.vg-page-header__actions, .vg-section__actions, .vg-form-actions, .vg-modal-actions) {
        width: 100%;
    }

    .vg030-a11y-ready :where(.vg-page-header__actions, .vg-section__actions, .vg-form-actions, .vg-modal-actions) > :where(.vg-button, button, a) {
        min-height:44px;
    }

    .vg030-a11y-ready :where(.vg-modal__panel, .vg-sheet__panel) {
        max-width: 100vw;
    }
}

@media (max-width: 420px) {
    .vg030-a11y-ready :where(.vg-page-header__actions, .vg-section__actions, .vg-modal-actions) {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .vg030-a11y-ready :where(.vg-page-header__actions, .vg-section__actions, .vg-modal-actions) > * {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    .vg030-a11y-ready *,
    .vg030-a11y-ready *::before,
    .vg030-a11y-ready *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: more) {
    .vg030-a11y-ready :where(.vg-card, .vg-input, .vg-select, .vg-textarea, .vg-modal__panel, .vg-sheet__panel, .vg-table-wrap, .vg-campaign-table-wrap, .vg-vcc-table-wrap, .vg-rx-table-wrap, .vg024-table-wrap) {
        border-width: 2px;
    }

    .vg030-a11y-ready :where(.vg-status__dot, .vg-badge) {
        outline: 1px solid currentColor;
    }
}

@media (forced-colors: active) {
    .vg030-skip-link,
    .vg030-a11y-ready :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
        outline: 2px solid Highlight !important;
        outline-offset: 2px !important;
        box-shadow: none !important;
    }

    .vg030-a11y-ready :where(.vg-status, .vg-badge, .vg-button, .vg-icon-button) {
        forced-color-adjust: auto;
    }
}
