/* Stile condiviso: modulo di iscrizione + pannello admin (stessi colori del sito) */
@font-face { font-family: 'Extenda'; src: url(fonts/extenda-30-deca.woff2) format('woff2'); font-display: swap; size-adjust: 193%; }
@font-face { font-family: 'Oswald'; src: url(fonts/oswald-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Oswald'; src: url(fonts/oswald-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Oswald'; src: url(fonts/oswald-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --cream: #fbf9f4; --sage: #5b7360; --sage-dark: #3f5646; --berry: #9d1a1f; --berry-dark: #7d1418;
  --gold: #c9a24d; --ink: #1f2a24; --line: rgba(91, 115, 96, .28);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--cream) url(topo.svg) center / cover fixed no-repeat;
  font: 16px/1.55 'Inter', system-ui, sans-serif;
}
a { color: var(--berry); }
.wrap { max-width: 760px; margin: 0 auto; padding: 1.4rem 1.1rem 3rem; }
.wrap.wide { max-width: 1180px; }

.hero { padding: 1.6rem 0 1rem; }
.kicker { font: 600 .95rem 'Oswald', sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--sage); margin: 0 0 .4rem; }
h1 { font: 400 clamp(2rem, 7vw, 3.4rem)/1.42 'Extenda', 'Arial Narrow', Impact, sans-serif; text-transform: uppercase; color: var(--sage-dark); margin: 0 0 .6rem; letter-spacing: .02em; }
h1 span { color: var(--berry); }
.lead { font-size: 1.05rem; color: #3b4a40; margin: 0; max-width: 40rem; }
h2 { font: 600 1.35rem 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--sage-dark); margin: 0 0 .8rem; }

.card { background: rgba(255, 255, 255, .86); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem 1.2rem 1.3rem; margin: 0 0 1rem; box-shadow: 0 6px 22px rgba(63, 86, 70, .07); backdrop-filter: blur(4px); }
fieldset.card { min-width: 0; }
legend { font: 600 1.1rem 'Oswald', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--berry); padding: 0 .4rem; }
.note { border-left: 5px solid var(--gold); }
.hint { margin: 0 0 .7rem; color: #51615a; font-size: .95rem; }

label { display: block; font: 600 .92rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--sage-dark); margin: 0 0 .8rem; }
label small { display: block; font: 400 .85rem 'Inter', sans-serif; text-transform: none; letter-spacing: 0; color: #6b7a72; margin-top: .25rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .75rem .85rem; font: 400 1rem 'Inter', sans-serif; color: var(--ink);
  background: #fff; border: 1.5px solid #cfd8d1; border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(157, 26, 31, .22); border-color: var(--berry); }
textarea { min-height: 5rem; }
.grid2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* scelte a scheda (sfide, pagamenti) */
.choices { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice, .chip { margin: 0; cursor: pointer; }
.choice input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box { display: grid; gap: .1rem; height: 100%; padding: .85rem 1rem; background: #fff; border: 2px solid #d5ddd7; border-radius: 12px; transition: border-color .15s, box-shadow .15s, transform .15s; font-family: 'Inter', sans-serif; text-transform: none; letter-spacing: 0; }
.choice .box b { font: 600 1.15rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--sage-dark); }
.choice .box em { font-style: normal; font-weight: 400; color: #51615a; font-size: .92rem; }
.choice .box small { font-weight: 600; color: var(--berry); margin: 0; }
.choice .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .18); margin-bottom: .3rem; }
.choice:hover .box { transform: translateY(-1px); border-color: var(--sage); }
.choice input:checked + .box { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(157, 26, 31, .15); }
.choice input:focus-visible + .box, .chip input:focus-visible + span { outline: 3px solid rgba(157, 26, 31, .35); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip span { display: inline-block; min-width: 3.4rem; text-align: center; padding: .55rem .9rem; background: #fff; border: 2px solid #d5ddd7; border-radius: 999px; font: 600 1rem 'Oswald', sans-serif; letter-spacing: .05em; color: var(--sage-dark); }
.chip input:checked + span { background: var(--berry); border-color: var(--berry); color: #fff; }
.check { display: flex; gap: .65rem; align-items: flex-start; font: 400 .95rem 'Inter', sans-serif; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 .7rem; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--berry); flex: none; }

.total { display: flex; justify-content: space-between; align-items: center; padding: .65rem 1rem .8rem; line-height: 1; margin: 0 0 1rem; background: var(--sage-dark); color: #fff; border-radius: 12px; font: 600 1rem 'Oswald', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.total strong { font: 400 1.5rem/1 'Extenda', sans-serif; letter-spacing: .02em; }

.btn { display: inline-block; cursor: pointer; border: 0; border-radius: 999px; padding: .95rem 1.8rem; font: 600 1.1rem 'Oswald', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--berry); text-decoration: none; box-shadow: 0 8px 20px rgba(157, 26, 31, .28); transition: transform .15s, background .15s; }
.btn:hover { background: var(--berry-dark); transform: translateY(-1px); }
.btn.small { padding: .4rem .9rem; font-size: .85rem; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--sage-dark); border: 2px solid var(--sage); box-shadow: none; }
.btn.ghost:hover { background: var(--sage); color: #fff; }
.btn.danger { background: #fff; color: var(--berry); border: 2px solid var(--berry); box-shadow: none; }
.form > .btn { width: 100%; padding: 1.1rem; font-size: 1.2rem; }

.alert { background: #fff3f1; border: 2px solid var(--berry); border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 1rem; color: #5b1215; }
.alert ul { margin: .4rem 0 0 1.1rem; padding: 0; }
.ok { background: #f0f7f1; border: 2px solid var(--sage); border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 1rem; color: #25402f; }
.sum { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
.sum dt { font: 600 .9rem 'Oswald', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); }
.sum dd { margin: 0; }
.foot { text-align: center; color: #6b7a72; font-size: .9rem; margin-top: 1.5rem; }

/* ---------- admin ---------- */
.topbar { background: var(--sage-dark); color: #fff; }
.topbar .in { max-width: 1180px; margin: 0 auto; padding: .6rem 1.1rem; display: flex; gap: .9rem; align-items: center; position: relative; }
.topbar b { font: 400 1.4rem 'Extenda', sans-serif; letter-spacing: .02em; text-transform: uppercase; margin-right: auto; }
.topbar .curpage { font: 600 .85rem 'Oswald', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.topbar .burger { background: rgba(251,249,244,.92); color: var(--sage-dark); border: 1px solid rgba(91,115,96,.25); width: 46px; height: 46px; padding: 0; display: grid; place-items: center; cursor: pointer; border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.22); transition: background .15s; }
.topbar .burger:hover, .topbar .burger.open { background: #fff; }
.topbar .burger .ic-close { display: none; }
.topbar .burger.open .ic-open { display: none; }
.topbar .burger.open .ic-close { display: inline; }
.topbar .menu { position: absolute; right: 1.1rem; top: calc(100% + .1rem); z-index: 50; width: 17rem; max-width: calc(100vw - 1.6rem); background: #fff; border: 1px solid rgba(91,115,96,.22); border-radius: 18px; padding: .75rem; box-shadow: 0 18px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; }
.topbar .menu[hidden] { display: none; }
.topbar .menu a { color: var(--ink); text-decoration: none; font: 600 1.15rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; padding: .8rem .8rem; border-radius: 10px; border-bottom: 0; }
.topbar .menu a:hover { background: var(--cream); color: var(--berry); }
.topbar .menu a.on { color: var(--berry); background: var(--cream); }
.topbar .menu a.out { margin-top: .5rem; background: var(--berry); color: #fff; text-align: center; border-radius: 999px; padding: .8rem 1.2rem; }
.topbar .menu a.out:hover { background: var(--berry-dark); color: #fff; }
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.kpi span { display: block; font: 600 .8rem 'Oswald', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
.kpi strong { display: block; margin: .25rem 0 .1rem; font: 400 2.1rem/1.45 'Extenda', sans-serif; color: var(--berry); letter-spacing: .02em; }
.kpi small { display: block; color: #6b7a72; }
.charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 1.2rem; }
.bars .b { flex: 1; min-width: 0; background: var(--berry); border-radius: 3px 3px 0 0; position: relative; min-height: 1px; }
.bars .b.alt { background: var(--sage); }
.bars .b i { position: absolute; top: -1.1rem; left: 50%; transform: translateX(-50%); font: 600 .72rem 'Inter', sans-serif; font-style: normal; color: var(--ink); }
.axis { display: flex; gap: 3px; font: 500 .68rem 'Inter', sans-serif; color: #6b7a72; margin-top: 3px; }
.axis span { flex: 1; text-align: center; overflow: hidden; }
.hbars .row { display: grid; grid-template-columns: 7rem 1fr 3.2rem; gap: .6rem; align-items: center; margin: .3rem 0; font-size: .92rem; }
.hbars .track { background: #e9eee9; border-radius: 99px; height: .9rem; overflow: hidden; }
.hbars .fill { height: 100%; background: var(--berry); border-radius: 99px; }
.hbars .row b { text-align: right; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid #e6ebe7; vertical-align: top; }
th { font: 600 .78rem 'Oswald', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); background: #f6f8f6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font: 600 .78rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.pill.paid { background: #dcefe0; color: #1f5a30; } .pill.pending { background: #fff0cc; color: #7a5a00; } .pill.cancelled { background: #eee; color: #666; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { margin: 0; } .filters input, .filters select { margin-top: .2rem; padding: .5rem .6rem; }
.acts { display: flex; gap: .3rem; flex-wrap: wrap; }
.acts form { margin: 0; }
.swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; vertical-align: -1px; margin-right: .3rem; border: 1px solid rgba(0, 0, 0, .25); }
.secret-note { color: #6b7a72; font-size: .85rem; }
.tiers-edit { width: 100%; }
.tiers-edit td { padding: .3rem; } .tiers-edit input { margin: 0; padding: .45rem .5rem; }
details.card > summary { cursor: pointer; font: 600 1.1rem 'Oswald', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--berry); }
details.card { margin-top: .9rem; }
details.card[open] > summary { margin-bottom: .7rem; }
.pager { display: flex; gap: .5rem; align-items: center; margin-top: .8rem; }

details.help { margin: .4rem 0 .2rem; }
details.help > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--sage-dark); color: #fff; font: 600 .9rem 'Oswald', sans-serif; user-select: none; }
details.help > summary::-webkit-details-marker { display: none; }
details.help[open] > summary { background: var(--berry); }
details.help > p { margin: .5rem 0 0; padding: .6rem .8rem; background: rgba(0,0,0,.04); border-radius: 8px; }

.help-body { margin-top: .5rem; padding: .8rem 1rem; background: rgba(0,0,0,.04); border-radius: 8px; font-size: .9rem; color: #40504a; }
.help-body h4 { margin: .9rem 0 .3rem; font: 600 1rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--sage-dark); }
.help-body h4:first-child { margin-top: 0; }
.help-body p, .help-body ol { margin: .3rem 0; }
.help-body ol { padding-left: 1.3rem; }
.help-body code { word-break: break-all; }
[hidden] { display: none !important; }

/* ---- iscrizione di squadra ---- */
.wrap.team { max-width: min(1760px, 97vw); padding-left: .9rem; padding-right: .9rem; }
.wrap.team .hero, .wrap.team .alert, .wrap.team .ok { max-width: 62rem; }
.sq-tools { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; margin: 0 0 1rem; }
.sq-up { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sq-up input[type=file] { font: 400 .9rem 'Inter', sans-serif; max-width: 16rem; }
.team-table { min-width: 1360px; }
.team-table th, .team-table td { padding: .35rem .3rem; vertical-align: middle; }
.team-table input, .team-table select { margin: 0; padding: .5rem .55rem; font-size: .9rem; min-height: 2.5rem; border-radius: 8px; }
.team-table input[type=date] { min-height: 2.5rem; }
.team-table td:nth-child(2), .team-table td:nth-child(3) { min-width: 8rem; }
.team-table td:nth-child(4) { min-width: 10rem; }
.team-table td:nth-child(5) { min-width: 8.5rem; }
.team-table td:nth-child(6) { min-width: 8.5rem; }
.team-table td:nth-child(11) { min-width: 9rem; }
.team-table .sq-n { color: #6b7a72; font-weight: 600; width: 1.6rem; text-align: center; }
.team-table select:disabled { background: #eef1ee; color: #9aa7a0; }
.team-table .sq-del { padding: .3rem .6rem; }

.team-table td:nth-child(7) { min-width: 7rem; }
.team-table td:nth-child(8) { min-width: 6.8rem; }
.team-table td:nth-child(9) { min-width: 5.6rem; }
.team-table td:nth-child(10) { min-width: 9rem; }
.team-table td:nth-child(12) { min-width: 3rem; }

.sq-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.sq-pick { margin: 0; cursor: pointer; }
.sq-file:focus-visible + .sq-pick, .sq-pick:focus-within { outline: 3px solid rgba(157, 26, 31, .22); }

/* ---- altre persone nell'iscrizione singola ---- */
.person { border: 2px solid #d5ddd7; border-radius: 14px; padding: .9rem 1rem .4rem; margin: 0 0 1rem; background: #fff; }
.person-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 .5rem; font: 600 1.05rem 'Oswald', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--berry); }
.person select { display: block; width: 100%; }

.chip input:disabled + span { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

.total strong { position: relative; top: .05rem; }

.filepick { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .6rem 0 1.1rem; }
.filepick .btn { margin: 0; }
.filepick .hint { margin: 0; }

/* inquadra il modulo con la fotocamera */
#cam { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; }
#cam[hidden] { display: none; }
.cam-in { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
#camvideo { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #000; }
.cam-frame { position: absolute; left: 50%; top: calc(50% - 3rem); transform: translate(-50%, -50%); aspect-ratio: 210 / 297; height: min(78%, calc(92vw * 297 / 210)); max-width: 92vw; border: 3px solid #fff; border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); pointer-events: none; }
.cam-hint { position: absolute; top: .8rem; left: 1rem; right: 1rem; margin: 0; text-align: center; color: #fff; font-size: .95rem; text-shadow: 0 1px 4px #000; }
.cam-btns { display: flex; gap: 1rem; justify-content: center; padding: 1rem; background: #000; }
body.cam-on { overflow: hidden; }
.cam-btns .btn { opacity: 1; min-width: 8.5rem; }
.cam-btns #camshot { background: #9d1a1f; color: #fff; border-color: #9d1a1f; }
.cam-btns #camclose { background: #fff; color: #1f2a24; border-color: #fff; }

/* pagine admin larghe (iscritti, squadre) */
.wrap.wide.xwide { max-width: min(1760px, 97vw); padding-left: .9rem; padding-right: .9rem; }
body.xw .topbar .in { max-width: min(1760px, 97vw); padding-left: .9rem; padding-right: .9rem; }
.xwide td:first-child { white-space: nowrap; }
.xwide .acts { min-width: 11rem; }
.xwide td:nth-child(6), .xwide td:nth-child(7) { white-space: nowrap; }
.xwide td:nth-child(4) { word-break: break-all; min-width: 12rem; }

#campreview { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
#campreview[hidden], #camvideo[hidden], .cam-btns[hidden], .cam-frame[hidden] { display: none; }
