:root{
  --bg:#f5f7fb;
  --card:#fff;
  --ink:#0f172a;
  --muted:#6b7280;
  --brand:#1976d2;
  --ok:#065f46;
  --error:#b91c1c;
  --radius:10px;
  --shadow:0 4px 12px rgba(0,0,0,.07);
  --input-h:42px;
  --gap:16px;
}

/* Base */
*{box-sizing:border-box}
body{
  font-family: Arial, sans-serif;
  background: var(--bg);
  margin:0;
  padding:20px;
  color: var(--ink);
}
.container{
  max-width: 980px;
  margin:auto;
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
h1,h2,h3{ margin:0 0 12px }
h1{ font-size:24px }
h2{ font-size:18px }
h3{ font-size:16px }

/* Cards y secciones */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  margin-bottom:14px;
}
.section{ margin-bottom:16px }

/* Grid principal de campos */
.form-section-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px 24px;
}
@media (max-width: 720px){
  .form-section-grid{ grid-template-columns: 1fr; }
}

/* Grupos y controles grandes */
.form-group{ display:flex; flex-direction:column; gap:6px }
.form-group label{ font-weight:600; font-size:13px; color:#111827 }
input[type="text"], input[type="date"], input[type="number"], select{
  height: var(--input-h);
  width:100%;
  padding: 0 12px;
  font-size: 15px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#fff;
}
::placeholder{ color:#9aa3af; font-size:12px }

/* Pasos numerados */
.step-title{
  display:flex; align-items:center; gap:10px; margin:6px 0 12px;
}
.step-badge{
  width:28px; height:28px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  font-weight:700; color:#0b63d1; background:#e8f2ff; border:1px solid #cfe4ff;
}

/* Grid de pesos */
.grid-poids{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap:10px;
}
.poids-input{
  height:36px;
  border:1px solid #e5e7eb; border-radius:8px; padding:0 10px;
}

/* Acciones finales tipo CTA (mismo patrón que Emballage/Râpés) */
.cta-bar{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center;
}
.cta{
  display:inline-flex; align-items:center; gap:8px;
  height:38px; padding:0 14px; border:none; border-radius:10px;
  background:#f3f4f6; color:#111827; cursor:pointer; text-decoration:none; font-weight:600;
}
.cta:hover{ background:#e7e8eb }
.cta.primary{ background: var(--brand); color:#fff }
.cta.primary:hover{ filter:brightness(.95) }

/* Botón pequeño */
.btn{ height:38px; padding:0 12px; border:none; border-radius:8px; background:var(--brand); color:#fff; cursor:pointer }
.btn:hover{ filter:brightness(.95) }
.btn-ghost{ background:#f3f4f6; color:#111827 }
.btn-ghost:hover{ background:#e7e8eb }

/* Subnotas y helpers */
.small-note{ font-size:12px; color:var(--muted) }
.help{
  font-size:13px; color:#b91c1c; background:#fee2e2; border:1px solid #fecaca;
  padding:8px 10px; border-radius:8px; margin-top:10px
}

/* Tabla totales (si la usas dentro de tabla) */
.in-table{ width:120px }

/* Títulos centrados suaves */
.page-header{ text-align:center; margin-bottom:12px }

/* (Opcional) separador suave */
hr{ border:none; border-top:1px solid #eef0f3; margin:16px 0 }

/* ===== DEMOULAGE — Recuadros con gris igual a Emballage ===== */
:root{
  --panel-bg: #f7f7f9;      /* gris de Emballage */
  --panel-border: #e7e9f2;  /* borde suave */
}

/* Bloques / secciones */
.form-section,
.form-section-grid,
.dynamic-group,
#poidsContainer,
.grid-poids {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
}

/* Inputs: quedan blancos para mejor contraste */
input[type="text"],
input[type="date"],
input[type="number"],
select {
  background: #fff;
  border: 1px solid #d1d5db;
}

/* Caja principal sigue blanca; solo sutil sombra */
.container{
  background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* Grid de pesos: aspecto pill con gris de fondo */
.grid-poids{
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
}
.grid-poids input[type="number"]{
  background:#fff;
  border: 1px solid #e2e5ef;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
}

/* ===================== 📱 RESPONSIVE OPTIMIZATIONS ===================== */
@media (max-width: 900px){
  body{ padding:12px; }
  .container{ padding:16px; }
  .card{ padding:14px; }
  input, select{ font-size:14px; height:38px; }
  h1{ font-size:20px; }
  h2{ font-size:16px; }
  .cta-bar{ flex-direction:column; align-items:stretch; gap:12px; }
  .cta{ justify-content:center; width:100%; }
  .btn{ width:100%; }
}

@media (max-width: 600px){
  body{ padding:10px; }
  .container{ padding:14px; border-radius:8px; }
  .form-section-grid{ grid-template-columns:1fr; gap:12px; }
  .cta-bar{ flex-direction:column; align-items:stretch; }
  .cta, .btn{ width:100%; height:42px; font-size:15px; }
  .step-title{ flex-direction:row; flex-wrap:wrap; gap:6px; }
  .step-badge{ width:24px; height:24px; font-size:13px; }
  input, select{ font-size:14px; }
  .grid-poids{ grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
  .grid-poids input{ height:34px; font-size:13px; }
}
