/* MyAuto · Di Lorenzo Gomme — stile comune app cliente e pannello negozio */
:root {
  --ink: #15171A;
  --ink2: #3F4247;
  --muted: #5C5F66;
  --bg: #F3F1EC;
  --card: #FFFFFF;
  --line: #DEDAD2;
  --line2: #EEEAE3;
  --field: #CFCAC0;
  --yel: #F5B800;
  --yel-soft: #FFF4CC;
  --green: #1E7A46;
  --green-soft: #E7F3EC;
  --green-line: #B9DCC7;
  --green-ink: #14532F;
  --red: #B42318;
  --red-soft: #FDECEA;
  --dark: #0B0C0E;
  --on-dark: #C9CCD1;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--dark); }
body { font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
input { font-family: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--yel); outline-offset: 2px; }
a { color: var(--ink); }

.shell { position: relative; width: 100%; max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 520px) { .shell { height: min(100dvh, 920px); margin-top: max(0px, calc((100dvh - 920px) / 2)); border-radius: 24px; } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.pad { padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.brand { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; letter-spacing: 1.4px; color: var(--yel); font-size: 14px; }
.cond { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; }
.h1 { margin: 0; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 30px; line-height: 1.05; }
.lead { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink2); }
.small { font-size: 14px; line-height: 1.4; color: var(--muted); }
.lbl { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.topbar { flex: none; background: var(--ink); color: #fff; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plate { display: inline-flex; align-items: stretch; background: #fff; border-radius: 5px; overflow: hidden; height: 28px; flex: none; }
.plate::before { content: ''; width: 9px; background: #1F4FA3; }
.plate span { padding: 0 8px; display: flex; align-items: center; color: var(--ink); font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: 1px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.warn { background: var(--yel-soft); border: 1.5px solid var(--ink); }
.card.ok { background: var(--green-soft); border-color: var(--green-line); color: var(--green-ink); }
.card.err { background: var(--red-soft); border-color: #F3B7B0; color: var(--red); }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.ico { width: 42px; height: 42px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink); }
.ico.dark { background: var(--ink); color: var(--yel); }
.t16 { font-size: 16px; font-weight: 600; }
.t17b { font-size: 17px; font-weight: 700; line-height: 1.25; }

.btn { height: 50px; border-radius: 14px; border: none; font-size: 16px; font-weight: 600; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.full { width: 100%; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.yel { background: var(--yel); color: var(--ink); font-weight: 700; }
.btn.out { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.sm { height: 44px; border-radius: 12px; font-size: 15px; }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.linkbtn { background: none; border: none; padding: 0 4px; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select { height: 48px; border: 1.5px solid var(--field); border-radius: 12px; padding: 0 14px; font-size: 17px; background: #fff; color: var(--ink); width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; padding: 6px 8px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--ink2); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }

.tile { min-height: 84px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px; text-align: left; text-decoration: none; font-size: 16px; font-weight: 600; }

.list { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2px 16px; }
.list > * + * { border-top: 1px solid var(--line2); }
.li { width: 100%; background: none; border: none; padding: 12px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--ink); }
.bar { width: 100%; height: 6px; border-radius: 999px; background: #E6E2DA; overflow: hidden; display: block; }
.bar > span { display: block; height: 100%; background: var(--ink); }
.bar > span.due { background: var(--yel); }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--yel); color: var(--ink); white-space: nowrap; }
.pill.grey { background: #E6E2DA; }

.tabs { flex: none; height: 64px; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabs button { position: relative; border: none; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; }
.tabs button.on { color: var(--ink); }
.tabs button.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--yel); }

.toast { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 10; background: #fff; border: 1.5px solid var(--ink); border-radius: 18px; padding: 12px 12px 12px 14px; box-shadow: 0 12px 30px rgba(21, 23, 26, .22); display: flex; flex-direction: column; gap: 10px; }
.x { width: 44px; height: 44px; margin: -8px -6px 0 0; border: none; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.center { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 32px 24px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid #E6E2DA; border-top-color: var(--ink); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* foto dei pezzi di ricambio (lavori) e foto grande */
.ricambi { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.ricambi button { padding: 0; border: 0; background: none; cursor: zoom-in; min-height: 0; }
.ricambi img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.ric { position: relative; }
.ric .ric-x { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 14px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox .lb-x { position: absolute; top: 12px; right: 12px; }
