/* =========================================================
   "Créer une annonce" wizard (#jevendre-status) — also used by "Créer un service" (#je-service-create)
   "Modifier le service" (#je-service-edit-modal, profil.blade.php) and "Publier une pièce" (#je-accessory-create)
   Used by automoto/feed.blade.php, automoto/profil.blade.php, automoto/servicelist.blade.php
   and automoto/accessories/index.blade.php
   (loaded after tailwind.css, Select2 and TomSelect CSS).
   Fixed head + stepper + footer, only .amp-wz-body scrolls.
========================================================= */

/* tokens scoped to the modal: profil.blade.php does not load feed.css */
:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) {
    --amp-navy: #011e40;
    --amp-orange: #ee5721;
    --amp-orange-dark: #d9481a;
    --amp-text: #102a4c;
    --amp-muted: #64748b;
    --amp-faint: #94a3b8;
    --amp-line: #e3e9f1;
    --amp-line-soft: #eef2f7;
    --amp-field: #f6f8fb;
}

/* JS toggles `hidden` inside the modal (spinner, profil's Ville field in edit mode):
   it must win over the display values set below */
:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .amp-wz .hidden {
    display: none !important;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit).amp-wz-modal {
    padding: 24px;
}

.uk-modal-dialog.amp-wz {
    width: 940px;
    max-width: 100%;
    max-height: min(88vh, 920px);
    margin: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(1, 30, 64, .18), 0 2px 8px rgba(1, 30, 64, .06);
    color: var(--amp-navy);
}

/* ---- header ---- */

.amp-wz-head {
    flex: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 16px 28px;
    border-bottom: 1px solid var(--amp-line-soft);
}

.amp-wz-title {
    margin: 0;
    color: var(--amp-navy);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.amp-wz-subtitle {
    margin: 4px 0 0;
    color: var(--amp-muted);
    font-size: 13.5px;
    line-height: 1.4;
}

.amp-wz-close {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: -4px 0 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--amp-muted);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.amp-wz-close svg {
    width: 22px;
    height: 22px;
}

.amp-wz-close:hover {
    background: var(--amp-field);
    color: var(--amp-navy);
}

.amp-wz-close:focus-visible {
    outline: 2px solid var(--amp-orange);
    outline-offset: 2px;
}

/* ---- stepper ---- */

.amp-wz-steps {
    flex: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 14px 28px;
    list-style: none;
    border-bottom: 1px solid var(--amp-line-soft);
    background: #fbfcfe;
}

.amp-wz-step {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.amp-wz-step:last-child {
    flex: 0 0 auto;
}

/* connector line between steps */
.amp-wz-step:not(:last-child)::after {
    content: "";
    flex: 1 1 auto;
    height: 2px;
    margin: 0 14px;
    border-radius: 2px;
    background: var(--amp-line);
    transition: background-color .25s ease;
}

.amp-wz-step.is-done:not(:last-child)::after {
    background: var(--amp-orange);
}

.amp-wz-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--amp-faint);
    font: inherit;
    cursor: default;
}

.amp-wz-step.is-done .amp-wz-step-btn {
    cursor: pointer;
}

.amp-wz-step-dot {
    flex: none;
    position: relative;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid #d3dbe6;
    border-radius: 999px;
    background: #fff;
    color: var(--amp-faint);
    font-size: 13px;
    font-weight: 700;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.amp-wz-step-check {
    display: none;
    width: 16px;
    height: 16px;
}

.amp-wz-step-label {
    overflow: hidden;
    color: var(--amp-muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.amp-wz-step.is-active .amp-wz-step-dot {
    border-color: var(--amp-navy);
    background: var(--amp-navy);
    color: #fff;
}

.amp-wz-step.is-active .amp-wz-step-label {
    color: var(--amp-navy);
}

.amp-wz-step.is-done .amp-wz-step-dot {
    border-color: var(--amp-orange);
    background: #fff3ed;
    color: var(--amp-orange);
}

.amp-wz-step.is-done .amp-wz-step-num {
    display: none;
}

.amp-wz-step.is-done .amp-wz-step-check {
    display: block;
}

.amp-wz-step.is-done .amp-wz-step-label {
    color: var(--amp-text);
}

.amp-wz-step.is-done .amp-wz-step-btn:hover .amp-wz-step-label {
    color: var(--amp-orange);
}

.amp-wz-step-btn:focus-visible {
    outline: 2px solid var(--amp-orange);
    outline-offset: 4px;
    border-radius: 8px;
}

/* ---- form / scroll area ---- */

.amp-wz-form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.amp-wz-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px 28px 28px;
    scrollbar-width: thin;
    scrollbar-color: #cfd8e3 transparent;
}

.amp-wz-body::-webkit-scrollbar {
    width: 8px;
}

.amp-wz-body::-webkit-scrollbar-thumb {
    border: 2px solid #fff;
    border-radius: 999px;
    background: #cfd8e3;
}

.amp-wz-section + .amp-wz-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--amp-line-soft);
}

