.ams-cbp {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: min(760px, calc(100vw - 24px));
    width: 100%;
    max-height: calc(100dvh - 28px);
    color: #18233a;
}

.ams-cbp::backdrop {
    background: rgba(10, 19, 38, .72);
    backdrop-filter: blur(3px);
}

.ams-cbp-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 22px 75px rgba(0, 0, 0, .25);
    overflow: auto;
    max-height: calc(100dvh - 28px);
}

.ams-cbp-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 32px 14px;
}

.ams-cbp-kicker {
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .1em;
    color: #1765d6;
}

.ams-cbp h2 {
    font-size: clamp(21px, 3vw, 27px);
    line-height: 1.2;
    margin: 8px 0;
    color: #17223b;
}

.ams-cbp-header p {
    margin: 0;
    color: #657187;
    font-size: 14px;
}

.ams-cbp-close {
    flex: none;
    align-self: flex-start;
    border: 1px solid #e2e6ed;
    background: #fff;
    border-radius: 50%;
    height: 38px;
    width: 38px;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    color: #26344e;
}

.ams-cbp-preview {
    background: #f4f7fd;
    color: #40536b;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 32px;
}

.ams-cbp-progress {
    padding: 18px 32px 0;
    color: #405574;
    font-weight: 600;
    font-size: 12px;
}

.ams-cbp-track {
    height: 5px;
    margin-top: 9px;
    background: #e9eef5;
    border-radius: 4px;
    overflow: hidden;
}

.ams-cbp-track span {
    display: block;
    width: 25%;
    height: 100%;
    background: #1465df;
    transition: width .2s;
}

.ams-cbp form {
    margin: 0;
}

.ams-cbp section {
    padding: 18px 32px 8px;
}

.ams-cbp h3 {
    font-size: 19px;
    margin: 0 0 16px;
    color: #1c2b46;
}

.ams-cbp-help,
.ams-cbp-files p,
.ams-cbp-next-stage {
    font-size: 13px;
    line-height: 1.55;
    color: #59677c;
}

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

.ams-cbp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 15px;
    font-size: 13px;
    font-weight: 650;
    color: #2b3850;
}

.ams-cbp-field select,
.ams-cbp-field input,
.ams-cbp-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #cad3df;
    border-radius: 9px;
    padding: 11px 12px;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 400;
    min-height: 43px;
}

.ams-cbp-field textarea {
    min-height: 90px;
    resize: vertical;
}

.ams-cbp-field :is(select, input, textarea):focus-visible,
.ams-cbp :is(button, input):focus-visible {
    outline: 2px solid #1b6de8;
    outline-offset: 2px;
}

.ams-cbp fieldset {
    border: 1px solid #e0e7f0;
    border-radius: 12px;
    margin: 2px 0 16px;
    padding: 12px 14px 2px;
    min-width: 0;
}

.ams-cbp legend {
    font-size: 13px;
    font-weight: 700;
    padding: 0 6px;
    color: #293a59;
}

.ams-cbp-needs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ams-cbp-needs legend {
    margin-bottom: 8px;
}

.ams-cbp-needs label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #e1e7f1;
    padding: 10px;
    border-radius: 9px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.4;
}

.ams-cbp-needs input {
    margin-top: 2px;
    accent-color: #1566dd;
}

.ams-cbp-error {
    color: #bb273b;
    font-size: 13px;
    font-weight: 650;
}

.ams-cbp-files,
.ams-cbp-next-stage {
    background: #f5f8fc;
    border-radius: 10px;
    padding: 14px;
    margin: 4px 0 12px;
}

.ams-cbp-files strong {
    font-size: 14px;
}

.ams-cbp-files p {
    margin: 5px 0 0;
}

.ams-cbp-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e9edf3;
    padding: 17px 32px 24px;
}

