.qpaf-page {
    --qpaf-ink: #1f262b;
    --qpaf-fisico: #d5f2f8;
    --qpaf-fisico-soft: #eefafd;
    --qpaf-fisico-strong: #236d7b;
    --qpaf-social: #c3e2d2;
    --qpaf-social-soft: #edf7f2;
    --qpaf-social-strong: #2f6d50;
    --qpaf-cognitivo: #f5c8cd;
    --qpaf-cognitivo-soft: #fdf0f2;
    --qpaf-cognitivo-strong: #9a3447;
    --qpaf-psicologico: #fdf6c8;
    --qpaf-psicologico-soft: #fffbea;
    --qpaf-psicologico-strong: #755f12;
    min-height: 100vh;
    padding-bottom: 72px;
    background: #f4f5f7;
    color: var(--qpaf-ink);
    font-family: 'Montserrat', sans-serif;
}

.page-template-page-templatesquestionario-qpaf-php main,
.page-template-questionario-qpaf main {
    padding-bottom: 72px;
}

.qpaf-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 0 0;
}

.qpaf-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.qpaf-hero__content,
.qpaf-panel,
.qpaf-domain,
.qpaf-question-card,
.qpaf-document {
    background: #fff;
    border: 1px solid rgba(31, 38, 43, 0.12);
    border-radius: 12px;
    box-shadow: none;
}

.qpaf-hero__content {
    width: 100%;
    padding: 38px;
}

.qpaf-language-switch {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qpaf-language-switch__label {
    color: #4b5860;
    font-size: 0.9rem;
    font-weight: 700;
}

.qpaf-eyebrow,
.qpaf-panel__kicker,
.qpaf-question-card__domain {
    margin: 0 0 10px;
    color: #75695f;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.qpaf-hero h1,
.qpaf-panel h2,
.qpaf-document h3,
.qpaf-domain__header h2 {
    margin: 0;
    color: #15232c;
    font-family: 'Montserrat', sans-serif;
}

.qpaf-hero h1 {
    font-size: clamp(2rem, 6vw, 1rem);
    margin-bottom: 1rem;
}

.qpaf-intro,
.qpaf-copy p,
.qpaf-domain__description,
.qpaf-submit-note,
.qpaf-fieldset__help {
    margin: 0;
    color: #49555d;
    font-size: 1rem;
    line-height: 1.6;
}

.qpaf-panel,
.qpaf-domain,
.qpaf-result {
    margin-bottom: 24px;
}

.qpaf-panel {
    padding: 26px;
}

.qpaf-cheatsheet {
    border-color: rgba(31, 38, 43, 0.16);
}

.qpaf-cheatsheet p {
    color: #4f5c64;
}

.qpaf-cheatsheet-table thead td,
.qpaf-cheatsheet-table thead th {
    border-color: #1e262b;
}

.qpaf-cheatsheet-table th,
.qpaf-cheatsheet-table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    border-color: #1e262b;
}

.qpaf-cheatsheet-table th:nth-child(1),
.qpaf-cheatsheet-table td:nth-child(1) {
    background: var(--qpaf-fisico-soft);
    color: #173f48;
}

.qpaf-cheatsheet-table th:nth-child(2),
.qpaf-cheatsheet-table td:nth-child(2) {
    background: var(--qpaf-social-soft);
    color: #1f4f39;
}

.qpaf-cheatsheet-table th:nth-child(3),
.qpaf-cheatsheet-table td:nth-child(3) {
    background: var(--qpaf-cognitivo-soft);
    color: #662330;
}

.qpaf-cheatsheet-table th:nth-child(4),
.qpaf-cheatsheet-table td:nth-child(4) {
    background: var(--qpaf-psicologico-soft);
    color: #51410c;
}

.qpaf-cheatsheet-table th {
    font-weight: 800;
}

.qpaf-part-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
}