.amp-wz-section-title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 16px;
    color: var(--amp-navy);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.amp-wz-count {
    margin-left: auto;
    color: var(--amp-muted);
    font-size: 12.5px;
    font-weight: 600;
}

.amp-wz-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
}

.amp-wz-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.amp-wz-field.is-wide {
    grid-column: 1 / -1;
}

.amp-wz-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: #1e2f47;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.amp-wz .amp-req,
.amp-wz-label .text-red-500 {
    color: #e11d48;
    font-weight: 700;
}

.amp-wz-optional {
    margin-left: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--amp-line-soft);
    color: var(--amp-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
}

.amp-wz-help {
    margin: -2px 0 0;
    color: var(--amp-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

/* ---- inputs (native, TomSelect, Select2) ---- */

.amp-wz .amp-wz-input,
.amp-wz .ts-wrapper {
    display: block;
    width: 100% !important;
    max-width: none;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background-color: var(--amp-field);
    color: var(--amp-navy);
    font-size: 15px;
    font-weight: 500;
    line-height: 46px;
    box-shadow: none;
    outline: 0;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.amp-wz .amp-wz-input::placeholder {
    color: var(--amp-faint);
    font-weight: 400;
    opacity: 1;
}

.amp-wz .amp-wz-input:hover,
.amp-wz .ts-wrapper:hover {
    border-color: #cbd5e1;
}

.amp-wz .amp-wz-input:focus,
.amp-wz .ts-wrapper.focus {
    border-color: var(--amp-orange);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(238, 87, 33, .12);
}

.amp-wz select.amp-wz-input,
.amp-wz .ts-wrapper.single {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-size: 16px 16px;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
    cursor: pointer;
}

.amp-wz .amp-wz-textarea {
    height: auto;
    min-height: 120px;
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.amp-wz input[type="date"].amp-wz-input {
    line-height: normal;
}

.amp-wz input[type="number"].amp-wz-input {
    -moz-appearance: textfield;
}

.amp-wz input[type="number"].amp-wz-input::-webkit-inner-spin-button,
.amp-wz input[type="number"].amp-wz-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amp-wz-affix {
    position: relative;
    display: block;
}

.amp-wz-affix .amp-wz-input {
    padding-right: 48px;
}

.amp-wz-suffix {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--amp-muted);
    font-size: 14px;
    font-weight: 600;
    transform: translateY(-50%);
    pointer-events: none;
}

/* TomSelect (brand / model): the wrapper is the field */
.amp-wz .ts-wrapper {
    display: flex !important;
    align-items: center;
    cursor: pointer;
}

.amp-wz .ts-wrapper .ts-control {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--amp-navy);
    font-size: 15px;
    line-height: 1.2;
    overflow: hidden;
}

.amp-wz .ts-wrapper .ts-control > .item {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.amp-wz .ts-wrapper .ts-control input {
    min-width: 0 !important;
    color: var(--amp-navy);
    font-size: 15px;
}

.amp-wz .ts-dropdown {
    left: -1px;
    right: -1px;
    width: auto;
    margin-top: 6px;
    border: 1px solid var(--amp-line);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(1, 30, 64, .12);
    overflow: hidden;
    z-index: 40;
}

.amp-wz .ts-dropdown .option {
    padding: 10px 14px;
    color: var(--amp-navy);
    font-size: 14.5px;
}

.amp-wz .ts-dropdown .active {
    background: #fff3ed;
    color: var(--amp-navy);
}

/* Select2 (#ville): overrides the global .select2-selection-tailwind look */
.amp-wz .select2-container {
    width: 100% !important;
}

/* the original <select> Select2 hides must stay a 1px clipped box */
.amp-wz .amp-wz-input.select2-hidden-accessible {
    width: 1px !important;
    height: 1px !important;
    min-height: 0;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-selection {
    outline: 0;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-container .select2-selection.select2-selection--single {
    display: flex !important;
    align-items: center;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important; /* a global .select2-selection-tailwind rule pulls it up by 3% */
    padding: 0 40px 0 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: var(--amp-field) !important;
    box-shadow: none !important;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-container .select2-selection.select2-selection--single:hover {
    border-color: #cbd5e1 !important;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-container--focus .select2-selection.select2-selection--single,
:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-container--open .select2-selection.select2-selection--single {
    border-color: var(--amp-orange) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(238, 87, 33, .12) !important;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    color: var(--amp-navy);
    font-size: 15px;
    font-weight: 500;
    line-height: 46px;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-selection--single .select2-selection__placeholder {
    color: var(--amp-faint);
    font-weight: 400;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    right: 12px !important;
    height: 20px !important;
    transform: translateY(-50%);
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--amp-line) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 28px rgba(1, 30, 64, .12);
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-search__field {
    height: 40px;
    padding: 0 10px;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    outline: 0;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-search__field:focus {
    border-color: var(--amp-orange) !important;
    box-shadow: 0 0 0 3px rgba(238, 87, 33, .12) !important;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-results__option {
    padding: 9px 14px;
    font-size: 14.5px;
}

:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .select2-results__option--highlighted {
    background: #fff3ed !important;
    color: var(--amp-navy) !important;
}

/* ---- errors ---- */

.amp-wz-field.is-invalid .amp-wz-input,
.amp-wz-field.is-invalid .ts-wrapper,
:is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit) .amp-wz-field.is-invalid .select2-selection.select2-selection--single {
    border-color: #e11d48 !important;
    background-color: #fff7f8 !important;
}

.amp-wz-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -2px 0 0;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
}

.amp-wz-error::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M10 1.5a8.5 8.5 0 110 17 8.5 8.5 0 010-17zm0 11.75a1 1 0 100 2 1 1 0 000-2zm0-8a1 1 0 00-1 1v5a1 1 0 002 0v-5a1 1 0 00-1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23000' d='M10 1.5a8.5 8.5 0 110 17 8.5 8.5 0 010-17zm0 11.75a1 1 0 100 2 1 1 0 000-2zm0-8a1 1 0 00-1 1v5a1 1 0 002 0v-5a1 1 0 00-1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.amp-wz-section.is-invalid > .amp-wz-error {
    margin-top: 10px;
}

.amp-wz-alert {
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.5;
}

/* ---- photo upload ---- */

.amp-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    transition: border-color .15s ease, background-color .15s ease;
}

.amp-upload:hover,
.amp-upload.is-dragover {
    border-color: var(--amp-orange);
    background: #fff8f4;
}

.amp-upload:focus-within {
    border-color: var(--amp-orange);
    box-shadow: 0 0 0 3px rgba(238, 87, 33, .12);
}

.is-invalid > .amp-upload {
    border-color: #e11d48;
    background: #fff7f8;
}

/* real input: hidden visually, still focusable and part of the form */
.amp-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.amp-upload-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--amp-line);
    border-radius: 12px;
    background: #fff;
    color: var(--amp-navy);
}

.amp-upload-icon svg {
    width: 24px;
    height: 24px;
}

.amp-upload-text {
    flex: 1 1 auto;
    min-width: 0;
}

.amp-upload-title {
    margin: 0;
    color: var(--amp-navy);
    font-size: 15px;
    font-weight: 700;
}

.amp-upload-sub {
    margin: 3px 0 0;
    color: var(--amp-muted);
    font-size: 13px;
    line-height: 1.45;
}

.amp-upload-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 18px;
    border: 1px solid var(--amp-navy);
    border-radius: 10px;
    background: #fff;
    color: var(--amp-navy);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.amp-upload-btn:hover {
    background: var(--amp-navy);
    color: #fff;
}

.amp-upload.is-full {
    opacity: .6;
}

.amp-upload.is-full .amp-upload-btn {
    pointer-events: none;
}

.amp-upload-previews {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.amp-upload-previews:not(:empty) {
    margin-top: 14px;
}

.amp-upload-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--amp-line);
    border-radius: 10px;
    background: var(--amp-field);
}

.amp-upload-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amp-upload-main {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(1, 30, 64, .82);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
}

/* .amp-upload-thumb prefix: tailwind's [type=button] reset loads after feed.css at equal specificity */
.amp-upload-thumb .amp-upload-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .95);
    color: var(--amp-navy);
    box-shadow: 0 1px 4px rgba(1, 30, 64, .2);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.amp-upload-remove svg {
    width: 14px;
    height: 14px;
}

.amp-upload-thumb .amp-upload-remove:hover {
    background: #e11d48;
    color: #fff;
}

/* ---- price step ---- */

.amp-wz-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--amp-field);
    color: var(--amp-muted);
    font-size: 13px;
    line-height: 1.45;
}

.amp-wz-note svg {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--amp-navy);
}

