/* Allineato al tema app (Material light: verde success, sfondo E8F5E8) */
:root {
  --app-primary: #28a745;
  --app-primary-dark: #1e7e34;
  --app-primary-soft: #d4edda;
  --app-bg: #e8f5e8;
  --app-surface: #f8f9fa;
  --app-surface-variant: #d4edda;
  --app-outline: #dee2e6;
  --app-on-surface: #2f2f2f;
  --app-muted: #6c757d;

  --bg: var(--app-bg);
  --surface: #ffffff;
  --text: var(--app-on-surface);
  --muted: var(--app-muted);
  --brand: var(--app-primary);
  --brand-dark: var(--app-primary-dark);
  --accent: #20c997;
  --border: var(--app-outline);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(40, 167, 69, 0.08);
  --shadow-card: 0 2px 12px rgba(47, 47, 47, 0.06);
  --max: 1080px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(40, 167, 69, 0.12), transparent 55%);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  -webkit-tap-highlight-color: rgba(40, 167, 69, 0.2);
}

a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  background: linear-gradient(180deg, #ffffff 0%, var(--app-surface) 100%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(40, 167, 69, 0.06), 0 8px 32px rgba(47, 47, 47, 0.06);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--brand-dark);
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .logo-image {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.logo-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
  line-height: 1;
}

.logo-app {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}

.logo-producer-inline {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
}

.nav-main a {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0;
}
.nav-main a:hover { color: var(--brand-dark); }
.nav-main a.is-active {
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-header .logo-image {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
  }
  .logo-app {
    font-size: 0.8rem;
  }
  .logo-producer-inline {
    display: none;
  }
  .nav-main {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.25rem;
    gap: 0.5rem;
  }
  .nav-main.is-open { display: flex; }
  .header-inner { flex-wrap: wrap; }
  .nav-main a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0;
    touch-action: manipulation;
  }
  .nav-main .btn-small {
    min-height: 44px;
    justify-content: center;
  }
}

.site-main { padding: 2.5rem 0 3.5rem; }

.hero {
  background: linear-gradient(
    135deg,
    var(--app-primary-dark) 0%,
    var(--app-primary) 42%,
    #34ce57 100%
  );
  color: #ffffff;
  padding: 3rem 0 3.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.12), transparent 50%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero .wrap { max-width: var(--max); }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); margin: 0 0 0.75rem; line-height: 1.2; }