.qpaf-panel--part1 .qpaf-panel__kicker,
.qpaf-panel--instructions .qpaf-panel__kicker {
    /* margin: 0 0 30px; */
    color: #15232c;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.qpaf-part2-description {
    max-width: 860px;
    margin: 0 0 18px;
    color: #34444e;
    font-size: 0.98rem;
    line-height: 1.6;
}

.qpaf-intake-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.qpaf-input-label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #2b3942;
}

.qpaf-input-label input {
    min-height: 44px;
}

.qpaf-input-label textarea {
    min-height: 130px;
    resize: vertical;
}

.qpaf-input-label input:focus-visible {
    outline-offset: 1px;
}

.qpaf-input-label textarea:focus-visible {
    outline-offset: 1px;
}

.qpaf-part1-grid {
    display: grid;
    gap: 14px;
}

.qpaf-part1-card {
    padding: 18px;
    border: 1px solid rgba(31, 38, 43, 0.12);
    border-radius: 10px;
    background: #fafafa;
}

.qpaf-part1-card h3 {
    margin: 0 0 12px;
    font-size: 1.02rem;
}

.qpaf-part1-description {
    margin: 0 0 12px;
    color: #4f5c64;
}

.qpaf-input-label--full {
    grid-column: 1 / -1;
}

.qpaf-table-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 8px;
    overflow-x: auto;
}

.qpaf-table-grid__head {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3a4951;
}

.qpaf-table-grid input {
    min-width: 140px;
}

.qpaf-domain {
    padding: 22px;
}

.qpaf-domain__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 24px;
}

.qpaf-domain__description {
    max-width: 560px;
    margin-top: 8px;
}

.qpaf-domain--fisico {
    border-color: rgba(35, 109, 123, 0.4);
}

.qpaf-domain--social {
    border-color: rgba(47, 109, 80, 0.4);
}

.qpaf-domain--cognitivo {
    border-color: rgba(154, 52, 71, 0.38);
}

.qpaf-domain--psicologico {
    border-color: rgba(117, 95, 18, 0.42);
}

.qpaf-question-grid {
    display: grid;
    gap: 18px;
}

.qpaf-question-card {
    padding: 18px;
}

.qpaf-question-card.is-complete {
    box-shadow: inset 0 0 0 2px rgba(21, 35, 44, 0.16);
}

.qpaf-question-card[data-domain="fisico"] {
    border-color: rgba(35, 109, 123, 0.28);
    background: var(--qpaf-fisico-soft);
}

.qpaf-question-card[data-domain="social"] {
    border-color: rgba(47, 109, 80, 0.28);
    background: var(--qpaf-social-soft);
}

.qpaf-question-card[data-domain="cognitivo"] {
    border-color: rgba(154, 52, 71, 0.26);
    background: var(--qpaf-cognitivo-soft);
}

.qpaf-question-card[data-domain="psicologico"] {
    border-color: rgba(117, 95, 18, 0.28);
    background: var(--qpaf-psicologico-soft);
}

.qpaf-question-card__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.qpaf-question-card__number {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #15232c;
    color: #fff;
    font-weight: 700;
}

.qpaf-question-card[data-domain="fisico"] .qpaf-question-card__number {
    background: var(--qpaf-fisico-strong);
}

.qpaf-question-card[data-domain="social"] .qpaf-question-card__number {
    background: var(--qpaf-social-strong);
}

.qpaf-question-card[data-domain="cognitivo"] .qpaf-question-card__number {
    background: var(--qpaf-cognitivo-strong);
}

.qpaf-question-card[data-domain="psicologico"] .qpaf-question-card__number {
    background: var(--qpaf-psicologico-strong);
}

.qpaf-question-card h3 {
    margin: 0 0 16px;
    font-size: 1.04rem;
    line-height: 1.45;
}

