/* =========================================================
   style.css  (Cartella 1 · Web App)
   Palette ripresa dal logo: verde bosco, salvia, crema.
   Titoli: Fraunces (serif elegante) · Testi: Inter.
   ========================================================= */

:root {
  --forest: #1f3a2b;        /* verde bosco: colore principale */
  --forest-2: #2e5240;
  --sage: #a9b89f;          /* salvia */
  --sage-ink: #5d7155;      /* salvia scuro per piccole scritte */
  --sage-soft: #edf1e8;
  --sage-line: #d6dfcf;
  --cream: #f6f3ec;
  --paper: #fbfaf6;
  --ink: #1d211e;
  --text: #3d433e;
  --muted: #747a74;
  --faint: #a3a8a2;
  --line: #e7e2d7;
  --white: #ffffff;
  --alert: #a5402d;         /* rosso mattone per avvisi pelle */
  --alert-soft: #f8ece8;
  --alert-line: #ecc9c0;
  --gold: #b88a2e;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 58, 43, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-weight: 400;
  background: #e9ece6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select { font-family: inherit; color: inherit; font-size: inherit; }
button { cursor: pointer; background: none; border: none; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
h1, h2, h3, h4 { font-weight: 500; }

/* ---------- Cornice telefono (solo su computer) ---------- */
.desktop-stage {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 30% 20%, #f3f5ef 0%, #e6eae2 55%, #dde3d8 100%);
}
.phone-frame {
  width: 390px; height: 844px;
  border-radius: 54px; background: #121614; padding: 11px;
  box-shadow: 0 40px 80px rgba(20, 30, 25, 0.25), 0 0 0 2px #2a302c inset;
}
.phone-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 44px; overflow: hidden;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding-top: 30px;
  transform: translateZ(0);     /* gli elementi "fixed" restano dentro lo schermo */
}
@media (max-width: 500px) {
  body { background: var(--paper); }
  .desktop-stage { display: block; padding: 0; min-height: 100dvh; background: var(--paper); }
  .phone-frame { width: 100%; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; background: var(--paper); }
  .phone-screen { border-radius: 0; padding-top: env(safe-area-inset-top); }
  .home-indicator { display: none; }
  .bottom-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Splash ---------- */
.splash {
  position: absolute; inset: 0; z-index: 20000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--cream);
  transition: opacity .5s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
.splash img { width: 84px; height: 84px; border-radius: 22px; object-fit: cover; margin-bottom: 22px; animation: rise .8s ease both; }
.splash-name { font-family: var(--serif); font-size: 38px; font-weight: 500; color: var(--forest); letter-spacing: -0.01em; animation: rise .8s .1s ease both; }
.splash-tagline { margin-top: 8px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--sage-ink); animation: rise .8s .2s ease both; }

/* ---------- Header ---------- */
.app-header {
  height: 52px; flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid rgba(231, 226, 215, .7);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }
.brand span { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--forest); letter-spacing: -0.01em; }
.header-controls { display: flex; gap: 6px; align-items: center; }
.mini-select {
  appearance: none; -webkit-appearance: none;
  height: 28px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--white);
  font-size: 11px; font-weight: 500; color: var(--text); text-align: center; text-align-last: center; cursor: pointer;
}
.premium-btn { width: 30px; height: 30px; border-radius: 9px; background: var(--sage-soft); color: var(--forest); display: flex; align-items: center; justify-content: center; }

/* ---------- Area scorrevole ---------- */
.app-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; scroll-behavior: auto; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; font-size: 14px; font-weight: 500; letter-spacing: .01em;
  white-space: nowrap; transition: transform .12s ease, background .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--forest); color: var(--cream); height: 50px; padding: 0 22px; box-shadow: 0 8px 20px rgba(31, 58, 43, .18); }
