/* Lato servito dal nostro server (niente Google Fonts). Licenza: assets/fonts/OFL.txt */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/lato-light.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lato-regular.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/lato-bold.woff2") format("woff2"); }

:root {
  --red: #ed1c25;        /* rosso del logo Stile Alpino */
  --red-deep: #c4141c;
  --pine: var(--red);
  --pine-deep: #1f2326;  /* titoli: antracite */
  --mist: #ffffff;
  --panel: #f6f7f8;
  --night: #2c2d30;      /* piè di pagina come sul sito */
  --paper: #ffffff;
  --ink: #1f2326;
  --muted: #5f666d;
  --line: #d8dcdf;
  --blaze: #ed1c25;
  --ok: #2f6b3f;
  --head: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  padding-top: env(safe-area-inset-top, 0px);
}


.wrap { max-width: 600px; margin: 0 auto; padding: 28px 20px 48px; }
.wrap.wide { max-width: 1180px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.shop { font-family: var(--head); font-weight: 600; font-size: 20px; color: var(--pine); letter-spacing: .01em; }
.logo { height: 72px; width: auto; display: block; }

h1 {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.15;
  color: var(--ink);
  margin: 28px 0 10px;
  text-align: center;
}
h2 { font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1.2; color: var(--ink); margin: 0 0 12px; }
.lead { font-size: 18px; font-weight: 300; color: var(--muted); margin: 0 auto 28px; max-width: 30em; text-align: center; }

.site-head { text-align: center; padding-top: 8px; }
.site-head .logo { height: 88px; margin: 0 auto; }
.site-head .tagline { margin-top: 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.site-head .shop-link { display: inline-block; margin-top: 10px; font-size: 15px; }
.site-foot { background: var(--night); color: #d9dadc; margin-top: 40px; padding: 32px 20px calc(32px + env(safe-area-inset-bottom, 0px)); }
.site-foot .foot-in { max-width: 600px; margin: 0 auto; display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .site-foot .foot-in { max-width: 900px; grid-template-columns: repeat(3, 1fr); } }
.site-foot h3 { color: #fff; font-weight: 400; font-size: 20px; margin: 0 0 6px; }
.site-foot p { font-weight: 300; font-size: 15px; margin: 0; }
.site-foot a { color: #fff; }
p { margin: 0 0 14px; }
a { color: var(--pine); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}

/* ---------- Modulo ---------- */
form.signup { background: var(--panel); border-top: 3px solid var(--red); padding: 26px 22px 30px; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-family: var(--head); font-weight: 700; font-size: 20px; color: var(--ink); padding: 0; margin-bottom: 12px; }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: 12px 12px;
  min-height: 50px;
}
input:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(237, 28, 37, .18); }
.row { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 1fr; } .row.cap { grid-template-columns: 1fr 2fr; } }

.field.has-error input, .field.has-error select { border-color: var(--blaze); }
.err { color: var(--red-deep); font-size: 15px; font-weight: 600; margin-top: 6px; }
.err::before { content: "! "; }

.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 4px; cursor: pointer; background: #fff; }
.choice input { width: 22px; height: 22px; accent-color: var(--pine); margin: 0; flex: none; }
.choice:has(input:checked) { border-color: var(--red); background: #fff4f4; }
.altro-text { margin-top: 10px; }
.field label.choice { display: flex; font-weight: 500; font-size: 17px; margin: 0; }
.field label.consent { display: flex; font-weight: 400; font-size: 15px; margin-bottom: 0; }

.consent { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.consent.sub { margin-left: 36px; }
.consent input { width: 24px; height: 24px; accent-color: var(--pine); margin: 0; flex: none; }

.btn {
  display: inline-block;
  font: 700 17px/1 var(--body);
  background: var(--pine);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 17px 26px;
  min-height: 54px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--red-deep); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--pine); }
.btn.small { font-size: 14px; padding: 8px 12px; min-height: 0; }
.btn.danger { background: var(--blaze); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-left: 4px solid var(--red); background: var(--panel); padding: 14px 16px; margin-bottom: 20px; font-weight: 600; }
.notice { background: var(--panel); border-top: 3px solid var(--red); padding: 26px 22px; }
.notice .big { font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1.15; color: var(--ink); margin-bottom: 14px; }
.small { font-size: 14px; color: var(--muted); }

/* ---------- Tessera ---------- */
.card {
  background: var(--pine);
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin: 18px 0 20px;
}
.card { background: var(--red); }
.card .top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; gap: 12px; }
.card .top .shop { color: #fff; }
.card .badge-logo { background: #fff; border-radius: 10px; padding: 8px 10px; line-height: 0; }
.card .badge-logo .logo { height: 54px; }
.card .label { font-family: var(--head); font-weight: 300; font-size: 20px; text-align: right; line-height: 1.1; }
.card .holder { padding: 0 20px 16px; font-family: var(--head); font-weight: 700; font-size: 24px; line-height: 1.15; }
.card .code { background: #fff; color: #000; padding: 18px 14px 14px; text-align: center; }
.card .code img { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; image-rendering: pixelated; }
.card .num { font: 600 20px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .14em; margin-top: 10px; }
body.card-page { background: #fff; }

/* ---------- Admin ---------- */
.admin-top .logo { height: 56px; }
.admin-top { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav a { padding: 8px 12px; border-radius: 4px; text-decoration: none; color: var(--ink); font-weight: 500; }
.admin-nav a.on { background: var(--pine); color: #fff; }
.panel { background: var(--panel); padding: 20px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); margin-bottom: 20px; }
.stats div { background: #fff; padding: 14px 16px; }
.stats b { display: block; font-family: var(--head); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--pine-deep); }
.stats span { font-size: 14px; color: var(--muted); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.badge { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 3px; background: #e7ece9; white-space: nowrap; }
.badge.ok { background: #dcefe2; color: var(--ok); }
.badge.warn { background: #fbe3e6; color: var(--blaze); }
.badge.wait { background: #fff1d6; color: #7a5200; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
.copy { display: flex; gap: 8px; margin-bottom: 12px; }
.copy input { font: 14px ui-monospace, Menlo, Consolas, monospace; min-height: 44px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form .field { margin: 0; }
.flash { background: #dcefe2; color: var(--ok); padding: 12px 16px; margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

body.card-page .card { box-shadow: 0 0 0 1px var(--line); }
.card-img { margin: 8px auto 22px; max-width: 520px; perspective: 900px; }
.card-img img { display: block; width: 100%; height: auto; border-radius: 4.5% / 7%;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 14px 32px rgba(31,35,38,.22);
  animation: card-in .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes card-in { from { transform: rotateX(24deg) translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.card-actions { display: grid; gap: 10px; max-width: 520px; margin: 0 auto 18px; }
.btn.wallet { background: #000; color: #fff; }
.btn.wallet:hover { background: #222; }
.center { text-align: center; max-width: 34em; margin-left: auto; margin-right: auto; }

.legal { max-width: 40em; margin: 0 auto 28px; }
.legal h2 { font-size: 21px; margin: 28px 0 8px; }
.legal h3 { font-size: 18px; margin: 20px 0 6px; }
.legal ul { padding-left: 1.2em; margin: 0 0 14px; }
.legal li { margin-bottom: 6px; }
textarea { min-height: 0; }