.qpaf-inline-video {
    width: min(100%, 700px);
    margin: 18px auto 26px;
    border: 1px solid rgba(31, 38, 43, 0.14);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.qpaf-inline-video iframe {
    width: 100%;
    border: 0;
    aspect-ratio: 16 / 9;
    display: block;
}

.qpaf-fieldset {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.qpaf-fieldset--yesno legend {
    margin-bottom: 8px;
}

.qpaf-fieldset legend {
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.qpaf-fieldset__instruction {
    margin: -2px 0 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #5f6a71;
}

.qpaf-choice-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.qpaf-choice-group--satisfaction {
    gap: 8px;
}

.qpaf-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qpaf-chip input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.qpaf-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(31, 38, 43, 0.16);
    background: #f8f8f6;
    color: #22313b;
    font-weight: 700;
    transition: all 0.18s ease;
}

.qpaf-chip--score span {
    min-width: 46px;
}

.qpaf-chip--score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.qpaf-chip__emoji {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.qpaf-chip input:focus-visible + span {
    outline: 3px solid rgba(36, 122, 255, 0.3);
    outline-offset: 2px;
}

.qpaf-chip input:checked + span {
    background: #15232c;
    border-color: #15232c;
    color: #fff;
    transform: translateY(-1px);
}

.qpaf-chip input:checked + span + .qpaf-chip__emoji {
    opacity: 1;
    transform: scale(1.08);
}

.qpaf-panel--submit .qpaf-submit-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.qpaf-submit-actions {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 10px;
}

.qpaf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.qpaf-button:hover,
.qpaf-button:focus-visible {
    text-decoration: none;
}

.qpaf-button--secondary {
    color: inherit;
}

.qpaf-button--secondary:hover,
.qpaf-button--secondary:focus-visible {
    color: inherit;
}

.qpaf-result__toolbar {
    display: flex;
    justify-content: end;
    gap: 18px;
    align-items: center;
    margin: 4em 0 2em 0;
}

.qpaf-document {
    padding: 34px;
}

.qpaf-document__header,
.qpaf-document__summary {
    display: grid;
    gap: 18px;
    align-items: end;
}

.qpaf-document__date {
    margin: 0;
    text-align: right;
    color: #49555d;
}

.qpaf-document__report-title {
    margin: 24px 0 14px;
    color: #15232c;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
}

.qpaf-document__summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 28px 0;
}

.qpaf-document__wheel {
    margin: 0 0 28px;
}

.qpaf-document__wheel-copy {
    max-width: 920px;
    margin: 0 auto 18px;
    text-align: left;
}

.qpaf-document__wheel-copy h3 {
    margin: 0 0 10px;
    color: #15232c;
}

.qpaf-document__wheel-copy p {
    margin: 0;
    color: #3e4c55;
    font-size: 0.92rem;
    line-height: 1.55;
}

.qpaf-wheel-card {
    max-width: 300px;
    margin: 0 auto;
}

.qpaf-document__wheel .qpaf-wheel-card {
    max-width: 420px;
}

.qpaf-wheel {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 50%;
    background: #fff;
}

.qpaf-wheel circle,
.qpaf-wheel line {
    fill: none;
    stroke: rgba(31, 38, 43, 0.3);
    stroke-width: 1;
}

.qpaf-wheel text {
    fill: #1f262b;
    font-size: 14px;
    font-weight: 700;
}

.qpaf-wheel__fill {
    opacity: 0.92;
}

.qpaf-wheel__fill--fisico,
.qpaf-wheel-legend__swatch--fisico {
    fill: #d5f2f8;
    background: #d5f2f8;
}

.qpaf-wheel__fill--social,
.qpaf-wheel-legend__swatch--social {
    fill: #c3e2d2;
    background: #c3e2d2;
}

.qpaf-wheel__fill--cognitivo,
.qpaf-wheel-legend__swatch--cognitivo {
    fill: #f5c8cd;
    background: #f5c8cd;
}

.qpaf-wheel__fill--psicologico,
.qpaf-wheel-legend__swatch--psicologico {
    fill: #fdf6c8;
    background: #fdf6c8;
}

.qpaf-wheel-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 12px;
    color: #4f5c64;
    font-size: 0.82rem;
    font-weight: 600;
}

.qpaf-wheel-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qpaf-wheel-legend__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(31, 38, 43, 0.18);
    border-radius: 3px;
}

