/* ============================================================
   Configurateur USA standalone v4
   Styles spécifiques USA — le layout + wizard viennent de
   configurateur-wizard.css et configurateur-mesplaques.css
   ============================================================ */

/* ── STEPS : forcer 3 colonnes ─────────────────────────────── */
#wizardSteps.wizard-steps-usa {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ── PLAQUE HOST : ratio 300/150 ───────────────────────────── */
.usa-plate-host {
    width: min(100%, 360px);
    max-width: 360px;
    margin: 0 auto;
    aspect-ratio: 300 / 150;
    position: relative;
}

.usa-plate {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 0 0 2px rgba(255,255,255,.06);
    background: #1e293b;
    container-type: inline-size;
}

/* Image de fond */
.usa-plate__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    z-index: 1;
    opacity: 0;
    transition: opacity .35s ease;
}
.usa-plate__bg.loaded { opacity: 1; }

/* Placeholder hachures pendant le chargement */
.usa-plate__placeholder {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.4;
    color: rgba(255,255,255,.65);
    background: repeating-linear-gradient(
        -45deg,
        #1e293b, #1e293b 8px,
        #162032 8px, #162032 16px
    );
    transition: opacity .25s;
}
.usa-plate__placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Numéro centré sur la plaque */
.usa-plate__text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Archivo Black', Impact, 'Arial Black', sans-serif;
    font-size: 8cqw;
    font-weight: 900;
    letter-spacing: 0.07em;
    color: #111;
    text-shadow: 0 0 4px rgba(255,255,255,.5), 0 2px 10px rgba(0,0,0,.45);
    white-space: nowrap;
    z-index: 3;
    pointer-events: none;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Message optionnel sous le numéro */
.usa-plate__msg {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    font-size: 2.2cqw;
    letter-spacing: 0.05em;
    z-index: 3;
    pointer-events: none;
    color: #111;
    text-shadow: 0 0 3px rgba(255,255,255,.8);
    white-space: nowrap;
    text-align: center;
}

/* ── NOTICE ÉTAT ────────────────────────────────────────────── */
.usa-notice {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 3px solid #1B4FD8;
    color: #1e40af;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.usa-notice:empty { display: none; }

/* ── SELECT ÉTAT ────────────────────────────────────────────── */
.usa-state-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem !important;
    font-weight: 600;
}

/* ── CHAMP IMMAT en majuscules centrées ─────────────────────── */
.usa-immat-input {
    text-align: center !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    font-size: 1.1rem !important;
    text-transform: uppercase !important;
}

/* ── Badge optionnel ────────────────────────────────────────── */
.wizard-field-optional {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 0.4rem;
}

/* ── SWATCHES COULEUR ───────────────────────────────────────── */
.usa-color-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

.usa-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform .12s, border-color .12s, box-shadow .12s;
    flex-shrink: 0;
}
.usa-color-swatch:hover { transform: scale(1.12); }
.usa-color-swatch.active {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px #0f172a;
}

/* Bouton "Aucun contour" */
.usa-swatch-none {
    background: #f1f5f9 !important;
    border: 1.5px solid #d1d5db !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1;
}
.usa-swatch-none.active {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px #0f172a;
}

/* ── SLIDER TAILLE ──────────────────────────────────────────── */
.usa-range {
    width: 100%;
    accent-color: #0f172a;
    cursor: pointer;
    margin-top: 0.3rem;
}

/* ── RÉCAP (step 3) ─────────────────────────────────────────── */
#usaRecap {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-top: 0.5rem;
}

.usa-recap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}
.usa-recap-row .label { color: #64748b; }
.usa-recap-row .value { font-weight: 600; color: #1e293b; }

.usa-recap-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 700;
}

/* ── RULER ──────────────────────────────────────────────────── */
.stage-ruler {
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255,255,255,.4);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* ── TOGGLE RIVETS (style toggle switch) ───────────────────── */
.wizard-checkbox-field { margin-bottom: 0.5rem; }
.wizard-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
}
.wizard-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
    cursor: pointer;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .configurator-mp-preview .usa-plate-host {
        width: min(100%, 280px);
        max-width: 280px;
    }
    .configurator-mp-preview .preview-meta-grid,
    .configurator-mp-preview .preview-intro {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .configurator-mp-preview .usa-plate-host {
        width: min(100%, 230px);
    }
    #wizardSteps.wizard-steps-usa .wizard-step-label {
        font-size: 0.6rem;
    }
}
