.pcpf-form {
    width: 100%;
}

.pcpf-wrapper {
    width: calc(100% - 40px);
    max-width: 1780px;
    margin: 15px auto 0;
    box-sizing: border-box;
}

.pcpf-progress {
    margin-bottom: 32px;
}

.pcpf-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 14px;
}

.pcpf-progress__step {
    font-weight: 600;
}

.pcpf-progress__title {
    text-align: right;
}

.pcpf-progress__bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    background: #e8e8e8;
    border-radius: 999px;
}

.pcpf-progress__fill {
    width: 0;
    height: 100%;
    background: currentColor;
    border-radius: inherit;
    transition: width 0.25s ease;
}

.pcpf-step {
    scroll-margin-top: 40px;
}

.pcpf-step[hidden] {
    display: none !important;
}

.pcpf-step h2 {
    margin-top: 0;
    margin-bottom: 24px;
}

.pcpf-step label {
    display: block;
    margin-bottom: 22px;
    font-weight: 600;
}

.pcpf-step input[type="text"],
.pcpf-step input[type="email"],
.pcpf-step input[type="tel"],
.pcpf-step input[type="date"],
.pcpf-step input[type="number"],
.pcpf-step select,
.pcpf-step textarea {
    width: 100%;
    margin-top: 8px;
    padding: 12px 14px;
    font: inherit;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.pcpf-step input:focus,
.pcpf-step select:focus,
.pcpf-step textarea:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.pcpf-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.pcpf-button {
    min-height: 46px;
    padding: 11px 20px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 8px;
    cursor: pointer;
}

.pcpf-button--primary {
    border: 1px solid #222;
    background: #222;
    color: #fff;
}

.pcpf-button--secondary {
    border: 1px solid #ccc;
    background: #fff;
    color: #222;
}

.pcpf-button:hover {
    opacity: 0.92;
}

.pcpf-submit {
    margin-left: auto;
}

.pcpf-submit .wpcf7-submit {
    margin: 0;
}

.pcpf-form .wpcf7-not-valid-tip {
    margin-top: 6px;
    font-size: 13px;
}

.pcpf-form .wpcf7-response-output {
    margin: 24px 0 0;
}

@media (max-width: 640px) {
    .pcpf-wrapper {
        width: 100%;
    }

    .pcpf-progress__meta {
        display: block;
    }

    .pcpf-progress__title {
        margin-top: 4px;
        text-align: left;
    }

    .pcpf-navigation {
        flex-wrap: wrap;
    }

    .pcpf-button,
    .pcpf-submit,
    .pcpf-submit .wpcf7-submit {
        width: 100%;
    }

    .pcpf-submit {
        margin-left: 0;
    }
}
.pcpf-form .pcpf-field-invalid {
    border-color: #b42318 !important;
}

.pcpf-form .pcpf-validation-error {
    display: block;
    margin-top: 6px;
    color: #b42318;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.pcpf-form .wpcf7-form-control-wrap {
    display: block;
}
/* Custom step validation errors */
.pcpf-form .wpcf7-form-control-wrap .pcpf-validation-error {
    display: block;
    margin-top: 6px;
    color: #b42318 !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

/* Invalid input border */
.pcpf-form .wpcf7-form-control-wrap .pcpf-field-invalid {
    border-color: #b42318 !important;
    box-shadow: 0 0 0 1px #b42318 !important;
}

/* Native CF7 validation errors */
.pcpf-form .wpcf7-not-valid-tip {
    color: #b42318 !important;
    font-size: 13px;
    font-weight: 600;
}
/* --------------------------------------------------------------
   CF7 Radio / Checkbox Groups
-------------------------------------------------------------- */

.pcpf-form .wpcf7-radio,
.pcpf-form .wpcf7-checkbox {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.pcpf-form .wpcf7-list-item {
    margin: 0 !important;
}

.pcpf-form .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.2;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.pcpf-form .wpcf7-list-item label:hover {
    border-color: #999;
}

.pcpf-form .wpcf7-list-item input[type="radio"],
.pcpf-form .wpcf7-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
    accent-color: #222;
}

.pcpf-form .wpcf7-list-item-label {
    display: inline-block;
    cursor: pointer;
}

/* Selected radio/checkbox option */
.pcpf-form .wpcf7-list-item label:has(
    input[type="radio"]:checked
),
.pcpf-form .wpcf7-list-item label:has(
    input[type="checkbox"]:checked
) {
    border-color: #222;
    background: #f5f5f5;
    box-shadow: 0 0 0 1px #222;
}

/* Focus accessibility */
.pcpf-form .wpcf7-list-item input[type="radio"]:focus-visible,
.pcpf-form .wpcf7-list-item input[type="checkbox"]:focus-visible {
    outline: 2px solid #222;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .pcpf-form .wpcf7-radio,
    .pcpf-form .wpcf7-checkbox {
        gap: 10px;
    }

    .pcpf-form .wpcf7-list-item label {
        min-height: 46px;
        padding: 11px 14px;
    }
}
/* --------------------------------------------------------------
   Patient Form Structure
-------------------------------------------------------------- */

.pcpf-step-header {
    margin-bottom: 30px;
}

.pcpf-step-header h2 {
    margin-bottom: 8px;
}

.pcpf-step-description,
.pcpf-section-description {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.pcpf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.pcpf-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pcpf-field {
    min-width: 0;
}

.pcpf-field--full {
    grid-column: 1 / -1;
}

.pcpf-field > label:not(.pcpf-consent-option) {
    display: block;
    margin: 0 0 8px;
    font-weight: 600;
    line-height: 1.4;
}

.pcpf-required {
    color: #b42318;
}

.pcpf-field-help {
    display: block;
    margin-top: 7px;
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}


/* --------------------------------------------------------------
   Inputs
-------------------------------------------------------------- */

.pcpf-form .pcpf-field input[type="text"],
.pcpf-form .pcpf-field input[type="email"],
.pcpf-form .pcpf-field input[type="tel"],
.pcpf-form .pcpf-field input[type="date"],
.pcpf-form .pcpf-field input[type="number"],
.pcpf-form .pcpf-field select,
.pcpf-form .pcpf-field textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #d3d3d3;
    border-radius: 9px;
    background: #fff;
    color: #222;
    font: inherit;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.pcpf-form .pcpf-field textarea {
    min-height: 110px;
    resize: vertical;
}

.pcpf-form .pcpf-field input:focus,
.pcpf-form .pcpf-field select:focus,
.pcpf-form .pcpf-field textarea:focus {
    border-color: #222;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.pcpf-form .pcpf-field input[readonly] {
    background: #f5f5f5;
    cursor: default;
}


/* --------------------------------------------------------------
   Sections
-------------------------------------------------------------- */

.pcpf-section {
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
}

.pcpf-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.pcpf-section h3 {
    margin: 0 0 20px;
    font-size: 22px;
    line-height: 1.3;
}


/* --------------------------------------------------------------
   Notices
-------------------------------------------------------------- */

.pcpf-notice {
    padding: 18px 20px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background: #f8f8f8;
    font-size: 14px;
    line-height: 1.6;
}

.pcpf-notice p {
    margin: 7px 0 0;
}


/* --------------------------------------------------------------
   Consent
-------------------------------------------------------------- */

.pcpf-form .pcpf-consent-option,
.pcpf-form .wpcf7-acceptance .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

.pcpf-form .wpcf7-acceptance input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: #222;
}


/* --------------------------------------------------------------
   Conditional fields
-------------------------------------------------------------- */

.pcpf-conditional[hidden] {
    display: none !important;
}


/* --------------------------------------------------------------
   Mobile
-------------------------------------------------------------- */

@media (max-width: 700px) {

    .pcpf-grid--2 {
        grid-template-columns: 1fr;
    }

    .pcpf-step-header {
        margin-bottom: 24px;
    }

    .pcpf-section {
        margin-top: 28px;
        padding-top: 26px;
    }

}
/* --------------------------------------------------------------
   BPI Questions
-------------------------------------------------------------- */

.pcpf-question {
    margin-bottom: 28px;
}

.pcpf-question-title {
    margin-bottom: 14px;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

.pcpf-question-text {
    margin-bottom: 14px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
}

.pcpf-question-hint {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 13px;
    font-weight: 400;
}

.pcpf-section--first {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}


/* --------------------------------------------------------------
   Rating Questions
-------------------------------------------------------------- */

.pcpf-rating-question {
    margin-top: 28px;
    padding: 22px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
}

.pcpf-rating-question:first-of-type {
    margin-top: 22px;
}

.pcpf-scale-labels {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.pcpf-scale-labels span:last-child {
    text-align: right;
}

.pcpf-rating-scale .wpcf7-radio {
    display: grid;
    grid-template-columns:
        repeat(11, minmax(42px, 1fr));
    gap: 6px;
    margin-top: 0;
}

.pcpf-rating-scale .wpcf7-list-item {
    min-width: 0;
}

.pcpf-rating-scale .wpcf7-list-item label {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 8px 4px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    text-align: center;
}

.pcpf-rating-scale
.wpcf7-list-item
input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.pcpf-rating-scale
.wpcf7-list-item-label {
    width: 100%;
    font-weight: 600;
    text-align: center;
}

.pcpf-rating-scale
.wpcf7-list-item
label:hover {
    border-color: #777;
    background: #f7f7f7;
}

.pcpf-rating-scale
.wpcf7-list-item
label:has(input[type="radio"]:checked) {
    border-color: #222;
    background: #222;
    color: #fff;
    box-shadow: none;
}


/* --------------------------------------------------------------
   BPI Scale Guide
-------------------------------------------------------------- */

.pcpf-scale-guide {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 16px 18px;
    border-radius: 10px;
    background: #f6f6f6;
    color: #555;
    font-size: 14px;
}

.pcpf-scale-guide span {
    display: flex;
    gap: 7px;
    align-items: center;
}

.pcpf-scale-guide span:last-child {
    text-align: right;
}


/* --------------------------------------------------------------
   Body Map Placeholder
-------------------------------------------------------------- */

.pcpf-body-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    margin-top: 20px;
    padding: 30px;
    border: 2px dashed #d5d5d5;
    border-radius: 12px;
    background: #fafafa;
    text-align: center;
}

.pcpf-body-map-placeholder strong {
    margin-bottom: 7px;
    font-size: 17px;
}

.pcpf-body-map-placeholder span {
    color: #666;
    font-size: 14px;
}


/* --------------------------------------------------------------
   Rating Validation
-------------------------------------------------------------- */

.pcpf-group-invalid {
    border-color: #b42318;
}

.pcpf-group-validation-error {
    display: block;
    margin-top: 12px;
    color: #b42318 !important;
    font-size: 13px;
    font-weight: 600;
}


/* --------------------------------------------------------------
   Mobile BPI
-------------------------------------------------------------- */

@media (max-width: 760px) {

    .pcpf-rating-question {
        padding: 18px;
    }

    .pcpf-rating-scale .wpcf7-radio {
        grid-template-columns:
            repeat(6, minmax(42px, 1fr));
    }

    .pcpf-scale-labels {
        font-size: 12px;
    }

}


@media (max-width: 480px) {

    .pcpf-rating-scale .wpcf7-radio {
        grid-template-columns:
            repeat(4, minmax(46px, 1fr));
    }

    .pcpf-scale-labels {
        display: block;
    }

    .pcpf-scale-labels span {
        display: block;
    }

    .pcpf-scale-labels span:last-child {
        margin-top: 4px;
        text-align: left;
    }

    .pcpf-scale-guide {
        display: block;
    }

    .pcpf-scale-guide span + span {
        margin-top: 8px;
    }

}
/* --------------------------------------------------------------
   Interactive Body Map
-------------------------------------------------------------- */

.pcpf-body-map {
    max-width: 560px;
    margin: 24px auto 0;
}

.pcpf-body-map__tabs,
.pcpf-body-map__toolbar {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pcpf-body-map__toolbar {
    margin-top: 14px;
}

.pcpf-body-map__tab,
.pcpf-body-map__tool,
.pcpf-body-map__action {
    appearance: none;
    padding: 10px 16px;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.pcpf-body-map__tab:hover,
.pcpf-body-map__tool:hover,
.pcpf-body-map__action:hover {
    border-color: #777;
}

.pcpf-body-map__tab.is-active,
.pcpf-body-map__tool.is-active {
    border-color: #222;
    background: #222;
    color: #fff;
}

.pcpf-body-map__instructions {
    margin: 18px 0 12px;
    text-align: center;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.pcpf-body-map__canvas-wrap {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 420 / 620;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 14px;
    background-color: #fafafa;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.pcpf-body-map__canvas-wrap--front {
    background-image:
        url("../images/body-front.svg");
}

.pcpf-body-map__canvas-wrap--back {
    background-image:
        url("../images/body-back.svg");
}

.pcpf-body-map__canvas-wrap[hidden] {
    display: none !important;
}

.pcpf-body-map__canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.pcpf-body-map__actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.pcpf-body-map__action {
    font-weight: 500;
}

.pcpf-body-map__status {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    color: #666;
    font-size: 13px;
    text-align: center;
}

.pcpf-body-map__error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff2f0;
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.pcpf-body-map--invalid
.pcpf-body-map__canvas-wrap {
    border-color: #b42318;
    box-shadow:
        0 0 0 1px #b42318;
}


/* Mobile */

@media (max-width: 600px) {

    .pcpf-body-map__tabs,
    .pcpf-body-map__toolbar {
        display: grid;
        grid-template-columns:
            repeat(2, 1fr);
    }

    .pcpf-body-map__tab,
    .pcpf-body-map__tool {
        width: 100%;
    }

    .pcpf-body-map__actions {
        display: grid;
        grid-template-columns:
            repeat(2, 1fr);
    }

    .pcpf-body-map__action {
        width: 100%;
    }

}

/* --------------------------------------------------------------
   Pain History
-------------------------------------------------------------- */

.pcpf-section > .pcpf-field + .pcpf-field {
    margin-top: 22px;
}

.pcpf-section > .pcpf-question + .pcpf-field,
.pcpf-section > .pcpf-field + .pcpf-question {
    margin-top: 26px;
}

/* ==============================================================
   Step Navigator
============================================================== */

.pcpf-stepper {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding: 2px 0 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.pcpf-stepper__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 7px 11px;
    border: 1px solid #d7d7d7;
    border-radius: 999px;
    background: #fff;
    color: #525252;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.pcpf-stepper__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #ececec;
    color: #333;
    font-size: 12px;
    font-weight: 700;
}

.pcpf-stepper__item.is-current {
    border-color: #222;
    background: #222;
    color: #fff;
}

.pcpf-stepper__item.is-current .pcpf-stepper__number {
    background: #fff;
    color: #222;
}

.pcpf-stepper__item.is-completed {
    border-color: #8a8a8a;
    color: #222;
}

.pcpf-stepper__item.is-completed .pcpf-stepper__number {
    background: #222;
    color: #fff;
}

.pcpf-stepper__item.is-future,
.pcpf-stepper__item:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.pcpf-stepper__item:not(:disabled):hover {
    border-color: #222;
}


/* ==============================================================
   Final Review
============================================================== */

.pcpf-review {
    display: grid;
    gap: 18px;
}

.pcpf-review__section {
    overflow: hidden;
    border: 1px solid #dfdfdf;
    border-radius: 12px;
    background: #fff;
}

.pcpf-review__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e7e7e7;
    background: #f8f8f8;
}

.pcpf-review__header h3 {
    margin: 0;
    font-size: 17px;
}

.pcpf-review__edit {
    appearance: none;
    padding: 6px 11px;
    border: 1px solid #cfcfcf;
    border-radius: 7px;
    background: #fff;
    color: #222;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.pcpf-review__list {
    display: grid;
    grid-template-columns: minmax(160px, 0.7fr) minmax(0, 1.3fr);
    margin: 0;
}

.pcpf-review__list dt,
.pcpf-review__list dd {
    margin: 0;
    padding: 11px 16px;
    border-bottom: 1px solid #ededed;
}

.pcpf-review__list dt {
    font-weight: 600;
    color: #444;
}

.pcpf-review__list dd {
    overflow-wrap: anywhere;
}

.pcpf-review__list dt:last-of-type,
.pcpf-review__list dd:last-of-type {
    border-bottom: 0;
}

.pcpf-review__empty {
    margin: 0;
    padding: 14px 16px;
    color: #666;
}

.pcpf-form--submitted > .pcpf-wrapper {
    display: none !important;
}

@media (max-width: 640px) {
    .pcpf-progress__bar {
        margin-bottom: 10px;
    }

    .pcpf-stepper {
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .pcpf-stepper__label {
        max-width: 125px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pcpf-review__list {
        grid-template-columns: 1fr;
    }

    .pcpf-review__list dt {
        padding-bottom: 3px;
        border-bottom: 0;
    }

    .pcpf-review__list dd {
        padding-top: 3px;
    }
}