.hero p.lead { font-size: 1.15rem; opacity: 0.95; max-width: 38rem; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.hero-content {
  flex: 1 1 620px;
}
.hero-brand {
  flex: 0 0 220px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 0.75rem;
  text-align: center;
}
.hero-brand img {
  width: 100%;
  max-width: 190px;
  height: auto;
  border-radius: 10px;
  background: #fff;
  display: block;
  margin: 0 auto 0.55rem;
}
.hero-brand p {
  margin: 0;
  line-height: 1.2;
  font-size: 1rem;
  font-weight: 700;
  color: #f1faee;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
.hero-brand p span {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  opacity: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
.hero-brand-claim {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #f1faee;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  touch-action: manipulation;
  min-height: 44px;
}
.btn-primary {
  background: #ffffff;
  color: var(--app-primary-dark);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
.btn-primary:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
}
.btn-ghost {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.65);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.btn-small { padding: 0.45rem 0.85rem; font-size: 0.88rem; min-height: 40px; border-radius: var(--radius-sm); }

/* Pulsanti header: stile app (primary verde) */
.site-header .nav-main .btn-small {
  background: var(--app-primary);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(40, 167, 69, 0.25);
}
.site-header .nav-main .btn-small:hover {
  background: var(--app-primary-dark);
  color: #fff;
}
/* Store: outline come secondario (meno rumore visivo della barra) */
.site-header .nav-main .btn-nav-store {
  background: var(--surface);
  color: var(--app-primary);
  border: 1px solid var(--app-primary);
  box-shadow: none;
}
.site-header .nav-main .btn-nav-store:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

@media (min-width: 901px) {
  .btn { min-height: unset; }
  .btn-small { min-height: unset; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--app-primary);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: 0 8px 28px rgba(40, 167, 69, 0.12);
}
.card h3 { margin-top: 0; font-size: 1.1rem; color: var(--brand-dark); font-weight: 600; }
.card p { margin-bottom: 0; color: var(--muted); font-size: 0.98rem; }

.prose { max-width: 720px; }
.prose h2 { margin-top: 2rem; color: var(--brand-dark); font-size: 1.35rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }

.faq-list { margin: 2rem 0; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--brand);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-body {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.alert {
  background: var(--app-primary-soft);
  border: 1px solid rgba(40, 167, 69, 0.35);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}
.alert-error {
  background: #ffebee;
  border-color: #ef9a9a;
}

.site-footer {
  background: linear-gradient(180deg, var(--app-surface) 0%, #ffffff 100%);
  border-top: 1px solid var(--border);
  padding: 2rem 0 1rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.footer-links { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.footer-links li { margin: 0.35rem 0; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.page-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 0.5rem; color: var(--brand-dark); }
.page-lead { color: var(--muted); margin: 0 0 2rem; max-width: 640px; }

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--app-primary);
}

.prose .store-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}
.prose .store-cta .btn-primary {
  background: var(--app-primary);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(40, 167, 69, 0.35);
}
.prose .store-cta .btn-primary:hover {
  background: var(--app-primary-dark);
  color: #fff;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-dark);
}
.form-input {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
}
.form-input:focus {
  outline: 2px solid rgba(40, 167, 69, 0.45);
  outline-offset: 1px;
  border-color: var(--app-primary);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.4rem;
  text-align: left;
  vertical-align: top;
}
.data-table th {
  color: var(--muted);
  font-weight: 600;
}
.data-table .btn-small {
  min-height: 36px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .hero-layout {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-brand {
    width: 100%;
    max-width: 260px;
  }
}

.manual-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.manual-toc {
  position: sticky;
  top: 86px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.9rem 1rem;
}

.manual-toc h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--brand-dark);
}

.manual-toc ol {
  margin: 0;
  padding-left: 1.1rem;
}

.manual-toc li {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.manual-content section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--app-primary);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

.manual-content h2 {
  margin-top: 0;
}

.manual-content h3 {
  margin-bottom: 0.25rem;
}

.manual-content ul {
  margin-top: 0.35rem;
}

.manual-tip {
  margin: 0.85rem 0 0;
  padding: 0.6rem 0.75rem;
  background: var(--app-primary-soft);
  border: 1px solid rgba(40, 167, 69, 0.35);
  border-radius: var(--radius-sm);
}

@media (max-width: 980px) {
  .manual-layout {
    grid-template-columns: 1fr;
  }
  .manual-toc {
    position: static;
  }
}

/* Offerte / codici promozionali */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  margin: 0 0 0.5rem;
  align-items: stretch;
}

.promo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--app-primary);
  padding: 1.35rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.promo-card-ios {
  border-top-color: #1e7e34;
  background:
    linear-gradient(180deg, rgba(212, 237, 218, 0.55) 0%, #ffffff 42%);
}

.promo-card-android {
  border-top-color: #28a745;
  background:
    linear-gradient(180deg, rgba(232, 245, 232, 0.9) 0%, #ffffff 42%);
}

.promo-platform {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.promo-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--brand-dark);
}

.promo-card h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.promo-desc {
  margin: 0 0 1rem;
  color: var(--muted);
}

.promo-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.85rem;
}

.promo-price-old {
  font-size: 1.15rem;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.promo-price-arrow {
  color: var(--brand);
  font-weight: 700;
}

.promo-price-new {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

.promo-price-note {
  width: 100%;
  font-size: 0.9rem;
  color: var(--muted);
}

.promo-code-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  padding: 0.9rem 1rem;
  background: var(--app-primary-soft);
  border: 1px dashed rgba(40, 167, 69, 0.55);
  border-radius: var(--radius-sm);
}

.promo-code-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-dark);
}

.promo-code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  user-select: all;
  word-break: break-all;
}

.promo-steps {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.promo-steps li {
  margin: 0.45rem 0;
}

.promo-tip {
  margin: 1rem 0 0;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.promo-card .store-cta {
  margin-top: auto;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 820px) {
  .promo-grid {
    grid-template-columns: 1fr;
  }
}