.ams-cbp-footer button {
    border-radius: 9px;
    padding: 11px 22px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

.ams-cbp-primary {
    border: 1px solid #1769df;
    background: #1769df;
    color: #fff;
}

.ams-cbp-secondary {
    border: 1px solid #c9d4e4;
    background: #fff;
    color: #243651;
}

.ams-cbp-summary {
    display: grid;
    grid-template-columns: minmax(100px, 170px) 1fr;
    gap: 10px 14px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.ams-cbp-summary dt {
    font-weight: 700;
    color: #30415e;
}

.ams-cbp-summary dd {
    margin: 0;
    color: #3b4b60;
    white-space: pre-wrap;
}

.ams-cbp [hidden] {
    display: none !important;
}

@media (max-width: 580px) {
    .ams-cbp {
        max-width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
    }

    .ams-cbp-panel {
        max-height: calc(100dvh - 12px);
        border-radius: 12px;
    }

    .ams-cbp-header {
        padding: 19px 18px 12px;
    }

    .ams-cbp-preview {
        padding: 10px 18px;
    }

    .ams-cbp-progress {
        padding: 16px 18px 0;
    }

    .ams-cbp section {
        padding: 18px 18px 6px;
    }

    .ams-cbp-footer {
        padding: 14px 18px 20px;
    }

    .ams-cbp-grid,
    .ams-cbp-needs {
        grid-template-columns: 1fr;
    }

    .ams-cbp-summary {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .ams-cbp-summary dd {
        margin-bottom: 10px;
    }
}


/* Mention fiscale : consultation en franchise en base de TVA. */
.ams-cbp .ams-cbp-tax-notice {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.45;
    color: #64748b;
}

/* R3G : documents de préparation. */
.ams-cbp-files [data-ams-cbp-documents] {
    display: block;
    width: 100%;
    margin: 12px 0;
    font: inherit;
}
.ams-cbp-files [data-ams-cbp-document-list] {
    padding-left: 20px;
    overflow-wrap: anywhere;
}
.ams-cbp [data-ams-cbp-upload-feedback] {
    margin: 12px 0;
    line-height: 1.5;
}

/* R5 — Sélection des créneaux de consultation */
.ams-cbp-cal-days {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}
.ams-cbp-cal-day {
    padding: 14px;
    border: 1px solid #dbe2eb;
    border-radius: 12px;
}
.ams-cbp-cal-day h4 {
    margin: 0 0 12px;
    font-size: 14px;
}
.ams-cbp-cal-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ams-cbp-cal-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 11px;
    border: 1px solid #ccd5e3;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
}
.ams-cbp-cal-option:has(input:checked) {
    border-color: #2457e7;
    background: #eef3ff;
}
.ams-cbp-cal-option input {
    accent-color: #2457e7;
}


/* AMS CONSULTATION CALENDAR V2 */

[data-ams-cbp-calendar] .ams-cbp-cal-days {
    display: block;
    margin-top: 16px;
}

.ams-cbp-consult-calendar {
    border: 1px solid #d5e3f4;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.ams-cbp-consult-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ams-cbp-consult-month {
    color: #0b2b52;
    text-transform: capitalize;
    font-size: 15px;
}

.ams-cbp-consult-nav {
    width: 36px;
    height: 36px;
    border: 0 !important;
    border-radius: 8px;
    background: #eff5fe !important;
    color: #1456ac !important;
    box-shadow: none !important;
    font-size: 22px;
    cursor: pointer;
}

.ams-cbp-consult-nav:disabled {
    opacity: .35;
    cursor: default;
}

.ams-cbp-consult-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}

.ams-cbp-consult-weekday,
.ams-cbp-consult-blank,
.ams-cbp-consult-unavailable,
.ams-cbp-consult-day {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 40px;
    box-sizing: border-box;
    border-radius: 8px;
    font-size: 13px;
}

.ams-cbp-consult-weekday {
    font-size: 12px;
    font-weight: 700;
    color: #536782;
}

.ams-cbp-consult-unavailable {
    background: #f0f2f6;
    color: #9ca6b5;
    text-decoration: line-through;
    cursor: not-allowed;
}

.ams-cbp-consult-day {
    background: #e8f1ff !important;
    color: #1056b3 !important;
    border: 1px solid #a6c8f8 !important;
    box-shadow: none !important;
    font-weight: 700;
    cursor: pointer;
}

.ams-cbp-consult-day:hover,
.ams-cbp-consult-day.is-selected {
    background: #1769d9 !important;
    color: #fff !important;
    border-color: #1769d9 !important;
}

.ams-cbp-consult-day:focus-visible,
.ams-cbp-consult-nav:focus-visible {
    outline: 2px solid #1769d9;
    outline-offset: 2px;
}

.ams-cbp-consult-legend,
.ams-cbp-consult-hint {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #546a84;
}

.ams-cbp-consult-times {
    margin-top: 14px;
}

.ams-cbp-consult-times .ams-cbp-cal-day[hidden] {
    display: none !important;
}

.ams-cbp-consult-times .ams-cbp-cal-day {
    margin: 0;
    padding: 14px;
}

.ams-cbp-consult-times .ams-cbp-cal-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

@media (max-width: 520px) {
    .ams-cbp-consult-calendar {
        padding: 9px;
    }

    .ams-cbp-consult-grid {
        gap: 3px;
    }

    .ams-cbp-consult-weekday,
    .ams-cbp-consult-unavailable,
    .ams-cbp-consult-day {
        min-height: 34px;
    }
}