/* ---- footer ---- */

.amp-wz-foot {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-top: 1px solid var(--amp-line-soft);
    background: #fff;
}

.amp-wz-foot-left,
.amp-wz-foot-right {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
}

.amp-wz-foot-right {
    justify-content: flex-end;
}

.amp-wz-progress {
    flex: none;
    color: var(--amp-muted);
    font-size: 13px;
}

.amp-wz-progress strong {
    color: var(--amp-navy);
}

.amp-wz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.amp-wz-btn svg {
    width: 18px;
    height: 18px;
}

.amp-wz-btn:focus-visible {
    outline: 2px solid var(--amp-orange);
    outline-offset: 2px;
}

.amp-wz-btn.is-ghost {
    padding: 0 14px;
    background: transparent;
    color: var(--amp-muted);
}

.amp-wz-btn.is-ghost:hover {
    background: var(--amp-field);
    color: var(--amp-navy);
}

.amp-wz-btn.is-secondary {
    border-color: #e2e8f0;
    background: #fff;
    color: var(--amp-navy);
}

.amp-wz-btn.is-secondary:hover {
    border-color: #cbd5e1;
    background: var(--amp-field);
}

.amp-wz-btn.is-primary {
    min-width: 140px;
    background: var(--amp-navy);
    color: #fff;
}

