/* ============================================================================
   BonificoSubito.it — foglio di stile condiviso
   Caricato da TUTTE le pagine. Il CSS specifico dell'app (UI della home)
   resta inline in index.html.
   Due varianti di larghezza via --content-width: default 860px; .subpage 760px.
   ============================================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  --blue-50:#e8f4fd; --blue-100:#c3e0f9; --blue-200:#90c5f4; --blue-400:#3a9de8;
  --blue-500:#1a80d0; --blue-600:#1266b0; --blue-700:#0d4f8a; --blue-800:#093b68;
  --slate-50:#f5f8fc; --slate-100:#e8edf5; --slate-200:#d0d8e6; --slate-400:#8896b0;
  --slate-600:#4a5870; --slate-800:#1e2c42;
  --radius-sm:8px; --radius-md:12px; --radius-lg:18px; --radius-xl:24px;
  --content-width:860px;
}
body.subpage { --content-width:760px; }

html { scroll-behavior: smooth; }
body { font-family:'DM Sans',sans-serif; background:linear-gradient(160deg,var(--blue-50) 0%,#f0f7ff 40%,#fafcff 100%); min-height:100vh; color:var(--slate-800); line-height:1.6; }

/* ── Header ── */
header { padding: 0 24px; background: rgba(255,255,255,0.75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(26,128,208,0.12); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: var(--content-width); margin: 0 auto; display: flex; align-items: center; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 34px; height: 34px; background: var(--blue-500); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg { width: 18px; height: 18px; fill: white; }
.logo-text { font-size: 17px; font-weight: 600; color: var(--blue-700); letter-spacing: -0.3px; }
.logo-text span { color: var(--blue-400); }

/* ── Quick-nav (link rapidi a Home / Verifica IBAN / Genera QR / Blog) ── */
.quick-nav { max-width: var(--content-width); margin: 0 auto; display: flex; gap: 8px; padding: 0 0 10px; flex-wrap: wrap; }
.quick-nav a { font-size: 13px; font-weight: 500; color: var(--blue-600); background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius-md); padding: 6px 14px; text-decoration: none; transition: background .15s, color .15s; }
.quick-nav a:hover { background: var(--blue-100); }

/* ── Header menu (iniettato da /menu.js): l'icona del logo è il trigger ── */
.menu-wrap { position: relative; display: inline-flex; align-items: center; margin-right: 14px; }
.menu-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0; background: none; border: none; cursor: pointer; border-radius: 9px; -webkit-tap-highlight-color: transparent; }
.menu-toggle .logo-icon { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.menu-toggle:hover .logo-icon { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,128,208,0.25); }
.menu-caret { width: 14px; height: 14px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease, stroke 0.15s; }
.menu-toggle:hover .menu-caret { stroke: var(--blue-600); }
.menu-wrap.open .menu-caret { transform: rotate(180deg); }
.menu-dropdown { display: none; position: absolute; top: calc(100% + 10px); left: 0; min-width: 180px; background: #fff; border: 1px solid var(--blue-100); border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(26,128,208,0.08); padding: 6px; z-index: 200; }
.menu-wrap.open .menu-dropdown { display: block; }
.menu-dropdown a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--slate-600); text-decoration: none; transition: background 0.15s, color 0.15s; }
.menu-dropdown a:hover { background: rgba(232,244,253,0.6); color: var(--blue-700); }
.menu-dropdown a.active { color: var(--blue-600); font-weight: 500; }

/* ── Main ── */
main { max-width: var(--content-width); margin: 0 auto; padding: 52px 24px 80px; }
main.legal { padding: 44px 24px 72px; }

