@font-face { font-family: "Cormorant"; src: url("font/CormorantGaramond-VariableFont_wght.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("font/Montserrat-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("font/Montserrat-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("font/Montserrat-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --nero: #0f0f0f; --sfondo: #141414; --pannello: #1b1b1b; --pannello2: #222; --linea: #2c2c2c;
  --testo: #d9d5ce; --secondario: #8f8a82; --avorio: #f5f3ef; --oro: #c6a76b; --oro-scuro: #a88a52;
  --ok: #7fc48f; --errore: #ff9a8f; --avviso: #ffb35c;
  --serif: "Cormorant", Georgia, serif; --sans: "Montserrat", -apple-system, Helvetica, sans-serif;
  --sicuro-basso: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--sfondo); color: var(--testo); font-family: var(--sans); font-weight: 400; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font-family: inherit; }
img { -webkit-user-drag: none; }
.caricamento { text-align: center; padding: 60px 20px; color: var(--secondario); }
[hidden] { display: none !important; }

/* ---------- struttura ---------- */
.contenitore { width: min(920px, 100%); margin: 0 auto; padding: 0 18px calc(40px + var(--sicuro-basso)); }
.testata { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; max-width: 920px; margin: 0 auto; }
.testata .logo { height: 44px; max-width: 58%; object-fit: contain; object-position: left center; }
.testata .utente { font-size: 12px; color: var(--secondario); text-align: right; line-height: 1.5; }
.testata .utente a { color: var(--oro); text-decoration: none; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--avorio); margin: 0; }
h1 { font-size: clamp(32px, 7vw, 46px); line-height: 1.05; }
h2 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 6px; }
h3 { font-size: 22px; }
.sopra { color: var(--secondario); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
p { line-height: 1.6; }
.piccolo { font-size: 13px; color: var(--secondario); }
.carta { background: var(--pannello); border: 1px solid var(--linea); border-radius: 8px; padding: 20px; }
.carta + .carta { margin-top: 14px; }
.riga { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spazio { flex: 1; }
.centro { text-align: center; }
.mt { margin-top: 18px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 18px; }

/* ---------- pulsanti e campi ---------- */
.btn { background: transparent; border: 1px solid var(--oro); color: var(--oro); font-size: 13px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; padding: 12px 20px; border-radius: 4px; cursor: pointer; transition: background .15s, color .15s; min-height: 44px; }
.btn:hover { background: rgba(198,167,107,.12); }
.btn.pieno { background: var(--oro); color: #151311; }
.btn.pieno:hover { background: #d4b77e; }
.btn.neutro { border-color: #555; color: var(--testo); }
.btn.piccolo { padding: 7px 12px; min-height: 34px; font-size: 11px; }
.btn.largo { width: 100%; }
.btn:disabled { opacity: .4; cursor: default; }
.link { color: var(--oro); background: none; border: 0; cursor: pointer; font-size: 13px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
label.campo { display: block; margin-bottom: 14px; }
label.campo > span { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--secondario); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password], select, textarea {
  width: 100%; background: var(--nero); border: 1px solid #3a3733; color: var(--avorio); font-size: 16px; padding: 12px 13px; border-radius: 4px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--oro); }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--oro) 50%), linear-gradient(135deg, var(--oro) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.messaggio { font-size: 14px; min-height: 22px; margin: 10px 0; }
.messaggio.errore { color: var(--errore); } .messaggio.ok { color: var(--ok); }
.spunta { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.55; cursor: pointer; }
.spunta input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--oro); flex: none; }

/* ---------- accesso ---------- */
.accesso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 0%, #26221b 0%, var(--sfondo) 60%); }
.accesso .box { width: min(460px, 100%); }
.accesso .logo { width: 220px; max-width: 65%; display: block; margin: 0 auto 22px; }
.accesso h1 { text-align: center; margin-bottom: 6px; }
.accesso .sotto { text-align: center; margin-bottom: 26px; }
.schede { display: flex; border-bottom: 1px solid var(--linea); margin-bottom: 20px; }
.schede button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--secondario); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 12px 6px; cursor: pointer; }
.schede button.attiva { color: var(--oro); border-bottom-color: var(--oro); }

/* ---------- passi dell'ordine ---------- */
.passi { display: flex; gap: 6px; margin: 4px 0 24px; }
.passi div { flex: 1; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--secondario); border-top: 2px solid var(--linea); padding-top: 8px; }
.passi div.fatto { border-top-color: var(--oro-scuro); color: var(--testo); }
.passi div.attivo { border-top-color: var(--oro); color: var(--oro); }

.zona { border: 1.5px dashed #5a5448; border-radius: 10px; padding: 34px 18px; text-align: center; background: rgba(255,255,255,.02); transition: border-color .15s, background .15s; }
.zona.sopra-file { border-color: var(--oro); background: rgba(198,167,107,.07); }
.zona h3 { margin-bottom: 6px; }

.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.foto { background: var(--pannello); border: 1px solid var(--linea); border-radius: 8px; padding: 8px; position: relative; }
.foto .anteprima { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: #0b0b0b; border-radius: 4px; overflow: hidden; }
.foto .anteprima img, .foto .anteprima canvas { max-width: 100%; max-height: 100%; display: block; }
.foto .nome { font-size: 11px; color: var(--secondario); margin: 6px 2px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto .togli { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.avv { display: inline-block; font-size: 11px; background: var(--avviso); color: #1a1208; padding: 2px 8px; border-radius: 10px; margin-top: 4px; }

.elenco-foto .voce { display: grid; grid-template-columns: 110px 1fr; gap: 14px; background: var(--pannello); border: 1px solid var(--linea); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.elenco-foto .voce .anteprima { width: 110px; height: 110px; display: grid; place-items: center; background: #0b0b0b; border-radius: 4px; overflow: hidden; cursor: pointer; }
.elenco-foto .voce canvas { max-width: 100%; max-height: 100%; }
.elenco-foto .campi { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.contatore { display: inline-flex; align-items: center; border: 1px solid #3a3733; border-radius: 4px; }
.contatore button { background: none; border: 0; color: var(--oro); font-size: 20px; width: 40px; height: 40px; cursor: pointer; }
.contatore span { min-width: 34px; text-align: center; font-size: 16px; }

.scelte { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.scelta { border: 1.5px solid var(--linea); border-radius: 10px; padding: 20px; background: var(--pannello); cursor: pointer; transition: border-color .15s; }
.scelta:hover { border-color: #5a5448; }
.scelta.attiva { border-color: var(--oro); background: #1e1b15; }
.scelta .prezzo { font-family: var(--serif); font-size: 38px; color: var(--avorio); margin: 8px 0 2px; }
.scelta.non-disp { opacity: .55; cursor: default; }
.scelta ul { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--secondario); }

.tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabella td, .tabella th { padding: 9px 4px; border-bottom: 1px solid var(--linea); text-align: left; }
.tabella td:last-child, .tabella th:last-child { text-align: right; }
.tabella tr.totale td { border-bottom: 0; font-size: 20px; color: var(--avorio); font-family: var(--serif); padding-top: 14px; }
.avviso-box { border: 1px solid var(--oro-scuro); background: rgba(198,167,107,.07); border-radius: 8px; padding: 16px; font-size: 14px; line-height: 1.65; }

.avviso-ritiro { display: flex; flex-direction: column; gap: 3px; text-align: left; font-size: 13.5px; line-height: 1.5; background: rgba(198,167,107,.09); border: 1px solid rgba(198,167,107,.35); border-radius: 8px; padding: 12px 14px; margin: 0 0 18px; color: var(--testo); }
.avviso-ritiro strong { color: var(--oro); font-weight: 500; letter-spacing: .06em; font-size: 12px; text-transform: uppercase; }
.accesso .avviso-ritiro { margin-bottom: 18px; }
.barra-progresso { height: 8px; background: #2a2723; border-radius: 4px; overflow: hidden; margin: 10px 0; }
.barra-progresso div { height: 100%; width: 0; background: var(--oro); transition: width .2s; }

.stato { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 10px; border: 1px solid #555; color: var(--testo); }
.stato.nuovo, .stato.in_revisione, .stato.approvato, .stato.inviato_lab, .stato.stampato { border-color: var(--oro-scuro); color: var(--oro); }
.stato.pronto { border-color: var(--ok); color: var(--ok); }
.stato.annullato { border-color: #774; color: #aa8; }

/* ---------- finestra di ritaglio ---------- */
.velo { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 50; display: grid; place-items: center; padding: 16px; }
.finestra { background: var(--pannello); border: 1px solid var(--linea); border-radius: 10px; width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 18px; }
.area-ritaglio { background: #0b0b0b; border-radius: 6px; padding: 10px; display: grid; place-items: center; touch-action: none; }
.area-ritaglio canvas { max-width: 100%; max-height: 52vh; cursor: grab; border: 1px solid #444; }
.area-ritaglio canvas:active { cursor: grabbing; }
input[type=range] { width: 100%; accent-color: var(--oro); }
.segmenti { display: inline-flex; border: 1px solid #555; border-radius: 4px; overflow: hidden; }
.segmenti button { background: none; border: 0; color: var(--secondario); padding: 9px 14px; font-size: 12px; cursor: pointer; }
.segmenti button.attiva { background: rgba(198,167,107,.16); color: var(--oro); }

@media (max-width: 620px) {
  .scelte { grid-template-columns: 1fr; }
  .due { grid-template-columns: 1fr; }
  .elenco-foto .voce { grid-template-columns: 86px 1fr; }
  .elenco-foto .voce .anteprima { width: 86px; height: 86px; }
  .griglia { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
h1 + .avviso-ritiro, h2 + .avviso-ritiro { margin-top: 18px; }
