:root{
  --bg:#f4f5f7;
  --white:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#d9dde3;
  --navy:#0f172a;
  --blue:#163a70;
  --blue-light:#1f4f95;
  --danger:#c62828;
  --danger-dark:#a61f1f;
}
*{box-sizing:border-box;}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  margin:0;
  background:var(--bg);
  color:var(--text);
}
.cta{
  padding:12px 18px;
  background:var(--blue);
  color:#fff;
  border:none;
  border-radius:6px;
  cursor:pointer;
  margin:40px;
}
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;

  background:rgba(15,23,42,0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);

  opacity:0;
  pointer-events:none;

  transition: 
    backdrop-filter .25s ease,
    background .25s ease,
    opacity .2s ease;

  z-index:1000;
}

.modal-box{
  transform: translateY(10px) scale(0.98);
  opacity:0;
  transition: all .25s ease;
}

.modal.show .modal-box{
  transform: translateY(0) scale(1);
  opacity:1;
}

.modal.show{
  background:rgba(15,23,42,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  opacity:1;
  pointer-events:auto;
}
.modal.show{display:flex;}
.modal-box{
  width:min(920px,100%);
  max-height:90vh;
  overflow:auto;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:12px;
  padding:28px;
}
.header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:8px;
}
.header h2{
  margin:0;
  font-size:22px;
  color:var(--navy);
}
.close{
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:22px;
  line-height:1;
  cursor:pointer;
}
.subtitle{
  margin:0 0 20px;
  font-size:14px;
  color:var(--muted);
}
form{display:block;}
.section{margin-top:24px;}
.section-title{
  margin:0 0 12px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--blue);
}
.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field.full{grid-column:1 / -1;}
.field label{
  font-size:12px;
  color:var(--muted);
}
input, textarea, select{
  width:100%;
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:var(--text);
  font:inherit;
}
textarea{
  min-height:104px;
  resize:vertical;
}
.choices{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}

.choices label{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:110px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  transition:all .2s ease;
  user-select:none;
}

.choices input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.choices span{
  font-size:14px;
  color:var(--text);
}

/* HOVER */
.choices label:hover{
  border-color:var(--blue);
}

/* ETAT SELECTIONNE (comme ADR) */
.choices input:checked + span{
  color:var(--blue);
  font-weight:600;
}

.choices label:has(input:checked){
  background:#eef4ff;
  border-color:var(--blue);
}

.choices label:active{
  transform:scale(0.98);
}
.checks{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.checks label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  font-size:14px;
}
.hidden{display:none !important;}
.submit{
  width:100%;
  margin-top:30px;
  padding:14px 18px;
  border:none;
  border-radius:6px;
  background:var(--blue);
  color:#fff;
  font:inherit;
  cursor:pointer;
}
.submit:hover{background:var(--blue-light);}

/* Bouton ADR amélioré */
.danger-toggle-wrap{
  justify-content:flex-end;
}
.danger-toggle-label{
  visibility:hidden;
}
.danger-toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  white-space:nowrap;
  font-size:13px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  cursor:pointer;
  transition:all .2s ease;
  user-select:none;
}
.danger-toggle input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.danger-toggle span{
  font-size:14px;
  color:var(--text);
  font-weight:500;
}
.danger-toggle:hover{
  border-color:#bcc4ce;
}
.danger-toggle.is-checked{
  background:#eef4ff;
  border-color:var(--blue);
}
.danger-toggle.is-checked span{
  color:var(--blue);
  font-weight:600;
}
.danger-toggle:hover{
  border-color:var(--blue);
}

.danger-toggle{
  transition:all .15s ease;
}
.danger-toggle:active{
  transform:scale(0.98);
}

.ts-control{
  border:1px solid var(--line);
  border-radius:6px;
  padding:6px;
  min-height:42px;
}

.ts-dropdown{
  border-radius:8px;
  border:1px solid var(--line);
}

.ts-dropdown .option{
  padding:8px;
}

.required-note{
  font-size:12px;
  color:var(--muted);
  margin-bottom:10px;
}
.required-note span{
  color:var(--blue);
  font-weight:600;
}

.required{
  color:var(--blue);
  margin-left:2px;
  font-weight:600;
}

.choices.multiple label:has(input:checked){
  background:#eef4ff;
  border-color:var(--blue);
}

.choices.multiple input:checked + span{
  color:var(--blue);
  font-weight:600;
}

.form-errors{
  display:none;
  background:#fdecea;
  color:#b71c1c;
  padding:12px;
  border-radius:6px;
  margin-bottom:15px;
}

/* =========================
TAILLES DES CHAMPS
========================= */

.field-xs{ max-width:110px; }
.field-sm{ max-width:160px; }
.field-md{ max-width:220px; }
.field-date{ max-width:160px; }

.field-city{
  max-width:140px;
  flex:0 0 140px;
}

/* alignement ligne métier */
.row-inline{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:flex-end;
}

/* mobile */
@media (max-width:760px){
  .field-xs,
  .field-sm,
  .field-md,
  .field-date{
    max-width:100%;
  }
}

.row-inline{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
}

/* Ajustement fin pour tenir sur une ligne */
.field-cp{ max-width:180px; }
.field-country{ min-width:180px; flex:1; }
.field-date{ max-width:140px; }

.field-phone{
  max-width:220px;
}

/* bouton ADR compact */
.danger-toggle{
  padding:10px 12px;
  min-width:auto;
}

/* tailles optimisées transport */
.field-cp{ max-width:140px; }
.field-country{ min-width:220px; flex:1; }
.field-date{ max-width:150px; }

@media (max-width: 760px){
  .modal{padding:12px; align-items:flex-start;}
  .modal-box{width:100%; margin-top:12px; padding:20px;}
  .grid,.grid-3{grid-template-columns:1fr;}
  .choices{flex-direction:column;}
  .choices label{width:100%; min-width:0;}
  .danger-toggle-wrap{
    justify-content:stretch;
  }
  .danger-toggle{
    width:100%;
  }
  .danger-toggle-label{
    display:none;
  }
}