.amp-wz-btn.is-primary:hover {
    background: #062b57;
}

.amp-wz-btn.is-publish {
    min-width: 190px;
    background: var(--amp-orange);
    color: #fff;
    box-shadow: 0 2px 8px rgba(238, 87, 33, .25);
}

.amp-wz-btn.is-publish:hover {
    background: var(--amp-orange-dark);
}

.amp-wz-btn.is-publish:disabled {
    opacity: .75;
    cursor: progress;
}

/* ---- smaller screens: one column, same fixed head / footer ---- */

@media (max-width: 767px) {
    :is(#jevendre-status, #je-service-create, #je-service-edit-modal, #je-accessory-create, #je-accessory-edit).amp-wz-modal {
        padding: 10px;
    }

    .uk-modal-dialog.amp-wz {
        max-height: 94vh;
        border-radius: 16px;
    }

    .amp-wz-head {
        padding: 16px 12px 12px 18px;
    }

    .amp-wz-title {
        font-size: 18px;
    }

    .amp-wz-steps {
        padding: 12px 18px;
    }

    .amp-wz-step:not(:last-child)::after {
        margin: 0 8px;
    }

    .amp-wz-step-dot {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .amp-wz-step-label {
        font-size: 12.5px;
    }

    /* only the current step keeps its label */
    .amp-wz-step:not(.is-active) .amp-wz-step-label {
        display: none;
    }

    .amp-wz-body {
        padding: 18px 18px 22px;
    }

    .amp-wz-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .amp-upload {
        flex-wrap: wrap;
        padding: 16px;
    }

    .amp-upload-btn {
        width: 100%;
        justify-content: center;
    }

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

    .amp-wz-foot {
        padding: 12px 18px;
    }

    .amp-wz-progress {
        display: none;
    }

    .amp-wz-btn.is-primary,
    .amp-wz-btn.is-publish {
        min-width: 0;
        padding: 0 18px;
    }
}

/* ---- "✨ Me proposer un titre et une description" (partials/ai-writer-button.blade.php, ai-writer.js) ---- */

.amp-wz .amp-ai-writer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: -6px 0 -4px;
}

.amp-wz .amp-ai-writer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #f6c3ae;
    border-radius: 999px;
    background: #fff4ef;
    color: var(--amp-orange-dark);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.amp-wz .amp-ai-writer-btn:hover:not(:disabled) {
    border-color: var(--amp-orange);
    background: #ffe9df;
}