.btn-primary:hover { background: var(--forest-2); }
.btn-primary[disabled] { opacity: .65; }
.btn-secondary { background: var(--white); color: var(--forest); border: 1px solid var(--line); height: 46px; padding: 0 18px; }
.btn-soft { background: var(--sage-soft); color: var(--forest); height: 46px; padding: 0 18px; }
.btn-text { color: var(--sage-ink); font-size: 13px; font-weight: 500; padding: 8px; }
.btn-icon { width: 38px; height: 38px; border-radius: 12px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--sage-soft); }
.w-full { width: 100%; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  flex-shrink: 0;
  display: grid; grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr; align-items: center;
  background: var(--paper);
  border-top: 1px solid rgba(231, 226, 215, .8);
  padding: 6px 6px 22px;
  position: relative; z-index: 20;
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 46px; color: var(--faint); font-size: 10px; font-weight: 500; letter-spacing: .02em;
}
.nav-item.active { color: var(--forest); }
.nav-dot { display: none; position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--forest); }
.nav-item.active .nav-dot { display: block; }
.scan-fab-wrap { display: flex; justify-content: center; }
.scan-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--forest); color: var(--cream);
  border: 4px solid var(--paper);
  box-shadow: 0 8px 18px rgba(31, 58, 43, .25);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.scan-fab.active { transform: scale(1.06); background: var(--forest-2); }
.home-indicator { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 124px; height: 4px; border-radius: 4px; background: var(--ink); opacity: .8; z-index: 30; pointer-events: none; }

/* ---------- Titoli di pagina (centrati) ---------- */
.page { padding: 26px 20px 32px; }
.page-head { text-align: center; margin-bottom: 18px; }
.eyebrow { display: block; font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--sage-ink); margin-bottom: 6px; }
.page-title { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); line-height: 1.1; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.section-title { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink); text-align: center; }
.section-sub { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.45; }
.config-warning { margin: 12px 20px 0; background: #fbf5e6; border: 1px solid #ecdcae; color: #7a5a14; border-radius: 12px; padding: 10px 12px; font-size: 11.5px; line-height: 1.4; }

/* ---------- Home ---------- */
.home-intro { padding: 24px 24px 18px; text-align: center; }
.home-title { font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.15; color: var(--ink); letter-spacing: -0.01em; }
.home-title em { font-style: italic; color: var(--forest-2); }
.home-text { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.5; }

.camera-view {
  position: relative; margin: 0 20px; height: 320px;
  border-radius: 26px; overflow: hidden; background: #0d110f; cursor: pointer;
  box-shadow: 0 18px 40px rgba(20, 30, 25, .18);
}
.camera-view > img, .camera-view .cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-video.mirrored { transform: scaleX(-1); }
.camera-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.32) 0%, rgba(0,0,0,.04) 38%, rgba(0,0,0,.42) 100%); pointer-events: none; }
.camera-label {
  position: absolute; top: 16px; left: 16px; z-index: 5;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font-size: 9.5px; font-weight: 500; letter-spacing: .22em;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #d8f0cf; box-shadow: 0 0 0 3px rgba(216,240,207,.25); animation: pulse 2s ease-in-out infinite; }
.cam-tools { position: absolute; top: 14px; right: 14px; z-index: 6; display: flex; flex-direction: column; gap: 10px; }
.cam-tool {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.cam-tool.on { color: #f6d77a; border-color: rgba(246,215,122,.6); }
.scan-target { position: absolute; top: 50%; left: 50%; width: 70%; height: 50%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none; }
.scan-target i { position: absolute; width: 24px; height: 24px; border: 2px solid rgba(255,255,255,.95); filter: drop-shadow(0 0 6px rgba(255,255,255,.45)); }
.scan-target i:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; border-top-left-radius: 12px; }
.scan-target i:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; border-top-right-radius: 12px; }
.scan-target i:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; border-bottom-left-radius: 12px; }
.scan-target i:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; border-bottom-right-radius: 12px; }
.scan-laser {
  position: absolute; left: 8%; right: 8%; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  box-shadow: 0 0 14px rgba(255,255,255,.55);
  animation: laser 4.2s cubic-bezier(.45,0,.55,1) infinite;
}
.camera-caption {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px; border-radius: 14px;
  background: rgba(15,20,17,.38); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font-size: 12px; font-weight: 400; text-align: center; line-height: 1.35;
}
.camera-caption.error { color: #ffd9cf; }
.scan-busy {
  position: absolute; inset: 0; z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(246,243,236,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--forest); font-size: 13px; text-align: center; padding: 24px;
  animation: fade .3s ease both;
}
.scan-busy img { width: 54px; height: 54px; border-radius: 15px; object-fit: cover; animation: breathe 1.6s ease-in-out infinite; }

.home-actions { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 6px; }
.btn-dashed { height: 48px; border-radius: 14px; border: 1.5px dashed var(--sage); background: var(--sage-soft); color: var(--forest); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; }

.shop-teaser { margin: 18px 20px 24px; padding: 22px 18px 18px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--line); text-align: center; cursor: pointer; }
.teaser-item { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 10px 12px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); text-align: left; }
.teaser-item img { width: 42px; height: 54px; border-radius: 8px; object-fit: cover; }
.teaser-item strong { display: block; font-size: 13px; font-weight: 500; color: var(--ink); }
.teaser-item span { font-size: 11.5px; color: var(--sage-ink); }

