:root{
  --bg0:#0c0f10;
  --bg1:#111416;
  --card:#0f1315;
  --card2:#12181b;
  --border:rgba(255,255,255,.10);
  --text:#e6e6e6;
  --muted:#a8b0b5;
  --accent:#22c55e;
  --accent2:#16a34a;
  --danger:#ef4444;
  --shadow: 0 20px 50px rgba(0,0,0,.55);
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  min-height:100vh;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--text);
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 50%, #178b20 100%);
}


.page{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:28px 14px;
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.titleblock h1{
  font-size:clamp(1.35rem,2.4vw,1.85rem);
  line-height:1.1;
  margin-bottom:6px;
}

.titleblock p{
  color:var(--muted);
  font-size:.95rem;
}

.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

a.btn-ghost{
  text-decoration:none;
  color:var(--muted);
  border:1px solid var(--border);
  background:rgba(0,0,0,.15);
  padding:.55rem .9rem;
  border-radius:999px;
  font-size:.85rem;
}
a.btn-ghost:hover{border-color:rgba(34,197,94,.45); color:var(--text);}

.shell{
  background:linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}


@media (max-width: 980px){
  .form-grid{grid-template-columns:1fr;}
}

.left{
  padding:20px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.right{
  padding:20px;
}


@media (max-width: 980px){
  .left{border-right:none;border-bottom:1px solid rgba(255,255,255,.08);}
}


.section-title{
  font-size:.95rem;
  font-weight:700;
  margin:18px 0 10px;
  color:#dfe7e2;
}

.section-title:first-child{margin-top:0;}

.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (max-width:720px){
  .grid{grid-template-columns:1fr;}
}
.grid.two{
  grid-template-columns: 1fr 1fr;
}

@media (max-width:720px){
  .grid.two{
    grid-template-columns: 1fr;
  }
}

.field{display:flex;flex-direction:column;gap:6px;}
.field.full{grid-column:1 / -1;}

label{
  font-size:.82rem;
  color:#cdd6d0;
  font-weight:650;
}

input, select, textarea{
  width:100%;
  background:var(--text);
  border:1px solid rgba(255,255,255,.12);
  color: black;
  padding:10px 12px;
  border-radius:10px;
  outline:none;
  font-size:.92rem;
}

textarea{min-height:90px;resize:vertical;}

input:focus, select:focus, textarea:focus{
  border-color:rgba(34,197,94,.6);
  box-shadow:0 0 0 3px rgba(34,197,94,.12);
}

.help{
  color:var(--muted);
  font-size:.78rem;
}

.split{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.btn-primary{
  border:none;
  cursor:pointer;
  padding:.72rem 1.2rem;
  border-radius:999px;
  font-weight:800;
  color:#06210f;
  background:radial-gradient(circle at 30% 0%, #62ea8b, var(--accent));
  box-shadow:0 14px 34px rgba(34,197,94,.26);
}

.btn-primary:hover{filter:brightness(1.05); transform:translateY(-1px);}
.btn-primary:active{transform:translateY(0);}

.notice{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.20);
  border-radius:14px;
  padding:12px 12px;
  color:var(--muted);
  font-size:.86rem;
}

.kpi{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}

.kpi .box{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  border-radius:12px;
  padding:10px;
}

.kpi .label{font-size:.72rem;color:var(--muted); margin-bottom:6px;}
.kpi .value{font-size:1.05rem;font-weight:800;color:var(--text);}

.preview{
  margin-top:12px;
  border:1px dashed rgba(255,255,255,.18);
  background:rgba(0,0,0,.18);
  border-radius:14px;
  padding:12px;
  min-height:120px;
}

#preview-placeholder{color:var(--muted); font-size:.9rem;}

.file-thumb{max-width:220px;max-height:220px;object-fit:contain;border-radius:10px;border:1px solid rgba(255,255,255,.10);display:none;background:#0b0d0e;}
#pdf-canvas{display:none;border-radius:10px;border:1px solid rgba(255,255,255,.10);max-width:100%;}
#stl-viewer{display:none;border-radius:12px;border:1px solid rgba(255,255,255,.10);background:#0b0d0e;overflow:hidden;width:100%;height:360px;}

#btn-fullscreen{
  position:absolute;
  top:10px; right:10px;
  padding:6px 10px;
  border:none;
  border-radius:10px;
  background:rgba(0,0,0,.45);
  color:var(--text);
  border:1px solid rgba(255,255,255,.12);
  cursor:pointer;
  font-size:.78rem;
}
#btn-fullscreen:hover{border-color:rgba(34,197,94,.45);}

.stl-wrap{position:relative; width:100%;}

.hr{
  height:1px;
  background:rgba(255,255,255,.08);
  margin:16px 0;
}

.small{
  font-size:.78rem;
  color:var(--muted);
}

/* Fullscreen */
#fullscreen-overlay{
  position:fixed; inset:0;
  display:none;
  align-items:center; justify-content:center;
  background:rgba(0,0,0,.92);
  z-index:9999;
}
#fullscreen-viewer{width:92vw;height:92vh;}
#btn-close-fullscreen{
  position:absolute; top:18px; right:18px;
  padding:10px 14px;
  border:none;
  border-radius:12px;
  background:rgba(239,68,68,.95);
  color:#fff;
  cursor:pointer;
  font-weight:700;
}
/* Lisibilité générale */
.page{max-width:820px;}
.shell{border-radius:20px;}

/* Sections type cartes */
.left,.right{
  padding:18px;
  border:0;
  background:rgba(0,0,0,.16);
}
.form-grid{gap:14px;}
.left{border-bottom:1px solid rgba(255,255,255,.08);}

/* Titres plus visibles */
.section-title{
  font-size:1.05rem;
  letter-spacing:.2px;
  margin:6px 0 10px;
}

/* Champs plus confortables */
input,select,textarea{
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
}
label{font-size:.85rem;}
.help{font-size:.8rem;}

/* Bouton principal plein largeur */
.btn-primary{
  width:100%;
  justify-content:center;
  padding:.9rem 1.2rem;
  border-radius:14px;
}

/* Estimation plus “propre” */
.notice{border-radius:16px;}
.kpi{grid-template-columns:1fr 1fr;}
@media (max-width:520px){
  .kpi{grid-template-columns:1fr;}
}
.progress{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 14px;
}
.step{
  padding:.35rem .65rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
  font-size:.8rem;
  background:rgba(0,0,0,.12);
}
.step.on{
  color:#0b1a0f;
  background:rgba(34,197,94,.85);
  border-color:rgba(34,197,94,.35);
  font-weight:800;
}
