/* paytorate — palette del marchio */
:root {
  --green: #2E6A4E;
  --green-dark: #24543e;
  --ink: #16241F;
  --bg: #F2F5EF;
  --soft: #DCEADF;
  --line: #C9D5CC;
  --mustard: #E7B526;
  --mustard-soft: #FBF1D3;
  --muted: #56655F;
  --red: #B3261E;
  --red-soft: #FBE9E7;
  --white: #fff;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--green); }
img { max-width: 100%; display: block; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .3em 0 .4em; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0 0 .5em; }
h3 { font-size: 1.05rem; margin: .4em 0 .3em; }
p { margin: .5em 0; }
small, .fine { color: var(--muted); font-size: .85rem; }
.fine { margin: .8em 0; }
.pre { white-space: pre-wrap; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* header & footer */
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand img { height: 40px; width: auto; }
.top-cta { font-weight: 600; text-decoration: none; padding: 8px 14px; border: 1.5px solid var(--green); border-radius: 999px; font-size: .95rem; }
.foot { border-top: 1px solid var(--line); background: var(--white); padding: 18px 0 28px; font-size: .9rem; }
.foot .legal { color: var(--muted); font-size: .78rem; }

/* testi */
.eyebrow, .kicker { color: var(--green); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.kicker a { text-decoration: none; }
.lead { font-size: 1.08rem; color: #2c3c36; }

/* hero home */
.hero { padding: 28px 0 8px; max-width: 680px; }
.hero h1 { font-size: 2.1rem; }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 28px 0; }
.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step .num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--green); font-weight: 800; }

/* card */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.card-act { border: 2px solid var(--green); }
.card-ok { background: var(--soft); border-color: var(--green); }
.card-warn { background: var(--mustard-soft); border-color: var(--mustard); }
.card-off { background: #f3f3f1; }
details.card summary { cursor: pointer; }

/* bottoni */
.btn { display: inline-block; border: 0; border-radius: 999px; background: var(--green); color: var(--white); font: inherit; font-weight: 700; padding: 11px 20px; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-big { width: 100%; padding: 15px 20px; font-size: 1.05rem; margin-top: 6px; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-ghost:hover { background: var(--soft); }
.btn-warn { background: var(--mustard); color: var(--ink); }
.btn-warn:hover { background: #d4a41f; }
.btn-wa { background: #1f9d55; }
.btn-wa:hover { background: #188046; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.link-danger { color: var(--red); }
form.inline { margin: 6px 0 18px; }

/* moduli */
.form label { display: block; font-weight: 600; margin: 12px 0; }
.form input:not([type=checkbox]):not([type=radio]), .form textarea, .form select {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 10px;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 3px solid var(--soft); border-color: var(--green); }
.form small { display: block; font-weight: 400; margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 6px 16px 10px; margin: 0 0 14px; }
legend { font-weight: 800; padding: 0 6px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 5px; width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--green); }
.choice { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pill { margin: 0 !important; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; cursor: pointer; }
.pill input:checked + span { background: var(--green); border-color: var(--green); color: var(--white); }
.pill input:focus-visible + span { outline: 3px solid var(--soft); }
.with-suffix { display: flex; align-items: center; gap: 8px; }
.with-suffix em { font-style: normal; color: var(--muted); }

/* riepilogo importi */
.summary { margin: 8px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.row > span:last-child { white-space: nowrap; }
.row-strong { font-weight: 800; font-size: 1.1rem; border-bottom: 0; }
.pay-ways { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .95rem; }

/* condivisione */
.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: var(--bg); }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

/* foto */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 85%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 10px 0; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); scroll-snap-align: start; background: var(--soft); }
@media (min-width: 640px) { .gallery { grid-auto-columns: calc(50% - 5px); } }
.gallery:has(> img:only-child) { grid-auto-columns: 100%; }

/* stato */
.badge { display: inline-block; font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-wait { background: #e8eef6; color: #23446b; }
.badge-act { background: var(--green); color: var(--white); }
.badge-ok { background: var(--soft); color: var(--green); }
.badge-warn { background: var(--mustard); color: var(--ink); }
.badge-off { background: #e6e6e3; color: #555; }

.timeline { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.timeline li { text-align: center; font-size: .78rem; color: var(--muted); position: relative; }
.timeline .dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); margin: 0 auto 4px; }
.timeline li.done .dot { background: var(--green); border-color: var(--green); }
.timeline li.done { color: var(--ink); }
.timeline .tl-label { display: block; font-weight: 600; }
.timeline .tl-date { display: block; font-size: .72rem; }
.timeline-off { opacity: .5; }
ol.mini { padding-left: 1.2em; margin: 0; }
ol.mini li { margin: 4px 0; }

/* avvisi */
.alert { border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.alert-err { background: var(--red-soft); border: 1px solid var(--red); color: #5c120d; }
.alert-ok { background: var(--soft); border: 1px solid var(--green); }
.alert-warn { background: var(--mustard-soft); border: 1px solid var(--mustard); }

/* admin */
.admin-nav { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.admin-nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 600; }
.admin-nav a.on { background: var(--ink); color: var(--white); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: .9rem; color: var(--ink); }
.chip.on { background: var(--green); color: var(--white); border-color: var(--green); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .92rem; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.table .num { text-align: right; white-space: nowrap; }
.table .empty { text-align: center; color: var(--muted); padding: 24px; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.actions form { margin: 0; }
.top form { margin: 0; }
