/* restinomain — tema "smeraldo e oro"
   Layout: colonna centrale stretta per i testi, griglie larghe per prodotti e passioni.
   Tema scuro per scelta: un solo set di colori. */
:root {
  --bg: #0b1612;          /* verde quasi nero */
  --surface: #11221b;     /* pannelli */
  --surface-2: #173027;   /* pannelli in evidenza */
  --line: #24423a;        /* bordi */
  --ink: #f2ead6;         /* avorio caldo */
  --muted: #a3b2a3;       /* testo secondario */
  --emerald: #2fa36f;     /* verde vivo */
  --gold: #d6ad52;        /* oro */
  --gold-ink: #1a1305;    /* testo su oro */
  --red: #e0533f;         /* accento rosso, con parsimonia */
  --ok: #57c48a;
  --err: #ff7a66;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 163, 111, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(214, 173, 82, .08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
}
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
section[id], [id].tendina { scroll-margin-top: 84px; }   /* link con #…: il titolo non finisce sotto la barra */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 16px 64px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.05; margin: 0 0 12px; }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.15; margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}

/* ---------- barra in alto ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(11, 22, 18, .82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; display: block; }
.topbar nav { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.topbar nav a, .linklike {
  color: var(--muted); text-decoration: none; padding: 7px 11px; border-radius: 999px; font-size: .93rem; white-space: nowrap;
}
.topbar nav a:hover, .linklike:hover { color: var(--ink); }
.topbar nav a.active { color: var(--ink); background: var(--surface-2); }
.topbar nav a.pill { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; }
.esci { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 4px; border-radius: 50%; cursor: pointer;
  background: #c0392b; border: 0; color: #fff; }
.esci:hover { background: #e0533f; }
.esci svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar nav a.bell { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; margin-left: 4px;
  border-radius: 50%; background: var(--gold); color: var(--gold-ink); }   /* campanella dorata, come il rosso di «Esci» */