/* ---------- Spinner ---------- */
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- Chip / pill ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white);
  font-size: 12px; font-weight: 400; color: var(--text);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip.on { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.chip.alert.on { background: var(--alert); border-color: var(--alert); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-flex; align-items: center; justify-content: center; }
.swatch.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--forest); }
.tag-pro { font-size: 9px; font-weight: 600; letter-spacing: .12em; padding: 3px 7px; border-radius: 6px; background: var(--sage-soft); color: var(--forest); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Pannelli a fisarmonica (filtri, profilo) ---------- */
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--white); overflow: hidden; }
.panel + .panel { margin-top: 10px; }
.panel-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; font-size: 13.5px; font-weight: 500; color: var(--ink); text-align: left; }
.panel-head span.lbl { display: flex; align-items: center; gap: 9px; }
.panel-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.field-label { display: block; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-ink); margin: 10px 0 8px; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Griglia prodotti ---------- */
.filters { padding: 0 20px; margin-bottom: 18px; }
.match-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 0 20px; margin-bottom: 12px; }
.match-heading h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.match-heading span { font-size: 12px; color: var(--muted); }
.filter-empty { padding: 18px 20px; font-size: 12.5px; color: var(--muted); text-align: center; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; padding: 0 20px; }
.card { position: relative; }
.card-open { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; color: var(--ink); }
.card-img { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--cream); margin-bottom: 8px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-score { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--forest); font-size: 10.5px; font-weight: 500; }
.card-brand { font-size: 9.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--ink); }
.card-fiber { font-size: 10.5px; color: var(--sage-ink); letter-spacing: .04em; }
.card-price { font-size: 13.5px; font-weight: 500; margin-top: 3px; color: var(--ink); }
.card-save { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.card-save.on { background: var(--forest); color: var(--cream); }

/* ---------- Cronologia ---------- */
.list-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; min-height: 34px; }
.list-toolbar .btn-text { padding: 6px 4px; }
.history-item {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px; margin-bottom: 10px; border-radius: 16px;
  background: var(--white); border: 1px solid var(--line); text-align: left;
}
.history-item.selected { border-color: var(--forest); background: var(--sage-soft); }
.history-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sage); display: flex; align-items: center; justify-content: center; color: var(--cream); }
.history-item.selected .history-check { background: var(--forest); border-color: var(--forest); }
.history-thumb { width: 44px; height: 44px; border-radius: 12px; background: var(--sage-soft); color: var(--forest); display: flex; align-items: center; justify-content: center; }
.history-item .meta { min-width: 0; }
.history-item strong { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.history-item .meta span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mini-score { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.select-bar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 0 4px; background: linear-gradient(180deg, rgba(251,250,246,0), var(--paper) 30%); }
.select-bar .btn { flex: 1; height: 44px; }
.btn-danger { background: var(--alert); color: #fff; }
.btn-danger[disabled] { opacity: .45; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 48px 16px; color: var(--sage); }
.empty-state h3 { font-family: var(--serif); color: var(--ink); font-size: 19px; font-weight: 500; }
.empty-state p { font-size: 12.5px; color: var(--muted); max-width: 260px; line-height: 1.5; margin-bottom: 6px; }

/* ---------- Report ---------- */
.result-heading { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: rgba(251,250,246,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.result-heading h2 { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.alert-box { margin: 16px 20px 0; padding: 14px; border-radius: 16px; background: var(--alert-soft); border: 1px solid var(--alert-line); color: var(--alert); display: flex; gap: 12px; align-items: flex-start; }
.alert-box strong { display: block; font-size: 13px; font-weight: 600; }
.alert-box p { font-size: 12px; margin-top: 3px; line-height: 1.4; }
.score-hero { padding: 26px 20px 8px; text-align: center; }
.score-ring { position: relative; width: 148px; height: 148px; margin: 10px auto 8px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .num strong { font-family: var(--serif); font-size: 46px; font-weight: 500; line-height: 1; }
.score-ring .num span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.score-label { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.how-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--sage-ink); text-decoration: underline; text-underline-offset: 3px; }
.how-box { margin: 10px auto 0; max-width: 320px; font-size: 12px; color: var(--muted); line-height: 1.5; background: var(--cream); border-radius: 12px; padding: 12px 14px; text-align: left; }
.composition { margin: 20px 20px 0; }
.composition-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 4px; }
.composition-pills span { padding: 6px 12px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.composition-pills span.bad { background: var(--alert-soft); border-color: var(--alert-line); color: var(--alert); }
.composition-pills span.unknown { color: var(--muted); border-style: dashed; }
.edit-link { display: block; margin: 6px auto 0; font-size: 12px; color: var(--sage-ink); text-decoration: underline; text-underline-offset: 3px; }
.fiber-card { margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--white); border: 1px solid var(--line); }
.fiber-card.bad { border-color: var(--alert-line); }
.fiber-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.fiber-head strong { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.fiber-head .pct { color: var(--muted); font-family: var(--sans); font-size: 13px; margin-right: 6px; }
.badge { font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.impact { display: flex; gap: 10px; padding: 10px 0 0; }
.impact + .impact { border-top: 1px dashed var(--line); margin-top: 10px; }
.impact-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.impact-icon.skin { background: #f6ece4; color: #9a5b3c; }
.impact-icon.env { background: var(--sage-soft); color: var(--forest); }
.impact b { display: block; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 3px; }
.impact.skin b { color: #9a5b3c; }
.impact.env b { color: var(--sage-ink); }
.impact p { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.alt-section { margin-top: 30px; padding: 28px 0 8px; background: var(--cream); }
.alt-section .product-grid { margin-top: 18px; }
.alt-cta { padding: 20px 20px 4px; }

/* ---------- Profilo ---------- */
.avatar { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; background: var(--sage-soft); color: var(--forest); display: flex; align-items: center; justify-content: center; border: 1px solid var(--sage-line); }
.form { display: flex; flex-direction: column; gap: 8px; }
.input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 13.5px; }
.input:focus { outline: none; border-color: var(--sage); background: var(--white); }
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; min-width: 0; }
.select { width: 100%; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); font-size: 13px; }
.link-row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); text-align: left; }
.link-row:last-child { border-bottom: none; }
.link-row span { display: flex; align-items: center; gap: 10px; }
.link-row.danger { color: var(--alert); }
.socials { display: flex; gap: 10px; justify-content: center; }
.social-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--forest); display: flex; align-items: center; justify-content: center; }
.btn-apple { height: 46px; border-radius: 12px; background: #000; color: #fff; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-google { height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; }
.or { text-align: center; font-size: 11px; color: var(--faint); margin: 4px 0; }

/* ---------- Finestre sovrapposte ---------- */
.sheet { position: fixed; inset: 0; z-index: 9000; background: var(--paper); overflow-y: auto; animation: slideUp .3s ease; display: flex; flex-direction: column; }
.sheet-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 14px 56px; min-height: 56px; background: rgba(251,250,246,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; text-align: center; }
.sheet-head .btn-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.sheet-body { padding: 20px; flex: 1; }

/* Dettaglio prodotto */
.product-hero { width: 100%; aspect-ratio: 4 / 5; max-height: 440px; object-fit: cover; background: var(--cream); }
.product-info { padding: 22px 20px 30px; text-align: center; }
.product-info h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; margin-top: 2px; }
.product-info .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.product-info .fiber-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--sage-soft); color: var(--forest); font-size: 12px; }
.product-info .price { font-family: var(--serif); font-size: 26px; margin-top: 18px; }
.variant-block { margin-top: 18px; }
.variant-block .chips { justify-content: center; }
.affiliate-note { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-align: center; margin-top: 10px; }

