/* ============================================================
   Dalco Services field app - shared stylesheet
   Used by index.html (menu) and all four form pages.
   Colours and component styles carried over unchanged from the
   original Daily Sheet so the new forms match it exactly.
   ============================================================ */

:root{
  --green: #4FA61F;
  --ink: #16181A;
  --concrete: #6B6F72;
  --concrete-light: #C7C9C8;
  --site-white: #FAFAF8;
  --orange: #FF6A13;
  --hazard: #F5C518;
  --radius: 10px;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--site-white);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  line-height:1.4;
  padding-bottom:60px;
}

/* ---------- Header ---------- */
header{
  background:var(--ink); padding:18px 20px 16px;
  display:flex; align-items:center; gap:14px;
  position:relative; overflow:hidden;
}
header::after{
  content:""; position:absolute; left:0;right:0;bottom:0; height:5px;
  background:repeating-linear-gradient(-45deg,var(--hazard) 0 10px,var(--ink) 10px 20px);
  opacity:.9;
}
/* The logo is a wide mark (~3.7:1), so it's sized by width with a height cap
   rather than height alone — otherwise it crowds the title on a phone. */
header img{
  width:126px;max-height:40px;object-fit:contain;flex:none;
  display:block;background:#fff;border-radius:6px;padding:5px 7px;
}
@media (max-width:380px){ header img{width:104px;} }
header .htext{color:#fff;}
header h1{font-size:15px;margin:0 0 2px;font-weight:800;letter-spacing:0.02em;text-transform:uppercase;}
header p{margin:0;font-size:12.5px;color:#C7C9C8;}

/* "Back to menu" chevron shown on the four form pages */
.backlink{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12.5px;font-weight:700;color:var(--concrete);
  text-decoration:none;padding:14px 16px 0;max-width:560px;margin:0 auto;
}
.backlink:active{color:var(--green);}
.backlink svg{width:14px;height:14px;}
.backlink-wrap{max-width:560px;margin:0 auto;}

main{max-width:560px;margin:0 auto;padding:18px 16px 0;}

/* ---------- Menu (index.html) ---------- */
.menu-intro{
  font-size:13px;color:var(--concrete);margin:2px 0 16px;
}
.menu-card{
  display:flex;align-items:center;gap:14px;
  background:#fff;border:1px solid #E4E3DE;border-left:5px solid var(--green);
  border-radius:var(--radius);padding:18px 16px;margin-bottom:12px;
  text-decoration:none;color:var(--ink);
  transition:transform .1s, border-color .15s;
}
.menu-card:active{transform:scale(0.99);border-color:var(--green);}
.menu-icon{
  width:44px;height:44px;border-radius:9px;flex:none;
  background:#F3FAEF;color:var(--green);
  display:flex;align-items:center;justify-content:center;
}
.menu-icon svg{width:24px;height:24px;}
.menu-text{flex:1;min-width:0;}
.menu-text b{display:block;font-size:15.5px;font-weight:800;letter-spacing:.01em;}
.menu-text span{display:block;font-size:12.5px;color:var(--concrete);margin-top:2px;}
.menu-chev{color:var(--concrete-light);flex:none;}
.menu-chev svg{width:18px;height:18px;}
.menu-badge{
  font-size:9.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  color:var(--green);border:1px solid var(--green);border-radius:4px;
  padding:1px 5px;margin-left:8px;vertical-align:2px;
}
.menu-foot{
  text-align:center;font-size:11.5px;color:var(--concrete);
  margin:22px 0 10px;line-height:1.6;
}

/* ---------- Form building blocks ---------- */
.step{
  background:#fff;border:1px solid #E4E3DE;border-radius:var(--radius);
  padding:16px 16px 18px;margin-bottom:14px;
}
.step-head{display:flex;align-items:center;gap:10px;margin-bottom:4px;}
.step-num{
  width:26px;height:26px;border-radius:6px;background:var(--ink);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;flex:none;
}
.step-title{font-size:15px;font-weight:800;}
.req-tag{
  font-size:10.5px;font-weight:800;letter-spacing:.04em;color:var(--orange);
  border:1px solid var(--orange);border-radius:4px;padding:1px 6px;margin-left:auto;
}

.subhead{
  font-size:11.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  color:var(--concrete);margin:18px 0 10px;padding-top:14px;border-top:1px solid #EEEDE8;
}
.step > .subhead:first-of-type{margin-top:12px;border-top:none;padding-top:0;}
.subhead .subhead-note{
  display:block;text-transform:none;letter-spacing:0;font-weight:500;
  font-size:11.5px;color:var(--concrete);margin-top:4px;
}

.field{margin-bottom:12px;}
.field label{
  display:block;font-size:12.5px;font-weight:700;color:var(--ink);margin-bottom:5px;
}
.field .opt{font-weight:500;color:var(--concrete);text-transform:none;letter-spacing:0;}
.field input[type=text],
.field input[type=date],
.field input[type=time],
.field input[type=number],
.field select,
.field textarea{
  width:100%;padding:11px 12px;font-size:15px;font-family:inherit;
  border:1.5px solid var(--concrete-light);border-radius:8px;background:#fff;color:var(--ink);
}
.field select{appearance:none;-webkit-appearance:none;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%236B6F72" stroke-width="2"><path d="M5.5 7.5l4.5 4.5 4.5-4.5"/></svg>');
  background-repeat:no-repeat;background-position:right 10px center;padding-right:32px;
}
.field textarea{min-height:70px;resize:vertical;}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--green);outline:none;}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;}