.topbar nav a.bell:hover, .topbar nav a.bell.active { background: #e6c46e; color: var(--gold-ink); }
.topbar nav a.casa { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; margin-left: 4px;
  border-radius: 50%; background: var(--emerald); color: #fff; }   /* casa verde: torna alla home */
.topbar nav a.casa:hover, .topbar nav a.casa.active { background: #3fbf85; color: #fff; }
.casa svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell-badge { position: absolute; top: -4px; right: -4px; border: 2px solid var(--bg); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; line-height: 13px; text-align: center; }
.bell.squilla svg { animation: squilla .7s ease; transform-origin: 50% 10%; }
@keyframes squilla { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 45% { transform: rotate(-13deg); } 70% { transform: rotate(7deg); } }
.toast { position: fixed; z-index: 50; left: 50%; top: 84px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px));
  padding: 16px 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--gold); color: var(--ink);
  font-weight: 700; text-align: center; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: toast-in .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.via { opacity: 0; transform: translate(-50%, -12px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.inline { display: inline; margin: 0; }
/* pulsanti-filtro a pillola (filtri per persona, scorciatoie) */
.pillole { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; scrollbar-width: none; }
.pillole a { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); text-decoration: none; font-size: .88rem; white-space: nowrap; }
.pillole a.attivo { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); font-weight: 700; }
.pillole a span { opacity: .7; margin-left: 4px; }
/* menu laterale ☰ (solo per chi ha fatto l'accesso) */
.menu-btn { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; margin-right: -4px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.menu-btn:hover { border-color: var(--gold); }
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.topbar .brand { margin-right: auto; }
.laterale { margin: 0; inset: 0 auto 0 0; width: min(320px, 86vw); max-width: none; height: 100dvh; max-height: none; padding: 0;
  border: 0; border-right: 1px solid var(--gold); background: var(--bg); color: var(--ink); box-shadow: 20px 0 60px rgba(0, 0, 0, .55); }
.laterale[open] { display: flex; flex-direction: column; animation: entra-sx .22s ease-out; }
.laterale::backdrop { background: rgba(5, 12, 9, .7); backdrop-filter: blur(2px); }
@keyframes entra-sx { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.laterale-testa { display: flex; align-items: center; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 14px 16px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.laterale-testa img { border-radius: 50%; flex: none; }
.laterale-testa > span { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.laterale-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.laterale-x:hover { color: var(--ink); border-color: var(--gold); }
.laterale-voci { display: grid; gap: 8px; padding: 16px 12px; }
.laterale-voci a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); }
.laterale-voci a:hover, .laterale-voci a.active { border-color: var(--gold); background: var(--surface-2); }
.laterale-voci a > span:last-child { display: grid; line-height: 1.3; }
.laterale-ic { font-size: 1.5rem; flex: none; }
.laterale-voci:empty { display: none; }
.laterale-fondo { margin: 4px 12px 0; padding: 18px 0 0; border-top: 1px solid var(--line); }
@media (max-width: 520px) {
  .brand .brand-name { display: none; }
  .topbar nav a, .linklike { padding: 6px 8px; font-size: .88rem; }
}
@media (max-width: 420px) {   /* telefono: con la campanella lo spazio è poco */
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar nav a, .linklike { padding: 6px 6px; font-size: .84rem; }
}

/* ---------- home ---------- */
.hero {
  display: grid; gap: 28px; align-items: center; padding: 24px 0 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .hero { grid-template-columns: 300px 1fr; gap: 48px; padding: 48px 0 56px; } }
.portrait {
  position: relative; width: min(240px, 70vw); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  padding: 6px; background: conic-gradient(from 210deg, var(--gold), #f3dc9b, var(--emerald), var(--gold));
  box-shadow: var(--shadow);
}
@media (min-width: 760px) { .portrait { width: 280px; } }
.portrait-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center;
}
.portrait-inner img { width: 100%; height: 100%; object-fit: cover; }
.portrait-inner .mono { font-family: var(--font-display); font-size: clamp(3.5rem, 14vw, 5rem); color: var(--gold); }
.hero-text { text-align: center; }
@media (min-width: 760px) { .hero-text { text-align: left; } }
.hero-text h1 em { font-style: italic; color: var(--gold); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; margin: 0 auto 22px; }
@media (min-width: 760px) { .lead { margin-left: 0; } }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 760px) { .hero-links { justify-content: flex-start; } }

.btn, .social-btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 18px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.btn { background: var(--gold); color: var(--gold-ink); }
.btn:hover { filter: brightness(1.07); }
.btn.ghost, .social-btn { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover, .social-btn:hover { border-color: var(--gold); }
.btn.danger { background: transparent; color: var(--err); border-color: currentColor; }
.social-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.social-btn svg .fill { fill: currentColor; stroke: none; }

.section { padding: 28px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { margin: 4px 0 0; }

.passions { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .passions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.passion {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: grid; gap: 8px; align-content: start;
}
.passion svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.passion h3 { font-size: 1.1rem; margin: 2px 0 0; }
.passion p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- account ---------- */
.auth {
  max-width: 440px; margin: 24px auto; padding: 28px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.auth h1 { font-size: 2rem; }
.form { display: grid; gap: 14px; margin: 16px 0; }
.form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.flash.ok { border-color: var(--ok); }
.flash.error { border-color: var(--err); color: var(--err); }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 32px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.tile-k { font-size: .8rem; color: var(--muted); }
.admin { border-top: 1px solid var(--line); padding-top: 24px; }
.form.add { grid-template-columns: 1fr; align-items: end; }
@media (min-width: 720px) { .form.add { grid-template-columns: 1fr 200px auto; } }
.admin-list { display: grid; gap: 8px; margin-top: 16px; }
.warn { color: var(--red); font-weight: 800; }
.form.compact { padding: 0 14px 14px; margin: 0; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form.compact { grid-template-columns: 1fr 1fr; } .form.compact .grow, .form.compact .actions { grid-column: 1 / -1; } }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- piè di pagina ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 22px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.footer .social { display: flex; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--gold); }

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

/* ---------- sfondo dinamico ---------- */
.bg-layer {
  --fade: .78;
  position: fixed; inset: -8vh 0; z-index: -1; overflow: hidden; pointer-events: none;
  will-change: transform;
}
.bg-img {
  position: absolute; inset: 0; background-size: cover; background-position: center 35%;
  filter: saturate(.55) brightness(.75);
  animation: bg-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}
.bg-layer::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1000px 600px at 80% 0%, rgba(47, 163, 111, .22), transparent 60%),
    radial-gradient(800px 500px at 0% 20%, rgba(214, 173, 82, .12), transparent 60%),
    linear-gradient(180deg, rgba(11, 22, 18, calc(var(--fade) - .1)), rgba(11, 22, 18, var(--fade)) 45%, rgba(11, 22, 18, calc(var(--fade) + .06)));
}
@keyframes bg-drift {
  0%   { transform: scale(1.08) translate(0, 0); }
  50%  { transform: scale(1.16) translate(-2%, 1.5%); }
  100% { transform: scale(1.12) translate(2%, -1%); }
}
body { background: var(--bg); }
@media (prefers-reduced-motion: reduce) { .bg-img { animation: none; transform: scale(1.08); } }

/* ---------- riquadro MainWishList in evidenza ---------- */
.passion-wish {
  position: relative; text-decoration: none; color: var(--ink); isolation: isolate;
  border: 2px solid transparent;
  background:
    linear-gradient(160deg, rgba(214, 173, 82, .20), rgba(47, 163, 111, .08) 60%, rgba(0, 0, 0, 0)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(140deg, #f3dc9b, var(--gold) 40%, var(--red) 75%, var(--gold)) border-box;
  box-shadow: 0 0 0 1px rgba(214, 173, 82, .25), 0 12px 34px rgba(214, 173, 82, .18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.passion-wish:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(214, 173, 82, .5), 0 18px 44px rgba(214, 173, 82, .3); }
.passion-wish::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 180, .14) 45%, transparent 60%);
  background-size: 250% 100%; animation: wish-shine 4.5s ease-in-out infinite;
}
@keyframes wish-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }
.passion-wish h3 { color: var(--gold); font-size: 1.25rem; }
.passion-wish p { color: var(--ink); opacity: .85; }
.passion-wish svg { stroke: var(--gold); width: 34px; height: 34px; }
.passion-wish .passion-link { color: var(--gold); }
.wish-badge {
  position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) { .passion-wish::after { animation: none; } }

/* ---------- niente contenuti che sbordano ---------- */
.admin-list > *, .grid > *, .dash-grid > *, .tiles > *, .form > *, .copy-row > * { min-width: 0; }
.admin-list, .prod-item, .panel { max-width: 100%; }
input, select { max-width: 100%; }
.thumb img.centered { padding: 0; object-fit: cover; }

/* pagina Privacy */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; }

/* iPhone: i campi data hanno una larghezza minima propria e uscivano dal riquadro */
.two > *, .upload-fields > * { min-width: 0; }
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; min-height: 2.8em; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }

/* riquadro "in arrivo" della home (non cliccabile) */
.passion.spenta { opacity: .5; cursor: not-allowed; filter: grayscale(.5); }
.passion.spenta:hover { transform: none; }
a.passion.spenta { cursor: pointer; }
.passion-emoji { font-size: 1.8rem; line-height: 1; }
.progetti-vuoto { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 48px 20px; border: 1px dashed var(--line);
  border-radius: var(--radius); background: var(--surface); }
.progetti-vuoto svg { width: 46px; height: 46px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.progetti-vuoto h2 { margin: 6px 0 0; }
.sezione-chiusa { display: grid; justify-items: center; gap: 10px; text-align: center; max-width: 560px; margin: 40px auto; padding: 40px 24px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.sezione-chiusa svg { width: 52px; height: 52px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sezione-chiusa h1 { margin: 0; }
.sezione-chiusa .lead { margin: 0 0 8px; white-space: pre-line; }
.conto { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 420px; margin: 6px 0 2px; }
.conto-box { display: grid; gap: 2px; justify-items: center; padding: 14px 4px 10px; border-radius: 16px; background: var(--surface-2);
  border: 1px solid var(--gold); box-shadow: inset 0 0 24px rgba(214, 173, 82, .08); }
.conto-box strong { font-family: var(--font-display); font-size: clamp(1.7rem, 8vw, 2.6rem); line-height: 1; color: var(--gold);
  font-variant-numeric: tabular-nums; }
.conto-box span { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.conto-quando { margin: 0 0 8px; }
.conto-quando::first-letter { text-transform: uppercase; }
.passion-soon-tag { margin-top: 4px; align-self: start; justify-self: start; font-size: .75rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 10px; }

/* i tre social sempre affiancati, su telefono e computer: si stringono invece di andare a capo */
.hero-links { display: flex; flex-wrap: nowrap; gap: 8px; }
.hero-links .social-btn { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
@media (max-width: 400px) { .hero-links .social-btn { font-size: .85rem; gap: 5px; padding-left: 6px; padding-right: 6px; } }
@media (min-width: 760px) { .hero-links .social-btn { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; } }
.footer .social { flex-wrap: nowrap; gap: 12px; }