/* Inserimento manuale */
.manual-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.combo { position: relative; flex: 2.4; min-width: 0; }
.combo .input { padding-right: 38px; }
.combo-toggle { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 236px; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: none; padding: 4px; }
.combo-list.open { display: block; }
.combo-option { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--ink); }
.combo-option:hover, .combo-option.active { background: var(--sage-soft); }
.combo-option small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.combo-empty { padding: 10px 12px; font-size: 12.5px; color: var(--muted); }
.pct-input { flex: 1; min-width: 0; text-align: center; }
.row-del { width: 36px; height: 36px; border-radius: 10px; color: var(--alert); display: flex; align-items: center; justify-content: center; }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.4; }
.notice.error { background: var(--alert-soft); border: 1px solid var(--alert-line); color: var(--alert); }
.notice.info { background: var(--sage-soft); border: 1px solid var(--sage-line); color: var(--forest); }

/* Guida ai tessuti */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--cream); border: 1px solid var(--line); }
.segmented button { flex: 1; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); transition: all .2s ease; }
.segmented button.on { background: var(--white); color: var(--forest); box-shadow: 0 2px 8px rgba(31,58,43,.08); }
.search { position: relative; margin-top: 12px; }
.search .input { padding-left: 40px; background: var(--white); }
.search i, .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.guide-intro { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.45; margin: 14px 8px 4px; }
.guide-filter { margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--cream); border: 1px solid var(--line); }
.guide-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.guide-filter-head strong { font-size: 13px; font-weight: 500; }
.guide-count { font-size: 12px; color: var(--forest); margin-top: 10px; }
.fabric-item { margin-top: 10px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.fabric-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; text-align: left; }
.fabric-toggle .name { flex: 1; min-width: 0; }
.fabric-toggle .name strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 500; color: var(--ink); }
.fabric-toggle .name span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.fabric-toggle .chev { color: var(--faint); transition: transform .2s ease; }
.fabric-item.open .chev { transform: rotate(180deg); }
.fabric-body { display: none; padding: 0 16px 16px; }
.fabric-item.open .fabric-body { display: block; animation: fade .25s ease; }
.fabric-section { padding-top: 12px; }
.fabric-section + .fabric-section { border-top: 1px dashed var(--line); margin-top: 12px; }
.fabric-section b { display: block; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-ink); margin-bottom: 4px; }
.fabric-section p { font-size: 13px; line-height: 1.55; color: var(--text); }
.fit-line { font-size: 11.5px; margin-top: 10px; line-height: 1.4; }
.fit-line.good { color: var(--forest); }
.fit-line.bad { color: var(--alert); }

