/* Fidelity e tessera Ropa De Gorila — bianco e nero */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --ink: #111111;
  --muted: #6E6E73;
  --line: #E5E5EA;
  --green: #1F7A37;
  --red: #C4221B;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hero { background: #000; color: #fff; text-align: center; padding: calc(22px + env(safe-area-inset-top)) 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero img { width: 150px; max-width: 45vw; display: block; }
.hero.small img { width: 110px; }
.hero div { font-size: 13px; letter-spacing: .25em; text-transform: uppercase; opacity: .8; }
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.lead { font-size: 18px; line-height: 1.45; margin: 4px 2px; text-align: center; }
form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; color: var(--muted); }
.field i, .check i { font-weight: 400; font-style: normal; color: var(--muted); }
.field input { font: inherit; font-size: 18px; font-weight: 500; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 0 14px; min-height: 54px; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
.field input[type=date] { min-height: 54px; line-height: 50px; }
.field input:focus { outline: none; border-color: #000; }
.shops { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.shop { min-height: 58px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font-weight: 700; font-size: 16px; color: var(--ink); padding: 6px 10px; }
.shop.on { background: #000; color: #fff; border-color: #000; }
.consents { display: flex; flex-direction: column; gap: 10px; background: var(--card); border-radius: 16px; padding: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.check input { width: 24px; height: 24px; flex-shrink: 0; margin: 0; accent-color: #000; }
.check.off { opacity: .45; }
.link { color: #0A64D6; text-decoration: underline; padding: 0; font-weight: 600; }
.note { font-size: 14px; color: var(--muted); margin: 0; }
.err { color: var(--red); font-weight: 600; margin: 0; text-align: center; }
.primary { background: #000; color: #fff; font-weight: 700; font-size: 18px; min-height: 58px; border-radius: 16px; padding: 0 22px; }
.primary:disabled { opacity: .5; }
.ok { background: var(--card); border-radius: 20px; padding: 26px 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ok h1 { margin: 0; font-size: 28px; }
.ok p { margin: 0; font-size: 17px; line-height: 1.45; color: #3a3a3c; }
.qr { background: #fff; padding: 8px; border-radius: 16px; width: min(280px, 70vw); }
.qr svg { display: block; width: 100%; height: auto; }
.small { font-size: 14px; color: var(--muted); }
.center { text-align: center; }

/* Informativa */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.modal[hidden] { display: none; }
.sheet { background: var(--card); width: min(680px, 100%); max-height: 88vh; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; position: relative; }
.privacy { overflow: auto; font-size: 15px; line-height: 1.5; padding-right: 4px; }
.privacy h2 { font-size: 20px; margin: 0 40px 8px 0; }
.close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; font-size: 20px; }

/* Tessera */
.card-page { gap: 14px; }
.card { background: #000; color: #fff; border-radius: 24px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.card-top { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.card-top b { font-size: 17px; letter-spacing: 0; text-transform: none; text-align: right; }
.qr.big { width: min(300px, 76vw); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .15em; font-weight: 700; }
.card .small { color: #c7c7cc; margin: 0; }
.bday { background: #FFF4E5; color: #8A3D00; border-radius: 18px; padding: 14px 16px; font-size: 17px; text-align: center; }
.balance, .recent, .install { background: var(--card); border-radius: 20px; padding: 16px 18px; }
.balance .lbl { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.balance .amt { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 8px; }
.balance p { margin: 6px 0 0; }
.good { color: var(--green); font-weight: 600; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #000; border-radius: 99px; }
.recent h2, .install h2 { font-size: 18px; margin: 0 0 8px; }
.mov { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.mov:first-of-type { border-top: 0; }
.mov span { display: flex; flex-direction: column; gap: 2px; }
.mov span:last-child { text-align: right; }
.mov i { font-style: normal; font-size: 13px; color: var(--muted); }
.mov b { font-size: 13px; color: var(--green); }
.mov b.used { color: var(--red); }
.install p { margin: 0; font-size: 16px; line-height: 1.45; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

/* Buoni (resi) sulla tessera */
.vouchers { background: var(--card, #fff); border-radius: 18px; padding: 14px 16px; }
.vouchers h2 { font-size: 18px; margin: 0 0 8px; }
.voucher { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.voucher:first-of-type { border-top: 0; }
.voucher span:first-child { display: flex; flex-direction: column; gap: 2px; font-size: 18px; }
.voucher i { font-style: normal; font-size: 13px; color: var(--muted); }
.voucher .vc { font-weight: 800; letter-spacing: .06em; font-size: 18px; background: #000; color: #fff; padding: 4px 10px; border-radius: 10px; }