.amp-wz .amp-ai-writer-btn:focus-visible {
    outline: 3px solid rgba(238, 87, 33, .35);
    outline-offset: 2px;
}

.amp-wz .amp-ai-writer-btn:disabled {
    cursor: progress;
    opacity: .75;
}

.amp-wz .amp-ai-writer-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: amp-ai-spin .7s linear infinite;
}

.amp-wz .amp-ai-writer-status {
    margin: 0;
    color: var(--amp-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

.amp-wz .amp-ai-writer-status.is-error {
    color: #be123c;
}

.amp-wz .amp-ai-writer-status:empty {
    display: none;
}

@keyframes amp-ai-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .amp-wz .amp-ai-writer-btn {
        width: 100%;
    }
}

/* ---- Emplacement précis (partials/car-precise-location.blade.php, assets/js/car-precise-location.js) ---- */

.amp-wz .amp-precise {
    margin-top: 18px;
}

.amp-precise-notice {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed var(--amp-line);
    border-radius: 12px;
    background: var(--amp-field);
    color: var(--amp-muted);
    font-size: 13px;
    line-height: 1.4;
}

.amp-precise-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amp-precise-notice[hidden],
.amp-precise-body[hidden],
.amp-precise-selected[hidden],
.amp-precise-suggestions[hidden],
.amp-precise-error[hidden],
.amp-precise-warning[hidden] {
    display: none;
}

.amp-precise-search {
    position: relative;
}

.amp-precise-search > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--amp-faint);
    transform: translateY(-50%);
    pointer-events: none;
}

.amp-wz .amp-precise-search .amp-wz-input {
    padding-left: 42px;
}

.amp-precise-suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: 220px; /* stays in the visible part of the modal; its own scroll */
    margin: 0;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    border: 1px solid var(--amp-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(1, 30, 64, .16);
}

.amp-precise-suggestions li {
    padding: 9px 10px;
    overflow-wrap: anywhere;
    border-radius: 8px;
    line-height: 1.3;
    cursor: pointer;
}

.amp-precise-suggestions li strong {
    display: block;
    color: var(--amp-navy);
    font-size: 14px;
    font-weight: 600;
}

.amp-precise-suggestions li span {
    display: block;
    margin-top: 2px;
    color: var(--amp-muted);
    font-size: 12.5px;
}

.amp-precise-suggestions li:hover,
.amp-precise-suggestions li[aria-selected="true"] {
    background: var(--amp-line-soft);
}

.amp-precise-suggestions li.is-empty {
    color: var(--amp-muted);
    font-size: 13px;
    cursor: default;
}

.amp-precise-map {
    width: 100%;
    height: 240px;
    overflow: hidden;
    border: 1px solid var(--amp-line);
    border-radius: 14px;
    background: var(--amp-field);
}

.amp-precise-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 10px 12px;
    border: 1px solid #fbd5c5;
    border-radius: 12px;
    background: #fff6f1;
    color: var(--amp-navy);
    font-size: 13.5px;
}

.amp-precise-selected svg {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--amp-orange);
}

.amp-precise-selected [data-precise-selected-text] {
    flex: 1 1 180px;
    min-width: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.amp-precise-remove {
    padding: 4px 0;
    border: 0;
    background: none;
    color: #e11d48;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.amp-precise-error {
    margin: 0;
    color: #e11d48;
    font-size: 12.5px;
}

@media (max-width: 640px) {
    .amp-precise-map {
        height: 210px;
    }
}

/* opt-in: "Ajouter un emplacement précis" (Google is loaded only from here) / "Ne pas ajouter…" */
.amp-precise-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px dashed #f3b79e;
    border-radius: 12px;
    background: #fff8f4;
    color: var(--amp-orange);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.amp-precise-open:hover,
.amp-precise-open:focus-visible {
    border-color: var(--amp-orange);
    background: #fff1e9;
}

.amp-precise-open svg {
    width: 18px;
    height: 18px;
}

.amp-precise-open[hidden] {
    display: none;
}

.amp-precise-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    color: var(--amp-faint);
    font-size: 12px;
}

.amp-precise-close {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--amp-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.amp-precise-close:hover {
    color: var(--amp-navy);
}

.amp-precise-close[hidden] {
    display: none;
}

/* informational: the chosen address seems to be in another city than the listing (nothing is blocked) */
.amp-precise-warning {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #f5d38a;
    border-radius: 12px;
    background: #fffaeb;
    color: #7a4b00;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