.qpaf-metric,
.qpaf-answer-item {
    padding: 18px;
    border-radius: 10px;
    background: #f7f8fa;
}

.qpaf-metric span,
.qpaf-answer-item p {
    display: block;
    color: #5a666e;
}

.qpaf-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 1.5rem;
}

.qpaf-answer-results {
    display: grid;
    gap: 14px;
    margin: 20px 0;
}

.qpaf-answer-results {
    grid-template-columns: 1fr;
}

.qpaf-answer-item h4,
.qpaf-document__wheel-copy h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.qpaf-answer-item strong {
    color: #15232c;
}

.qpaf-document__print-footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(31, 38, 43, 0.12);
}

@media (max-width: 991px) {
    .qpaf-hero,
    .qpaf-document__header,
    .qpaf-document__summary,
    .qpaf-panel--submit,
    .qpaf-domain__header,
    .qpaf-result__toolbar {
        grid-template-columns: 1fr;
        display: grid;
    }

    .qpaf-submit-actions {
        align-items: stretch;
    }

    .qpaf-result__toolbar {
        align-items: start;
    }

    .qpaf-intake-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .qpaf-shell {
        padding-top: 24px;
    }

    .qpaf-hero__content,
    .qpaf-panel,
    .qpaf-domain,
    .qpaf-question-card,
    .qpaf-document {
        padding: 22px;
        border-radius: 22px;
    }

    .qpaf-choice-group--satisfaction {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .qpaf-document__summary {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body header,
    body footer,
    .qpaf-page .qpaf-hero,
    .qpaf-page .qpaf-panel--instructions,
    .qpaf-page .qpaf-form,
    .qpaf-page .qpaf-result__toolbar,
    .qpaf-page .qpaf-document__print-footer {
        display: none !important;
    }

    body,
    main,
    .qpaf-page {
        background: #fff !important;
        padding: 0 !important;
    }

    .qpaf-page .qpaf-document {
        box-shadow: none;
        border: 0;
        padding: 0;
    }

    .qpaf-result,
    .qpaf-document__summary,
    .qpaf-document__wheel,
    .qpaf-answer-results {
        margin: 8px 0 !important;
    }

    .qpaf-document__header {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 8px;
        margin-bottom: 8px;
    }

    .qpaf-document__header h3 {
        font-size: 1.05rem;
    }

    .qpaf-eyebrow {
        margin-bottom: 4px;
        font-size: 0.7rem;
    }

    .qpaf-document__date {
        font-size: 0.75rem;
    }

    .qpaf-document__report-title {
        margin: 8px 0 6px;
        font-size: 0.95rem;
    }

    .qpaf-document__summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .qpaf-metric,
    .qpaf-answer-item {
        padding: 8px;
        border: 1px solid rgba(31, 38, 43, 0.14);
        background: #fff;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .qpaf-metric span,
    .qpaf-answer-item p {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .qpaf-metric strong {
        margin-top: 2px;
        font-size: 1rem;
    }

    .qpaf-answer-results {
        gap: 6px;
    }

    [data-qpaf-identification-results],
    [data-qpaf-part1-results] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    [data-qpaf-answer-results] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qpaf-answer-item h4 {
        margin-bottom: 3px;
        font-size: 0.76rem;
        line-height: 1.25;
    }

    .qpaf-answer-item p {
        margin-bottom: 2px;
    }

    .qpaf-document__wheel {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .qpaf-document__wheel-copy {
        margin-bottom: 8px;
    }

    .qpaf-document__wheel-copy h3 {
        margin-bottom: 4px;
        font-size: 0.95rem;
    }

    .qpaf-document__wheel-copy p {
        font-size: 0.68rem;
        line-height: 1.22;
    }

    .qpaf-document__wheel .qpaf-wheel-card {
        max-width: 250px;
    }

    .qpaf-wheel-legend {
        margin-top: 6px;
        gap: 4px 8px;
        font-size: 0.65rem;
    }
}