/* Abbonamento */
.paywall { position: fixed; inset: 0; z-index: 10050; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 45%); animation: slideUp .3s ease; }
.paywall-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
.paywall-top .brand span { font-size: 18px; }
.paywall-scroll { flex: 1; overflow-y: auto; padding: 4px 22px 30px; text-align: center; }
.paywall-logo { width: 78px; height: 78px; border-radius: 22px; object-fit: cover; margin: 6px auto 16px; box-shadow: var(--shadow); }
.paywall-title { font-family: var(--serif); font-size: 27px; font-weight: 500; line-height: 1.15; margin: 6px 0 8px; }
.paywall-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.trial-cta { width: 100%; margin: 20px 0 6px; padding: 16px; border-radius: 18px; background: var(--forest); color: var(--cream); text-align: center; box-shadow: 0 12px 26px rgba(31,58,43,.22); }
.trial-cta strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.trial-cta span { display: block; font-size: 11.5px; color: rgba(246,243,236,.75); margin-top: 4px; }
.benefits { list-style: none; text-align: left; margin: 22px 0 6px; display: flex; flex-direction: column; gap: 14px; }
.benefits li { display: flex; gap: 12px; align-items: flex-start; }
.benefits .b-icon { width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0; background: var(--sage-soft); color: var(--forest); display: flex; align-items: center; justify-content: center; }
.benefits strong { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.benefits p { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.plans-title { font-family: var(--serif); font-size: 19px; font-weight: 500; text-align: center; margin: 24px 0 12px; }
.plan { position: relative; width: 100%; display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 16px; margin-bottom: 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--white); text-align: left; }
.plan.on { border-color: var(--forest); background: var(--sage-soft); }
.plan-radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--sage); display: flex; align-items: center; justify-content: center; }
.plan.on .plan-radio { border-color: var(--forest); }
.plan-radio span { width: 10px; height: 10px; border-radius: 50%; background: var(--forest); }
.plan strong { display: block; font-size: 14px; font-weight: 500; }
.plan small { font-size: 11.5px; color: var(--muted); }
.plan .price { text-align: right; }
.plan .price strong { font-family: var(--serif); font-size: 19px; }
.plan .save { position: absolute; top: -10px; right: 16px; padding: 3px 9px; border-radius: 999px; background: var(--forest); color: var(--cream); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; }
.paywall-fine { font-size: 10.5px; color: var(--faint); margin-top: 10px; line-height: 1.45; }
.paywall-links { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.paywall-links a, .paywall-links button { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* Torna su */
.scroll-top {
  position: absolute; right: 18px; bottom: 98px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--forest); color: var(--cream);
  box-shadow: 0 8px 18px rgba(31,58,43,.28);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.scroll-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Animazioni ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes laser { 0% { top: 6%; opacity: .2; } 12% { opacity: 1; } 50% { top: 92%; opacity: 1; } 62% { opacity: 1; } 100% { top: 6%; opacity: .2; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* =========================================================
   v4 — fotocamera nativa, foto, codici a barre, armadio, lavaggio
   ========================================================= */

/* Nell'app la pagina è trasparente: lo sfondo crema lo disegna l'app,
   e nel riquadro della fotocamera si vede la fotocamera vera del telefono */
html.in-app body,
html.in-app .desktop-stage,
html.in-app .phone-frame,
html.in-app .phone-screen { background: transparent !important; }
.camera-view.native-live { background: transparent; }
html.in-app .camera-view { height: clamp(280px, 46vh, 430px); }

.cam-toast {
  position: absolute; left: 14px; right: 14px; top: 58px; z-index: 6;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(251,250,246,.92); color: var(--forest);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 12px; line-height: 1.4; animation: fade .3s ease both;
  box-shadow: 0 8px 24px rgba(20,30,25,.18);
}
.cam-toast svg { margin-top: 1px; }
.barcode-hint { margin: 10px 28px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.barcode-hint svg { display: inline-block; vertical-align: -2px; margin-right: 5px; }

.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-row .btn-dashed { padding: 0 10px; font-size: 13px; cursor: pointer; }

/* Risultato: certificazioni, provenienza, lavaggio */
.result-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.cert-tag, .origin-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 12px; }
.cert-tag { background: var(--sage-soft); color: var(--forest); border: 1px solid var(--sage-line); font-weight: 500; }
.origin-tag { background: var(--cream); color: var(--text); border: 1px solid var(--line); }
.care-card .fiber-head strong { display: inline-flex; align-items: center; gap: 7px; }
.care-line { font-size: 12.5px; color: var(--text); line-height: 1.55; margin-top: 10px; }
.care-line + .care-line { border-top: 1px dashed var(--line); padding-top: 10px; }
.care-card .edit-link { margin-top: 12px; }

/* Guida: simboli di lavaggio */
.wash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.wash-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); font-size: 12px; line-height: 1.35; color: var(--text); }
.wash-svg { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--cream); color: var(--forest); display: flex; align-items: center; justify-content: center; }
.guide-subtitle { font-family: var(--serif); font-size: 18px; font-weight: 500; text-align: center; margin: 26px 0 12px; color: var(--ink); }
.care-group { padding: 14px 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); margin-bottom: 8px; }
.care-group b { display: block; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-ink); margin-bottom: 5px; }
.care-group p { font-size: 12.5px; line-height: 1.55; color: var(--text); }
.segmented button { min-width: 0; padding: 0 6px; }