.row-card{
  border:1.5px solid var(--concrete-light);border-radius:8px;padding:12px;margin-bottom:10px;position:relative;
}
.row-card.has-data{border-color:var(--green);background:#F9FCF7;}
.row-head{display:flex;align-items:center;margin-bottom:10px;}
.row-head b{font-size:12.5px;}
.row-remove{
  margin-left:auto;font-size:11.5px;color:var(--concrete);background:none;border:none;
  text-decoration:underline;cursor:pointer;padding:4px;
}
.add-row{
  width:100%;padding:12px;border:1.5px dashed var(--concrete-light);border-radius:8px;
  background:none;color:var(--concrete);font-size:13.5px;font-weight:700;cursor:pointer;margin-top:2px;
}
.add-row:hover{border-color:var(--green);color:var(--green);}

/* Read-only computed value (e.g. Miles = end - start) */
.calc{
  display:flex;align-items:center;justify-content:space-between;
  background:#F3FAEF;border:1.5px solid var(--green);border-radius:8px;
  padding:9px 12px;font-size:13px;font-weight:700;color:var(--green);
}
.calc.empty{background:#F7F7F5;border-color:var(--concrete-light);color:var(--concrete);}
.calc span:first-child{font-size:11.5px;letter-spacing:.04em;text-transform:uppercase;}

.req-dot::after{content:" *";color:var(--orange);}

/* ---------- Tap-to-check list ---------- */
.checkgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
@media (max-width:430px){ .checkgrid{grid-template-columns:1fr;} }
.checkitem{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:12px;border:1.5px solid var(--concrete-light);border-radius:8px;
  background:#fff;color:var(--ink);font-family:inherit;font-size:13.5px;font-weight:600;
  text-align:left;cursor:pointer;
}
.checkitem:active{transform:scale(0.99);}
.checkitem .box{
  width:21px;height:21px;border-radius:5px;flex:none;
  border:2px solid var(--concrete-light);
  display:flex;align-items:center;justify-content:center;
}
.checkitem .box svg{width:13px;height:13px;color:#fff;opacity:0;}
.checkitem.on{border-color:var(--green);background:#F9FCF7;}
.checkitem.on .box{background:var(--green);border-color:var(--green);}
.checkitem.on .box svg{opacity:1;}

.check-actions{display:flex;gap:10px;margin-top:10px;}
.check-actions button{
  flex:1;padding:9px;border:1.5px solid var(--concrete-light);border-radius:8px;
  background:none;color:var(--concrete);font-family:inherit;font-size:12.5px;font-weight:700;cursor:pointer;
}
.check-actions button:hover{border-color:var(--green);color:var(--green);}

/* ---------- Signature pad ---------- */
.sigpad-wrap{
  position:relative;border:1.5px solid var(--concrete-light);border-radius:8px;
  background:#fff;overflow:hidden;
}
.sigpad-wrap.signed{border-color:var(--green);}
/* touch-action:none is what stops the page scrolling out from under a finger
   that's mid-signature on an iPad. */
.sigpad{display:block;width:100%;height:170px;touch-action:none;cursor:crosshair;}
.sigpad-base{
  position:absolute;left:26px;right:26px;bottom:34px;
  border-bottom:1.5px dashed var(--concrete-light);pointer-events:none;
}
.sigpad-hint{
  position:absolute;left:0;right:0;bottom:12px;text-align:center;
  font-size:12px;color:var(--concrete);pointer-events:none;
}
.sigpad-wrap.signed .sigpad-base,
.sigpad-wrap.signed .sigpad-hint{display:none;}
.sigpad-clear{
  position:absolute;top:8px;right:8px;padding:5px 10px;
  border:1px solid var(--concrete-light);border-radius:6px;background:#fff;
  color:var(--concrete);font-family:inherit;font-size:11.5px;font-weight:700;cursor:pointer;
}
.sigpad-clear:hover{border-color:var(--orange);color:var(--orange);}

/* ---------- Photo slots ---------- */
.slots{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.slot{
  aspect-ratio:3/4;min-height:130px;border-radius:8px;position:relative;background:#fff;
  border:2px solid var(--concrete-light);overflow:hidden;cursor:pointer;
}
.slot.filled{border-style:solid;border-color:var(--green);}
.slot.required::before{
  content:"REQUIRED";position:absolute;top:6px;left:6px;font-size:8.5px;font-weight:800;
  letter-spacing:.03em;color:var(--orange);background:#fff;padding:1px 4px;border-radius:3px;z-index:2;
}
.slot.optional::before{
  content:"OPTIONAL";position:absolute;top:6px;left:6px;font-size:8.5px;font-weight:800;
  letter-spacing:.03em;color:var(--concrete);background:#fff;padding:1px 4px;border-radius:3px;z-index:2;
}
.slot.filled::before{display:none;}
.slot-empty{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:6px;color:var(--concrete);
}
.slot-empty svg{width:26px;height:26px;opacity:.55;}
.slot-empty span{font-size:10.5px;font-weight:700;}
.slot img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.slot .remove{
  position:absolute;top:5px;right:5px;width:22px;height:22px;border-radius:50%;
  background:rgba(20,20,20,.72);color:#fff;border:none;font-size:13px;line-height:1;z-index:3;cursor:pointer;
}
.slot .kb{
  position:absolute;bottom:5px;left:5px;font-size:9px;font-weight:700;color:#fff;
  background:rgba(20,20,20,.6);padding:1px 5px;border-radius:3px;z-index:2;
}
/* The trailing "add" tile in the photo gallery. Dashed so it reads as an
   empty space to fill rather than a missing photo. */
.slot-add{border-style:dashed;}
.slot-add:hover{border-color:var(--green);}
.slot-add .slot-empty span{color:var(--concrete);}

.file-cover{position:absolute;inset:0;opacity:0;cursor:pointer;}
.hidden{display:none !important;}

.status-line{margin-top:12px;font-size:12.5px;color:var(--concrete);}
.status-line--intro{margin-top:0;margin-bottom:12px;}
.status-line.ok{color:var(--green);font-weight:700;}

/* ---------- Send ---------- */
.send-wrap{position:sticky;bottom:0;padding:10px 0 4px;background:linear-gradient(var(--site-white) 40%, var(--site-white));}
button.send{
  width:100%;padding:16px;border:none;border-radius:var(--radius);
  background:var(--concrete-light);color:#fff;font-size:16px;font-weight:800;letter-spacing:.02em;
  cursor:not-allowed;transition:background .15s, transform .1s;
}
button.send.ready{background:var(--green);cursor:pointer;}
button.send.ready:active{transform:scale(0.99);}
button.send.sending{background:var(--ink);cursor:wait;}
button.send.sent{background:var(--concrete);cursor:default;}
.send-note{text-align:center;font-size:11.5px;color:var(--concrete);margin-top:8px;}
.reset-link{
  margin:10px auto 0;display:block;font-size:12px;color:var(--concrete);
  text-decoration:underline;background:none;border:none;cursor:pointer;padding:6px;
}

/* ---------- Saved draft ----------
   Sits at the top of the form. Green while it is quietly holding what has
   been typed; amber when it is offering back an unsent form from an earlier
   day, which needs a decision rather than just reassurance. */
.draft-note{display:none;}
.draft-note.show{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;
  margin:0 0 14px;padding:9px 12px;border-radius:8px;
  background:#F3FAEF;border:1px solid var(--green);
  color:var(--green);font-size:12.5px;font-weight:700;
}
.draft-note.offer{background:#FFFBEF;border-color:var(--hazard);color:var(--ink);}
.draft-actions{margin-left:auto;display:flex;gap:6px;}
.draft-note button{
  font-size:12px;font-weight:700;padding:7px 11px;border-radius:6px;cursor:pointer;
  border:1px solid var(--green);background:var(--green);color:#fff;
}
.draft-note button[data-draft="discard"]{
  background:none;color:var(--concrete);border-color:var(--concrete-light);
}

.result{margin-top:12px;padding:12px 14px;border-radius:8px;font-size:13px;display:none;}
.result.show{display:block;}
.result.success{background:#F3FAEF;color:var(--green);border:1px solid var(--green);}
.result.error{background:#FFF3EC;color:var(--orange);border:1px solid var(--orange);}

@media (prefers-reduced-motion: reduce){*{transition:none !important;}}
:focus-visible{outline:3px solid var(--orange);outline-offset:2px;}