/* ── Footer ── */
footer { border-top: 1px solid var(--slate-100); padding: 24px; text-align: center; font-size: 12px; color: var(--slate-400); }
.footer-inner { max-width: var(--content-width); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a { color: var(--blue-500); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.subpage footer a { color: var(--slate-400); }
.subpage footer a:hover { color: var(--slate-600); text-decoration: none; }

/* ── Legal/contact pages: back link + prose ── */
.back-link { display:inline-flex; align-items:center; gap:6px; font-size:14px; color:var(--blue-500); text-decoration:none; margin-bottom:28px; }
.back-link:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(24px,4vw,34px); font-weight: 600; color: var(--slate-800); letter-spacing: -0.6px; line-height: 1.2; margin-bottom: 8px; }
.legal .updated { font-size: 13px; color: var(--slate-400); font-family:'DM Mono',monospace; margin-bottom: 32px; }
.legal h2 { font-size: 19px; font-weight: 600; color: var(--blue-700); margin: 34px 0 12px; letter-spacing: -0.3px; }
.legal h3 { font-size: 15px; font-weight: 600; color: var(--slate-800); margin: 20px 0 8px; }
.legal p { font-size: 15px; color: var(--slate-600); margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 22px; }
.legal li { font-size: 15px; color: var(--slate-600); margin-bottom: 6px; }
.legal a { color: var(--blue-500); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal strong { color: var(--slate-800); }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.legal th { color: var(--slate-600); font-weight: 600; background: var(--slate-50); }
.legal td { color: var(--slate-600); }
/* Inline images (post/page illustrations): fixed rectangle regardless of the
   source image's own dimensions, so the layout doesn't jump between posts. */
.legal p img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 4px auto 22px; border-radius: var(--radius-md); }

/* ── Blog: post date + index listing ── */
.legal .post-date { font-size: 13px; color: var(--slate-400); font-family:'DM Mono',monospace; margin: -2px 0 32px; }
.post-list { list-style: none; margin: 8px 0 0; padding: 0; }
.post-list li { padding: 18px 0; border-bottom: 1px solid var(--slate-100); }
.post-list li:first-child { border-top: 1px solid var(--slate-100); }
.post-list-link { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.post-list-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.post-list-title { font-size: 17px; font-weight: 600; color: var(--slate-800); letter-spacing: -0.2px; }
.post-list-link:hover .post-list-title { color: var(--blue-600); }
.post-list .post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.post-list .post-meta .post-date { margin: 0; }
.post-list .post-meta .tag-list { margin: 0; }
.post-list .tag-badge { font-size: 11px; padding: 2px 8px; }

.tag-list { display: block; margin: 8px 0 0; }
.tag-badge { display: inline-block; font-size: 12px; font-weight: 500; color: var(--blue-600); background: var(--blue-50); border-radius: var(--radius-sm); padding: 3px 10px; margin: 0 6px 6px 0; text-decoration: none; }
.tag-badge:hover { background: var(--blue-100); text-decoration: none; }
.legal > .tag-list { margin: -10px 0 28px; }

/* ── Blog teaser row (home + top of /blog/) ── */
.blog-teaser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 48px; }
.blog-teaser-card { display: block; background: rgba(255,255,255,0.65); border: 1px solid var(--blue-100); border-radius: var(--radius-md); padding: 18px 20px; text-decoration: none; }
.blog-teaser-card:hover { border-color: var(--blue-200); }
.blog-teaser-thumb { display: block; width: 100%; height: 110px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }
.blog-teaser-title { display: block; font-size: 14px; font-weight: 600; color: var(--slate-800); margin-bottom: 4px; }
.blog-teaser-desc { display: block; font-size: 12px; color: var(--slate-400); line-height: 1.5; }
.legal .blog-teaser-grid { margin-top: 8px; margin-bottom: 40px; }

/* ── Callout boxes ── */
.note { background:rgba(232,244,253,0.6); border:1px solid var(--blue-100); border-radius:var(--radius-md); padding:14px 16px; font-size:14px; color:var(--slate-600); margin:18px 0; }
.note strong { color: var(--blue-700); }
.warn { background:#fff7ed; border:1px solid #fed7aa; border-radius:var(--radius-md); padding:14px 16px; font-size:14px; color:var(--slate-600); margin:18px 0; }
.warn strong { color:#9a3412; }

/* ── Scam-safety callout (collapsible, native <details>) ──
   Amber, attention-grabbing but not alarming. Used on the home + verifica pages. */
.scam-warn { background:#fff7ed; border:1px solid #fed7aa; border-radius:var(--radius-md); margin:24px 0; font-size:14px; color:var(--slate-600); }
.scam-warn > summary { list-style:none; cursor:pointer; padding:14px 16px; display:flex; align-items:center; gap:8px; font-weight:600; color:#9a3412; -webkit-tap-highlight-color:transparent; }
.scam-warn > summary::-webkit-details-marker { display:none; }
.scam-warn > summary::after { content:""; margin-left:auto; width:9px; height:9px; border-right:2px solid #9a3412; border-bottom:2px solid #9a3412; transform:rotate(45deg); transition:transform .2s ease; flex-shrink:0; }
.scam-warn[open] > summary::after { transform:rotate(225deg); }
.scam-warn .scam-body { padding:0 16px 14px; }
.scam-warn .scam-body p { margin:0 0 10px; }
.scam-warn .scam-body ul { margin:0 0 12px 20px; }
.scam-warn .scam-body li { margin-bottom:6px; }
.scam-warn .scam-body strong { color:#9a3412; }
.scam-warn .scam-more { display:inline-block; font-weight:600; color:#9a3412; text-decoration:none; }
.scam-warn .scam-more:hover { text-decoration:underline; }

/* ── Bank EPC-QR support list (collapsible, native <details>) ──
   Blue, informational — distinct from the amber .scam-warn. Used in blog posts. */
.bank-list { background:rgba(232,244,253,0.6); border:1px solid var(--blue-100); border-radius:var(--radius-md); margin:18px 0; font-size:14px; color:var(--slate-600); }
.bank-list > summary { list-style:none; cursor:pointer; padding:14px 16px; display:flex; align-items:center; gap:8px; font-weight:600; color:var(--blue-700); -webkit-tap-highlight-color:transparent; }
.bank-list > summary::-webkit-details-marker { display:none; }
.bank-list > summary::after { content:""; margin-left:auto; width:9px; height:9px; border-right:2px solid var(--blue-700); border-bottom:2px solid var(--blue-700); transform:rotate(45deg); transition:transform .2s ease; flex-shrink:0; }
.bank-list[open] > summary::after { transform:rotate(225deg); }
.bank-list .bank-list-body { padding:0 16px 14px; }
.bank-list .bank-list-body ul { margin:0 0 12px 20px; }
.bank-list .bank-list-body li { margin-bottom:6px; }

/* ── Contact email card ── */
.email-card { background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 32px 28px; text-align: center; margin: 24px 0 8px; box-shadow: 0 8px 32px rgba(26,128,208,0.08); }
.email-label { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--blue-600); margin-bottom: 14px; }
.email-address { font-family: 'DM Mono', monospace; font-size: clamp(16px,3.4vw,22px); font-weight: 500; color: var(--slate-800); line-height: 1.5; word-break: break-word; }
.email-address .bit { color: var(--blue-500); }
.email-caption { font-size: 13px; color: var(--slate-400); margin-top: 16px; font-style: italic; }

/* ── Feedback CTA (shared by home + contact) ──
   Button colour is scoped as `.feedback-cta .feedback-btn` (specificity 0,2,0)
   so it wins over `.legal a` (0,1,1) — otherwise the button would render blue
   text on a blue background inside the .legal pages. */
.feedback-cta { text-align: center; background: white; border: 1px solid var(--slate-200); border-radius: var(--radius-xl); padding: 40px 28px; margin: 8px 0; box-shadow: 0 8px 32px rgba(26,128,208,0.08); }
.subpage .feedback-cta { margin-top: 36px; }
.feedback-cta h2 { font-size: 22px; font-weight: 600; color: var(--slate-800); letter-spacing: -0.4px; margin: 0 0 8px; }
.feedback-cta p { font-size: 15px; color: var(--slate-600); max-width: 460px; margin: 0 auto 22px; }
.feedback-cta .feedback-btn { display: inline-block; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 500; background: var(--blue-500); color: #fff; text-decoration: none; padding: 12px 26px; border-radius: var(--radius-md); transition: background 0.15s, transform 0.15s; }
.feedback-cta .feedback-btn:hover { background: var(--blue-600); transform: translateY(-1px); text-decoration: none; }
.feedback-sub { font-size: 13px; color: var(--slate-400); margin: 16px auto 0; }

/* ── SCREEN CAPTURE CROP OVERLAY ── */
.screencap-panel { display: none; position: relative; text-align: center; background: white; border: 1px solid var(--blue-100); border-radius: var(--radius-lg); padding: 26px 22px; margin-bottom: 30px; }
.screencap-panel.visible { display: block; }
.screencap-canvas-wrapper { width: 100%; max-width: 420px; margin: 0 auto 16px; background: #000; border-radius: var(--radius-md); overflow: hidden; position: relative; }
#screencap-canvas { display: block; width: 100%; height: auto; }
.screencap-crop-rect { position: absolute; top: 0; left: 0; border: 2px solid var(--blue-500); background: rgba(26,128,208,0.1); cursor: crosshair; display: none; }
.screencap-crop-rect.active { display: block; }
.screencap-actions { display: flex; justify-content: center; gap: 12px; }
.screencap-btn { font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; border: none; border-radius: var(--radius-md); padding: 12px 24px; cursor: pointer; transition: all 0.15s ease; }
.screencap-btn-confirm { background: var(--blue-500); color: white; }
.screencap-btn-confirm:hover { background: var(--blue-600); }
.screencap-btn-cancel { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }
.screencap-btn-cancel:hover { background: var(--slate-200); border-color: var(--slate-300); }