/* Armadio */
.wardrobe-summary { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 20px; background: var(--white); border: 1px solid var(--line); margin-bottom: 12px; }
.wardrobe-summary strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 4px 0 2px; }
.wardrobe-summary p { font-size: 12px; color: var(--muted); }
.score-ring.small { width: 84px; height: 84px; margin: 0; flex-shrink: 0; }
.score-ring.small .num strong { font-size: 26px; }
.score-ring.small .num span { font-size: 9px; }
.wardrobe-item { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.wardrobe-open { flex: 1; min-width: 0; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; text-align: left; }
.small-sheet .sheet-body { max-width: 520px; margin: 0 auto; width: 100%; }

/* Eco Shop: spiegazione acquisto */
.buy-explain { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.45; margin-top: 6px; }

/* "oppure" tra la fotocamera e le alternative */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 2px 4px; color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
label.btn-dashed { cursor: pointer; }
.guide-btn { margin-top: 8px; }

/* anello di messa a fuoco al tocco */
.focus-ring { position: absolute; z-index: 6; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 1.5px solid rgba(255,255,255,.95); border-radius: 50%; pointer-events: none; animation: focusRing .9s ease forwards; box-shadow: 0 0 12px rgba(255,255,255,.4); }
@keyframes focusRing { 0% { transform: scale(1.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }
