:root{
  --bg:#f6f7fb; --ink:#0e1220; --muted:#667085; --line:#d7deea; --card:#ffffff;
  --brand:#d4a11d; --brand-600:#bd8f18; --ok:#16a34a; --err:#dc2626; --info:#0ea5e9; --info-600:#0284c7;
  --ring:0 0 0 4px rgba(212,161,29,.18); --shadow:0 18px 40px rgba(15,23,42,.08);
  --r:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; color:var(--ink);
  font:15px/1.6 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial;
  background:linear-gradient(180deg,#fbfcff 0,#f3f5fb 360px);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

.wrap{max-width:980px;margin:40px auto;padding:0 18px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--shadow);
  padding:26px;
}

.head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.title{font-size:24px;font-weight:800;letter-spacing:.2px}
.badge{color:#7a5a00;background:#fff7df;border:1px solid #ecdca6;border-radius:999px;padding:6px 10px;font-weight:700;font-size:12.5px}
.sub{color:var(--muted);font-size:13.5px;margin:2px 0 14px}

.alert{
  display:flex;align-items:center;gap:10px;
  background:#fff4f2;border:1px solid #fec8bf;color:#b42318;
  padding:10px 12px;border-radius:12px;margin:0 0 12px;font-size:14px
}

.section{border:1px solid var(--line);border-radius:14px;background:#fafbff;padding:16px}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:14px}
.col-6{grid-column:span 6}.col-12{grid-column:span 12}
@media (max-width:900px){
  .grid{grid-template-columns:repeat(6,1fr)}
  .col-6{grid-column:span 6} .col-12{grid-column:span 6}
}

/* ---------- Champs visibles & contrastés ---------- */
.fld label{display:block;margin:0 0 6px;font-weight:800;font-size:14px;color:#0b1220}
.control{position:relative}

.input,.select,.area{
  width:100%;
  border:1px solid #c8d1e3;            /* plus contrasté que --line */
  background:#fff;                      /* fond blanc explicite */
  color:var(--ink);                     /* texte sombre lisible */
  border-radius:12px;
  padding:12px 12px;
  font:inherit;
  transition:border .18s, box-shadow .18s, background .18s, color .18s;
  outline: none;
}

.input::placeholder,.area::placeholder{color:#9aa6bf}
.input:disabled,.select:disabled,.area:disabled{
  background:#f3f6fb; color:#8a96ad; border-color:#d5dceb; cursor:not-allowed;
}

/* Focus très net */
.input:focus,.select:focus,.area:focus{
  border-color:#e0c36f;
  box-shadow:var(--ring);
  background:#fff;
}

.area{min-height:120px;resize:vertical}

/* Etats invalides */
.is-invalid{
  border-color:var(--err)!important;
  box-shadow:0 0 0 3px rgba(220,38,38,.14)!important;
}

/* Hint / aides */
.help{display:flex;justify-content:space-between;gap:10px;margin-top:6px}
.hint{color:var(--muted);font-size:12px}

/* Select avec chevron */
.select{
  -webkit-appearance:none; appearance:none;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:18px;
  padding-right:40px;
  min-height:42px;
}

/* File input plus lisible */
input[type="file"].input,
input[type="file"]{
  padding:10px 12px;                    /* garde la même hauteur visuelle */
  border:1px solid #c8d1e3;
  background:#fff;
  cursor:pointer;
}
input[type="file"]::-file-selector-button{
  margin-right:10px;
  padding:8px 12px;
  border:1px solid #e0c36f;
  background:#fff7df;
  color:#7a5a00;
  border-radius:10px;
  font-weight:700;
  cursor:pointer;
}

/* Ligne mot de passe */
.rowpw{display:grid;grid-template-columns:1fr max-content max-content;gap:10px;align-items:center}
@media (max-width:560px){.rowpw{grid-template-columns:1fr}}

.btn-sm{
  height:36px;padding:0 14px;border-radius:10px;border:1px solid #ecdca6;
  background:#fff7df;font-size:12.5px;font-weight:800;color:#7a5a00;cursor:pointer;
  transition:background .18s,transform .04s
}
.btn-sm:hover{background:#fff0c7}.btn-sm:active{transform:translateY(1px)}

.divider{height:1px;background:var(--line);margin:8px 0 0}
.counter{display:flex;justify-content:flex-end;color:var(--muted);font-size:12px;margin-top:6px}

/* Actions */
.actions{display:flex;justify-content:center;margin-top:18px}
.btn{
  background:var(--brand);color:#fff;border:none;border-radius:12px;padding:12px 18px;font-weight:800;cursor:pointer;
  box-shadow:0 10px 22px rgba(212,161,29,.18);transition:background .18s,transform .04s
}
.btn:hover{background:var(--brand-600)} .btn:active{transform:translateY(1px)}

/* Lien login */
.login-hint{margin-top:12px;text-align:center;font-size:14px;color:var(--muted)}
.login-hint a{color:var(--brand);font-weight:800;text-decoration:none}
.login-hint a:hover{text-decoration:underline;color:var(--brand-600)}

/* ---------- Modale (a11y + z-index au-dessus du header) ---------- */
.modal{
  position:fixed; inset:0;
  display:none; align-items:center; justify-content:center;
  background:rgba(15,23,42,.45); backdrop-filter:blur(2px);
  z-index:1000;
}
.modal[aria-hidden="false"]{display:flex}
.modal-card{
  width:min(560px,92vw); background:#fff; border-radius:18px; border:1px solid var(--line);
  box-shadow:0 24px 56px rgba(15,23,42,.22); padding:0 0 18px
}
.modal-head{
  display:flex; align-items:center; gap:12px; padding:16px 18px; border-bottom:1px solid var(--line);
  background:linear-gradient(135deg, rgba(22,163,74,.08), rgba(14,165,233,.08));
  border-top-left-radius:18px;border-top-right-radius:18px
}
.modal-badge{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:rgba(22,163,74,.15);border:1px solid rgba(22,163,74,.25)}
.modal-badge svg{width:24px;height:24px;stroke:var(--ok)}
.modal-title{font-size:18px;font-weight:900;margin-left:4px}
.modal-close{margin-left:auto;border:none;background:transparent;cursor:pointer;font-size:22px;line-height:1;padding:4px 6px}
.modal-body{padding:14px 18px 6px;color:#0f172a}
.modal-text p{margin:0 0 8px;font-size:14.5px;line-height:1.6}
.modal-hint{font-size:13px;color:#475569}
.modal-hint strong{font-weight:800}
.modal-actions{display:flex;justify-content:center;margin-top:6px}
.btn-ok{
  background:var(--info);color:#fff;border:none;border-radius:12px;padding:10px 18px;font-weight:900;cursor:pointer;
  box-shadow:0 8px 18px rgba(2,132,199,.25);transition:background .18s,transform .04s
}
.btn-ok:hover{background:var(--info-600)} .btn-ok:active{transform:translateY(1px)}

/* ---------- Petits écrans ---------- */
@media (max-width:560px){
  .wrap{margin:28px auto}
  .card{padding:18px}
  .head{gap:6px; margin-bottom:10px; flex-wrap:wrap; align-items:flex-start}
  .title{font-size:18px; line-height:1.25; font-weight:900; letter-spacing:.1px}
  .badge{font-size:11px; padding:4px 8px; border-radius:999px}
  .badge--hide-sm{display:none!important}
}

/* ---------- Fixes spécifiques visibilité ---------- */
/* Assure une hauteur suffisante pour tous les inputs */
.input, .select { min-height:42px }
/* Couleur de fond explicite même si parent a un bg dégradé */
.input, .select, .area { background-color:#fff }
/* Bord plus visible au repos */
.input, .select, .area { border-color:#c8d1e3 }
/* Met en avant le champ invalid sur mobiles (contraste) */
.is-invalid{ background:#fff5f5 }
