/* =========================================================
   CONFIGURATEUR DE DEVIS
   Compatible avec quote-form.php actuel
   ========================================================= */

   :root{
    --q-bg:#f6f8fb;
    --q-surface:#ffffff;
    --q-surface-soft:#f9fbfd;
    --q-border:#dbe3ec;
    --q-border-strong:#c8d3df;
    --q-text:#122033;
    --q-text-soft:#5e6c7d;
    --q-text-muted:#7e8b9b;
    --q-title:#0e1b2b;
    --q-accent:#123d74;
    --q-accent-soft:#ebf3fb;
    --q-success:#0f766e;
    --q-shadow-sm:0 8px 24px rgba(15,23,42,.05);
    --q-shadow-md:0 18px 44px rgba(15,23,42,.08);
    --q-radius-sm:12px;
    --q-radius-md:18px;
    --q-radius-lg:24px;
  }
  
  /* ---------------------------------------------------------
     Structure globale
     --------------------------------------------------------- */
  
  .configurator{
    max-width:1160px;
    margin:0 auto;
    padding:42px 0 72px;
  }
  
  .configurator__header{
    max-width:840px;
    margin:0 auto 34px;
    text-align:center;
  }
  
  .section-label{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 14px;
    margin-bottom:16px;
    border-radius:999px;
    background:var(--q-accent-soft);
    color:var(--q-accent);
    font-size:.76rem;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
  }
  
  .section-title{
    margin:0 0 12px;
    color:var(--q-title);
    font-size:clamp(2rem,2.7vw,3rem);
    line-height:1.08;
    font-weight:800;
    letter-spacing:-.03em;
  }
  
  .section-lead{
    margin:0 auto;
    max-width:760px;
    color:var(--q-text-soft);
    font-size:1rem;
    line-height:1.72;
  }
  
  /* ---------------------------------------------------------
     Stepper
     --------------------------------------------------------- */
  
  .stepper{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:14px;
    align-items:start;
    margin:0 auto 30px;
    padding:18px 20px;
    border:1px solid var(--q-border);
    border-radius:22px;
    background:linear-gradient(180deg,#fff 0%,#f9fbfe 100%);
    box-shadow:var(--q-shadow-sm);
  }
  
  .stepper__item{
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
  }
  
  .stepper__circle{
    width:42px;
    height:42px;
    margin-bottom:10px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--q-border-strong);
    background:#fff;
    color:var(--q-text-soft);
    font-size:.95rem;
    font-weight:800;
    transition:all .18s ease;
  }
  
  .stepper__label{
    color:var(--q-text-muted);
    font-size:.82rem;
    line-height:1.25;
    font-weight:700;
  }
  
  .stepper__item.is-active .stepper__circle{
    background:var(--q-accent);
    border-color:var(--q-accent);
    color:#fff;
    box-shadow:0 10px 22px rgba(18,61,116,.22);
  }
  
  .stepper__item.is-active .stepper__label{
    color:var(--q-title);
  }
  
  .stepper__item.is-done .stepper__circle{
    background:var(--q-success);
    border-color:var(--q-success);
    color:#fff;
  }
  
  .stepper__item.is-done .stepper__label{
    color:var(--q-text);
  }
  
  .stepper__line{
    display:none;
  }
  
  /* ---------------------------------------------------------
     Étapes
     --------------------------------------------------------- */
  
  .step-panel{
    display:none;
    padding:34px 34px 28px;
    border:1px solid var(--q-border);
    border-radius:26px;
    background:linear-gradient(180deg,rgba(255,255,255,.98) 0%,rgba(248,250,252,.98) 100%);
    box-shadow:var(--q-shadow-md);
    animation:qFade .2s ease;
  }
  
  .step-panel.is-active{
    display:block;
  }
  
  @keyframes qFade{
    from{opacity:0;transform:translateY(8px);}
    to{opacity:1;transform:translateY(0);}
  }
  
  .step-panel__title{
    margin:0 0 8px;
    color:var(--q-title);
    font-size:clamp(1.5rem,2vw,2rem);
    line-height:1.15;
    font-weight:800;
    letter-spacing:-.02em;
  }
  
  .step-panel__subtitle{
    margin:0 0 28px;
    color:var(--q-text-soft);
    font-size:.98rem;
    line-height:1.65;
    max-width:780px;
  }
  
  /* ---------------------------------------------------------
     Formulaires
     --------------------------------------------------------- */
  
  .form-group{
    margin-bottom:26px;
  }
  
  .form-group--inline{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:22px;
  }
  
  .form-label{
    display:block;
    margin-bottom:9px;
    color:var(--q-text);
    font-size:.88rem;
    font-weight:700;
    letter-spacing:.01em;
  }
  
  .form-label--required::after{
    content:" *";
    color:#b42318;
  }
  
  .form-control{
    display:block;
    width:100%;
    min-height:50px;
    padding:13px 15px;
    border:1px solid var(--q-border-strong);
    border-radius:14px;
    background:#fff;
    color:var(--q-text);
    font-size:.96rem;
    line-height:1.45;
    transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
  }
  
  .form-control::placeholder{
    color:#93a0b1;
  }
  
  .form-control:hover{
    border-color:#b9c5d3;
  }
  
  .form-control:focus{
    outline:none;
    border-color:var(--q-accent);
    box-shadow:0 0 0 4px rgba(18,61,116,.10);
  }
  
  textarea.form-control{
    min-height:120px;
    resize:vertical;
  }
  
  .form-check{
    display:inline-flex;
    align-items:flex-start;
    gap:10px;
    cursor:pointer;
  }
  
  .form-check input[type="radio"],
  .form-check input[type="checkbox"]{
    accent-color:var(--q-accent);
    transform:translateY(2px);
  }
  
  .form-check__label{
    color:var(--q-text-soft);
    font-size:.95rem;
    line-height:1.55;
  }
  
  /* ---------------------------------------------------------
     Cartes d’options
     --------------------------------------------------------- */
  
  .option-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
  }
  
  .option-card{
    display:block;
    cursor:pointer;
  }
  
  .option-card input{
    position:absolute;
    opacity:0;
    pointer-events:none;
  }
  
  .option-card__label{
    display:flex;
    align-items:center;
    gap:14px;
    min-height:74px;
    padding:16px 18px;
    border:1px solid var(--q-border);
    border-radius:18px;
    background:#fff;
    box-shadow:0 4px 14px rgba(15,23,42,.03);
    transition:border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
  }
  
  .option-card:hover .option-card__label{
    transform:translateY(-1px);
    border-color:#c7d6e7;
    box-shadow:0 12px 26px rgba(15,23,42,.06);
  }
  
  .option-card input:checked + .option-card__label{
    border-color:rgba(18,61,116,.55);
    background:linear-gradient(180deg,#fff 0%,#f2f7fd 100%);
    box-shadow:0 12px 28px rgba(18,61,116,.10);
  }
  
  .option-card__icon{
    flex:0 0 42px;
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f3f6fa;
    font-size:1.15rem;
  }
  
  .option-card__text{
    color:var(--q-text);
    font-size:.95rem;
    line-height:1.35;
    font-weight:700;
  }
  
  /* ---------------------------------------------------------
     Produits
     --------------------------------------------------------- */
  
  .product-select-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
  }
  
  .product-select-card{
    position:relative;
    display:flex;
    flex-direction:column;
    min-height:100%;
    border:1px solid var(--q-border);
    border-radius:22px;
    background:#fff;
    overflow:hidden;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(15,23,42,.04);
    transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  }
  
  .product-select-card:hover{
    transform:translateY(-2px);
    border-color:#c7d6e7;
    box-shadow:0 18px 34px rgba(15,23,42,.08);
  }
  
  .product-select-card.is-selected{
    border-color:rgba(18,61,116,.55);
    background:linear-gradient(180deg,#fff 0%,#f6faff 100%);
    box-shadow:0 20px 36px rgba(18,61,116,.11);
  }
  
  .product-select-card__check{
    position:absolute;
    top:14px;
    right:14px;
    width:30px;
    height:30px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--q-success);
    color:#fff;
    font-size:.9rem;
    font-weight:900;
    opacity:0;
    transform:scale(.8);
    transition:all .18s ease;
  }
  
  .product-select-card.is-selected .product-select-card__check{
    opacity:1;
    transform:scale(1);
  }
  
  .product-select-card__image{
    min-height:220px;
    padding:18px 18px 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(180deg,#fbfcfe 0%,#f2f6fa 100%);
    border-bottom:1px solid #eef2f7;
  }
  
  .product-select-card__image img{
    max-width:100%;
    max-height:180px;
    width:auto;
    height:auto;
    object-fit:contain;
    display:block;
  }
  
  .product-select-card__body{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:18px;
    flex:1;
  }
  
  .product-select-card__name{
    color:var(--q-title);
    font-size:1.02rem;
    line-height:1.35;
    font-weight:800;
    letter-spacing:-.01em;
  }
  
  .product-select-card__price{
    color:var(--q-text-soft);
    font-size:.92rem;
    line-height:1.4;
  }
  
  .product-select-card__price strong{
    color:var(--q-title);
    font-size:1.02rem;
    font-weight:800;
  }
  
  .badge{
    display:inline-flex;
    align-items:center;
    align-self:flex-start;
    padding:6px 10px;
    border-radius:999px;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  
  .badge--new{
    background:#eef4ff;
    color:#264b8d;
  }
  
  .badge--mdm{
    background:#ecfdf3;
    color:#0f766e;
  }
  
  /* ---------------------------------------------------------
     Quantités
     --------------------------------------------------------- */
  
  .qty-selector{
    margin-top:auto;
    display:inline-flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
    padding-top:6px;
  }
  
  .qty-btn{
    width:34px;
    height:34px;
    border:1px solid var(--q-border-strong);
    border-radius:10px;
    background:#fff;
    color:var(--q-title);
    font-size:1rem;
    font-weight:800;
    cursor:pointer;
    transition:border-color .18s ease, background .18s ease;
  }
  
  .qty-btn:hover{
    border-color:var(--q-accent);
    background:var(--q-accent-soft);
  }
  
  .qty-value{
    min-width:22px;
    text-align:center;
    color:var(--q-title);
    font-size:.98rem;
    font-weight:800;
  }
  
  /* ---------------------------------------------------------
     Etat vide
     --------------------------------------------------------- */
  
  .empty-state{
    padding:34px 24px;
    text-align:center;
    border:1px dashed var(--q-border-strong);
    border-radius:22px;
    background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%);
  }
  
  .empty-state__icon{
    font-size:2rem;
    margin-bottom:10px;
  }
  
  .empty-state__title{
    color:var(--q-title);
    font-size:1.05rem;
    font-weight:800;
    margin-bottom:8px;
  }
  
  /* ---------------------------------------------------------
     Récapitulatif
     --------------------------------------------------------- */
  
  .quote-summary{
    padding:22px 22px 18px;
    border:1px solid var(--q-border);
    border-radius:22px;
    background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
    box-shadow:0 10px 26px rgba(15,23,42,.05);
  }
  
  .quote-summary__title{
    margin-bottom:16px;
    color:var(--q-title);
    font-size:1rem;
    font-weight:800;
  }
  
  .quote-summary__list{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  
  .quote-summary__item{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    padding:11px 0;
    border-bottom:1px solid #edf2f7;
    color:var(--q-text);
    font-size:.95rem;
    line-height:1.45;
  }
  
  .quote-summary__item:last-child{
    border-bottom:0;
  }
  
  .quote-summary__item span:last-child{
    color:var(--q-title);
    font-weight:700;
    white-space:nowrap;
  }
  
  .quote-summary__total{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-top:14px;
    padding-top:16px;
    border-top:1px solid var(--q-border);
    color:var(--q-title);
    font-size:1rem;
    font-weight:800;
  }
  
  /* ---------------------------------------------------------
     Navigation des étapes
     --------------------------------------------------------- */
  
  .step-nav{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:30px;
    padding-top:20px;
    border-top:1px solid #edf2f7;
  }
  
  .step-nav .btn,
  .step-nav button{
    min-height:50px;
    border-radius:14px;
    font-weight:800;
  }
  
  /* ---------------------------------------------------------
     Alerte
     --------------------------------------------------------- */
  
  .alert--danger{
    padding:14px 16px;
    border:1px solid #f5c2c7;
    border-radius:16px;
    background:#fef3f2;
    color:#b42318;
    font-size:.92rem;
    line-height:1.5;
  }
  
  /* ---------------------------------------------------------
     Spinner
     --------------------------------------------------------- */
  
  .spinner{
    width:18px;
    height:18px;
    display:inline-block;
    border:2px solid rgba(255,255,255,.35);
    border-top-color:#fff;
    border-radius:999px;
    animation:qSpin .8s linear infinite;
  }
  
  @keyframes qSpin{
    to{transform:rotate(360deg);}
  }
  
  /* ---------------------------------------------------------
     Responsive
     --------------------------------------------------------- */
  
  @media (max-width:1100px){
    .option-grid,
    .product-select-grid{
      grid-template-columns:repeat(2,minmax(0,1fr));
    }
  }
  
  @media (max-width:820px){
    .configurator{
      padding:28px 0 54px;
    }
  
    .stepper{
      grid-template-columns:repeat(5,minmax(54px,1fr));
      gap:10px;
      padding:14px 12px;
    }
  
    .step-panel{
      padding:24px 18px 20px;
      border-radius:22px;
    }
  
    .form-group--inline{
      grid-template-columns:1fr;
      gap:0;
    }
  
    .option-grid,
    .product-select-grid{
      grid-template-columns:1fr;
    }
  
    .product-select-card__image{
      min-height:180px;
    }
  
    .step-nav{
      flex-direction:column;
      align-items:stretch;
    }
  
    .step-nav > *{
      width:100%;
    }
  
    .quote-summary__item,
    .quote-summary__total{
      flex-direction:column;
      align-items:flex-start;
    }
  }
  
  @media (max-width:560px){
    .stepper{
      overflow-x:auto;
    }
  
    .stepper__label{
      display:none;
    }
  
    .stepper__circle{
      margin-bottom:0;
    }
  }