/* ============================================================================
   TOMAS EXCHANGE — TEMPLATE (v2) — tema unico chiaro, elegante, professionale.
   Palette: indaco (azione) + smeraldo (accento/successo) su bianco/slate.
   Un solo file CSS per il frontend (sito + area clienti) — ADR-018.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --on-primary: #ffffff;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-soft: #edf1f6;

  --text: #0f172a;
  --muted: #64748b;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, .16);
  --header-h: 72px;

  --font: "Inter", "Segoe UI", -apple-system, system-ui, Helvetica, Arial, sans-serif;
  --mono: "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
img, svg { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; align-items: center; gap: 8px; }
.flex.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--text); }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lede { font-size: 1.08rem; line-height: 1.7; color: var(--muted); max-width: 62ch; }
.mono { font-family: var(--mono); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }

/* ---------- Logo / brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }

/* ---------- Header / nav ---------- */
.navbar { position: sticky; top: 0; z-index: 90; height: var(--header-h); background: rgba(255,255,255,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-soft); }
.navbar .inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.nav-center { display: flex; align-items: center; gap: 8px; margin: 0 auto; }
.nav-link { position: relative; color: var(--muted); font-weight: 600; font-size: .94rem; padding: 8px 14px; border-radius: var(--radius-sm); background: none; border: none; }
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; font-size: 1.05rem; align-items: center; justify-content: center; }
.mobile-panel { display: none; }

/* ---------- Pulsanti ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; background: var(--primary); color: var(--on-primary); transition: background .15s ease, box-shadow .15s ease, transform .1s ease; }
.btn:hover { background: var(--primary-dark); box-shadow: 0 6px 18px rgba(79,70,229,.25); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); box-shadow: none; }
.btn-ghost { background: none; border: none; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--surface); border: 1px solid var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; font-weight: 650; color: var(--muted); }
.input, .select, .textarea { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; width: 100%; }
.input::placeholder { color: #a3adbb; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: 3px solid var(--primary-soft); }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-title, .card h3.card-title { font-weight: 700; font-size: 1.02rem; margin-top: 0; color: var(--text); }

/* ---------- Badge / alert ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 11px; border-radius: 999px; font-size: .74rem; font-weight: 650; background: var(--surface-3); color: var(--muted); }
.badge.success { background: var(--accent-soft); color: var(--success); }
.badge.warning { background: #fef3c7; color: #b45309; }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.info { background: var(--primary-soft); color: var(--primary); }
.badge.neutral { background: var(--surface-3); color: var(--muted); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); line-height: 1.45; border: 1px solid var(--border); }
.alert.info { background: var(--primary-soft); color: var(--primary-dark); border-color: #c7d2fe; }
.alert.success { background: var(--accent-soft); color: #047857; border-color: #a7f3d0; }
.alert.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.hidden { display: none !important; }

/* ---------- Tabella ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.cell-strong { font-weight: 650; }
.cell-mono { font-family: var(--mono); font-size: .85rem; }

/* ---------- Hero (gradient soft, senza immagini esterne) ---------- */
.hero { position: relative; overflow: hidden; padding: 60px 20px 72px; background: linear-gradient(180deg, #fafaff 0%, #ffffff 65%); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; z-index: 0; pointer-events: none; }
.hero::before { width: 420px; height: 420px; background: radial-gradient(circle, var(--primary), transparent 70%); top: -140px; right: -100px; }
.hero::after { width: 380px; height: 380px; background: radial-gradient(circle, var(--accent), transparent 70%); bottom: -160px; left: -120px; }
.hero .hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 480px; gap: 48px; align-items: start; max-width: 1180px; margin: 0 auto; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 650; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; margin: 16px 0 12px; }
.hero p { color: var(--muted); font-size: 1.06rem; max-width: 520px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero .chip { padding: 5px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .82rem; font-weight: 600; }
.hero .trust { display: flex; gap: 8px; align-items: center; margin-top: 20px; color: var(--muted); font-size: .86rem; }

/* ---------- Widget swap ---------- */
.swap-widget { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 18px; }
.swap-tabs { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 4px; padding: 6px; background: var(--surface-2); border-radius: 999px; margin-bottom: 6px; }
.swap-tabs .t { padding: 8px 0; border-radius: 999px; font-weight: 650; font-size: .88rem; color: var(--muted); }
.swap-tabs .t.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.swap-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.swap-row .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.swap-row .input { font-size: 1.15rem; font-family: var(--mono); border: none; background: transparent; width: 100%; color: var(--text); padding: 0; }
.swap-row .input:focus { outline: none; }
.swap-row .select { min-width: 96px; font-weight: 700; background: var(--surface); }
.swap-arrow { display: flex; justify-content: center; margin: 8px 0; }
.swap-arrow button { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--primary); font-size: 1rem; box-shadow: var(--shadow); }
.swap-status { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 2px; font-size: .82rem; }
.swap-status .rate { font-family: var(--mono); font-weight: 700; color: var(--text); }
.swap-status .included { color: var(--muted); }
.swap-countdown { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); padding: 0 6px; }
.swap-fixed { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 4px 6px 10px; }
.swap-fixed .sw { width: 38px; height: 21px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; }
.swap-fixed .sw.on { background: var(--primary); }
.swap-result { text-align: center; font-family: var(--mono); font-size: 1.3rem; font-weight: 800; color: var(--text); }
.swap-cta { margin-top: 10px; }
.swap-cta .log-more { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 8px; }
.swap-cta .log-more b { color: var(--primary); }

/* ---------- Stats / sezioni / steps ---------- */
.num { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.stat { padding: 20px 8px; text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat .label { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.section { position: relative; padding: 76px 0; }
.section + .section { border-top: 1px solid var(--border-soft); }
.section.tone-b { background: var(--surface-2); }
.section.compact { padding: 44px 0; }
.section-head { text-align: center; margin-bottom: 8px; max-width: 640px; margin-left: auto; margin-right: auto; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-head p { color: var(--muted); margin: 8px 0 0; }
.section-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }

.steps { display: grid; grid-template-columns: repeat(var(--steps-cols, 3), 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.step { padding: 30px 26px; border-right: 1px solid var(--border); }
.step:last-child { border-right: none; }
.step .icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
.step h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step p { color: var(--muted); }

/* ---------- Cards prodotti ---------- */
.product-line { display: grid; grid-template-columns: repeat(var(--cards-cols, 4), 1fr); gap: 16px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px; transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card .pc-icon { font-size: 1.4rem; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); display: grid; place-items: center; }
.product-card .pc-t { font-weight: 700; margin-top: 12px; }
.product-card .pc-d { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.filters .f { padding: 7px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: .88rem; font-weight: 600; }
.filters .f.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---------- Testimonianze ---------- */
.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.review .who { font-weight: 700; }
.review .stars { color: var(--warning); letter-spacing: 1px; font-size: .85rem; }
.review .body { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.review .meta { font-size: .76rem; color: var(--muted); margin-top: 6px; }

/* ---------- Feature list ---------- */
.feature-list { padding-left: 0; list-style: none; }
.feature-list li { padding: 8px 0 8px 26px; position: relative; }
.feature-list li::before { content: "?"; position: absolute; left: 0; width: 20px; color: var(--success); font-weight: 800; }

/* ---------- Pay strip / notice ---------- */
.pay-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-strip span { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .86rem; }
.notice { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- Asset grid (Rates) ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.asset-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; transition: transform .15s ease, box-shadow .15s ease; }
.asset-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.asset-card .t { font-weight: 800; font-size: 1.02rem; }
.asset-card .d { font-size: .8rem; color: var(--muted); }
.asset-card .q { font-family: var(--mono); font-size: .88rem; color: var(--text); margin-top: 10px; }

/* ---------- Sidebar (portale) ---------- */
.sidebar { width: 240px; position: sticky; top: calc(var(--header-h) + 14px); align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.sidebar .nav-link { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--text); font-weight: 550; background: none; }
.sidebar .nav-link:hover { background: var(--surface-2); text-decoration: none; }
.sidebar .nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }

/* ---------- Chat ---------- */
.chat-thread { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.bubble { display: flex; flex-direction: column; gap: 2px; max-width: 78%; padding: 7px 10px 4px; border-radius: 14px; line-height: 1.4; word-break: break-word; white-space: pre-wrap; font-size: .84rem; }
.bubble.mine { align-self: flex-end; background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid #e9edf3; border-bottom-left-radius: 4px; }
.bubble-time { align-self: flex-end; font-size: .62rem; opacity: .7; font-variant-numeric: tabular-nums; }
.chat-day { align-self: center; margin: 6px 0 2px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .68rem; font-weight: 600; }

/* ---------- Notifiche ---------- */
.notifications-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.notifications-head p { margin: 0; }
.notifications-list { display: flex; flex-direction: column; gap: 10px; }
.notification-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.notification-item.unread { background: #f5f7ff; border-color: #c7d2fe; }
.notification-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; border-radius: 50%; background: var(--muted); }
.notification-dot.account { background: var(--primary); }
.notification-dot.kyc { background: var(--warning); }
.notification-dot.operation { background: var(--success); }
.notification-dot.security { background: var(--danger); }
.notification-body { flex: 1; min-width: 0; }
.notification-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.notification-head strong { font-size: .9rem; color: var(--text); font-weight: 600; }
.notification-item.unread .notification-head strong { font-weight: 800; }
.notification-time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.notification-body p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.notification-item .btn { flex: 0 0 auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: #cbd3e1; padding: 56px 0 0; }
.footer-grid-wrap { display: grid; grid-template-columns: 1.3fr 2fr; gap: 40px; padding-bottom: 40px; }
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #94a0b8; max-width: 34ch; margin-top: 12px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: #94a0b8; margin-bottom: 12px; }
.footer-col a { color: #e2e8f0; text-decoration: none; display: block; padding: 4px 0; font-size: .92rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #27304a; padding: 18px 0; margin-top: 8px; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-bottom .muted { color: #8893a8; }

/* ---------- Pagine AUTH ---------- */
.page-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 6px; color: var(--text); }
.page-sub { color: var(--muted); font-size: 1rem; margin: 0 0 26px; }
.auth-split { display: grid; grid-template-columns: 460px 1fr; min-height: calc(100vh - var(--header-h)); }
.auth-panel { padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; background: linear-gradient(160deg, var(--primary) 0%, #4f46e5 45%, var(--accent) 130%); color: #fff; }
.auth-panel .brand { color: #fff; }
.auth-panel h2 { font-size: 1.9rem; line-height: 1.2; margin: 0; color: #fff; }
.auth-panel .sub { color: rgba(255,255,255,.85); line-height: 1.6; max-width: 34ch; }
.auth-panel .feature-list li::before { color: #fff; }
.auth-panel .feature-list li { color: rgba(255,255,255,.92); }
.auth-box { display: flex; align-items: center; justify-content: center; padding: 44px 20px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form .card { padding: 26px; }
.field.pw { position: relative; }
.pw-toggle { position: absolute; right: 10px; top: 32px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 4px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; margin-top: -2px; }
.legal-note { font-size: .72rem; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.5; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 20px; }
.p-1 { padding: 8px; } .p-2 { padding: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .hero-grid { grid-template-columns: 1fr; }
  .grid.cols-4, .product-line { grid-template-columns: 1fr 1fr; }
  .stats, .steps, .reviews, .split, .footer-grid-wrap, .footer-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; }
  .nav-center { display: none; }
  .burger { display: inline-flex; }
  .mobile-panel.open { display: flex; }
  .step { border-right: none; border-bottom: 1px solid var(--border); }
  .step:last-child { border-bottom: none; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
}
@media (max-width: 600px) {
  .grid.cols-4, .grid.cols-3, .product-line { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.mobile-panel { flex-direction: column; gap: 4px; padding: 14px 20px 20px; background: var(--surface); border-bottom: 1px solid var(--border-soft); box-shadow: var(--shadow); }
.mobile-panel .nav-link { text-align: left; }
.mobile-panel .mobile-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ---------- Banner illustrato (home + hero pagine) ---------- */
.hero-art { width: 100%; height: auto; max-width: 500px; display: block; margin: 0 auto; }

.banner { position: relative; overflow: hidden; border-radius: 24px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, var(--accent) 145%); color: #fff; padding: 46px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 34px; align-items: center; box-shadow: var(--shadow-lg); }
.banner::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); top: -140px; right: -80px; pointer-events: none; }
.banner > * { position: relative; z-index: 1; }
.banner .eyebrow { background: rgba(255,255,255,.18); color: #fff; }
.banner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 14px 0 10px; }
.banner p { color: rgba(255,255,255,.88); max-width: 46ch; }
.banner .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.banner .chip { padding: 5px 13px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: .82rem; font-weight: 600; }
.banner .btn-light { background: #fff; color: var(--primary); margin-top: 22px; }
.banner .btn-light:hover { background: #f1f5f9; box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.banner .hero-art { max-width: 440px; }

@media (max-width: 900px) {
  .banner { grid-template-columns: 1fr; padding: 32px; }
  .banner .hero-art { max-width: 360px; }
}

/* ============================================================================
   PORTALE CLIENTE — struttura a pannelli (stile riferimento)
   ========================================================================== */
.portal { display: flex; flex-direction: column; gap: 16px; min-height: 100vh; background: #eef1f6; padding: 18px 18px 62px; }
.portal-header { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: #fff; border: 1px solid #e9edf3; border-radius: 16px; position: sticky; top: 18px; z-index: 60; }
.portal-body { display: flex; gap: 16px; align-items: flex-start; }
.portal-side { width: 224px; flex: 0 0 224px; background: #fff; border: 1px solid #e9edf3; border-radius: 16px; padding: 14px; position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.02rem; color: #0f172a; padding: 8px 8px 16px; }
.portal-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: #0f172a; white-space: nowrap; }
.portal-nav { display: flex; flex-direction: column; gap: 2px; }
.pnav { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: none; background: none; color: #475569; font-weight: 600; font-size: .92rem; border-radius: 10px; cursor: pointer; text-align: left; }
.pnav:hover { background: #f1f5f9; color: #0f172a; }
.pnav.active { background: #eef4ff; color: #2563eb; }
.pnav-ico { display: grid; place-items: center; width: 22px; }
.pnav-label { flex: 1; }
.pnav-badge { background: #2563eb; color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700; padding: 1px 7px; }

.portal-main { flex: 1; min-width: 0; background: #fff; border: 1px solid #e9edf3; border-radius: 16px; overflow: hidden; }
.phead-title { margin: 0; font-size: 1.15rem; font-weight: 750; color: #0f172a; }
.phead-search { flex: 1; max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: #f1f5f9; border: 1px solid #e9edf3; border-radius: 999px; padding: 8px 14px; color: #94a3b8; }
.phead-search input { border: none; background: none; outline: none; flex: 1; font-size: .9rem; color: #0f172a; }
.phead-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pico { width: 36px; height: 36px; display: grid; place-items: center; border: none; background: none; color: #64748b; cursor: pointer; border-radius: 50%; position: relative; }
.pico:hover { background: #f1f5f9; color: #0f172a; }
.pico-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .6rem; font-weight: 700; display: grid; place-items: center; }

.acct { position: relative; }
.acct-chip { display: flex; align-items: center; gap: 8px; background: #0f172a; color: #fff; border: none; border-radius: 999px; padding: 5px 6px 5px 14px; cursor: pointer; font-weight: 650; font-size: .88rem; }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; background: #3b82f6; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.acct-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: #fff; border: 1px solid #e9edf3; border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.12); padding: 6px; z-index: 50; }
.acct-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; border-radius: 8px; cursor: pointer; color: #0f172a; font-size: .9rem; }
.acct-item:hover { background: #f1f5f9; }

.pbody { padding: 22px; }

.portal-aside-stack { width: 300px; flex: 0 0 300px; position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }
.portal-aside { background: #fff; border: 1px solid #e9edf3; border-radius: 16px; padding: 20px; }
.aside-title { margin: 0 0 14px; font-size: 1rem; font-weight: 750; color: #0f172a; }
.qa-list { display: flex; flex-direction: column; gap: 4px; }
.qa { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; border: none; background: none; cursor: pointer; border-radius: 10px; text-align: left; }
.qa:hover { background: #f8fafc; }
.qa-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.qa-ico.blue { background: #3b82f6; } .qa-ico.indigo { background: #6366f1; } .qa-ico.teal { background: #14b8a6; } .qa-ico.green { background: #22c55e; } .qa-ico.orange { background: #f97316; }
.qa-label { font-weight: 600; color: #0f172a; font-size: .92rem; }

.home-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.home-top .wallet-switch { width: auto; padding: 6px 10px; font-weight: 700; }
.balance-num-sm { font-size: 1.6rem; }
.balance-num { font-size: 2.4rem; font-weight: 800; color: #0f172a; letter-spacing: -.02em; }
.balance-sub { display: flex; align-items: center; gap: 6px; color: #64748b; font-size: .9rem; margin-top: 4px; }
.balance-sub .up { color: #22c55e; display: grid; place-items: center; }
.balance-caret { border: 1px solid #e9edf3; background: #fff; width: 36px; height: 36px; border-radius: 10px; color: #64748b; cursor: pointer; }
.home-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.home-actions-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.home-actions .btn { height: 39px; }
.next-step { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 560px; height: 39px; padding: 0 16px; border: 1px solid #c7d2fe; background: var(--primary-soft); border-radius: 4px; cursor: pointer; text-align: left; }
.next-step:hover { background: #e0e7ff; }
.next-step .ns-t { font-weight: 750; color: var(--primary-dark); font-size: .78rem; line-height: 1; white-space: nowrap; }
.next-step .ns-d { color: #475569; font-size: .74rem; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-step svg { color: var(--primary); flex: 0 0 auto; }
@media (max-width: 700px) {
  .next-step { max-width: 100%; }
  .next-step .ns-d { display: none; }
  .home-actions-buttons { width: 100%; justify-content: flex-end; }
}
.chart { margin: 18px 0; }
.chart-svg { width: 100%; height: 180px; display: block; }
.chart-ranges { display: flex; gap: 22px; justify-content: center; margin-top: 8px; }
.cr { border: none; background: none; color: #94a3b8; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.cr.active { color: #2563eb; background: #eef4ff; }

.alloc-list { border-top: 1px solid #eef2f7; }
.alloc-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 6px; border: none; background: none; cursor: pointer; text-align: left; border-bottom: 1px solid #eef2f7; }
.alloc-row:hover { background: #f8fafc; }
.alloc-ico { width: 34px; height: 34px; border-radius: 50%; background: #f1f5f9; color: #334155; display: grid; place-items: center; }
.alloc-name { font-weight: 700; color: #0f172a; flex: 1; }
.alloc-col { width: 160px; display: flex; flex-direction: column; }
.alloc-label { color: #94a3b8; font-size: .78rem; }
.alloc-val { font-weight: 650; color: #0f172a; font-variant-numeric: tabular-nums; }
.alloc-go { color: #94a3b8; }

.for-you { margin-top: 22px; }
.fy-head { font-weight: 750; color: #0f172a; margin-bottom: 12px; }
.fy-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.promo { display: flex; align-items: center; gap: 12px; background: #f1f5f9; border-radius: 14px; padding: 14px 16px; position: relative; }
.promo-ico { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; }
.promo-ico.blue { color: #3b82f6; } .promo-ico.indigo { color: #6366f1; }
.promo-t { font-weight: 700; color: #0f172a; }
.promo-d { color: #64748b; font-size: .85rem; }
.promo-x { position: absolute; top: 8px; right: 8px; border: none; background: none; color: #94a3b8; cursor: pointer; border-radius: 6px; padding: 3px; }
.promo-x:hover { color: #0f172a; background: #e2e8f0; }

@media (max-width: 1080px) {
  .portal-body { flex-wrap: wrap; }
  .portal-side { width: 100%; flex: 1 1 100%; position: static; max-height: none; }
  .portal-nav { flex-direction: row; flex-wrap: wrap; }
  .pnav { width: auto; }
  .pnav-label { flex: 0 0 auto; }
  .portal-aside-stack { width: 100%; flex: 1 1 100%; position: static; max-height: none; overflow: visible; }
  .phead-search { display: none; }
  .alloc-col { width: 110px; }
}

/* ---------- Footer portale (slim, dashboard-style) ---------- */
.portal-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding: 8px 22px; background: #fff; border: none; border-top: 1px solid #e9edf3; border-radius: 0; box-shadow: 0 -8px 24px rgba(15, 23, 42, .04); color: #94a3b8; font-size: .72rem; }
.pfoot-left, .pfoot-mid, .pfoot-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pfoot-left { color: #64748b; }
.pfoot-brand { font-weight: 750; color: #0f172a; }
.pfoot-sep { color: #dbe2ea; }
.pfoot-status { display: inline-flex; align-items: center; gap: 6px; color: #0f766e; font-weight: 600; }
.pfoot-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); animation: pfoot-pulse 2.4s ease-in-out infinite; }
@keyframes pfoot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, .06); }
}
.pfoot-version { font-family: var(--mono); font-size: .64rem; color: #94a3b8; border: 1px solid #e9edf3; border-radius: 999px; padding: 1px 7px; }
.pfoot-link { border: none; background: none; color: #64748b; font-size: .72rem; font-weight: 600; padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.pfoot-link:hover { color: #4f46e5; background: #eef2ff; }
@media (max-width: 900px) {
  .portal-foot { justify-content: center; text-align: center; }
  .pfoot-mid { display: none; }
}

/* ---------- Widget di supporto (pallina in basso a destra) ---------- */
.sw-bubble { position: fixed; right: 24px; bottom: 58px; width: 56px; height: 56px; border-radius: 50%; border: none; background: #2563eb; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 28px rgba(37,99,235,.4); z-index: 200; }
.sw-bubble:hover { background: #1d4ed8; }
.sw-panel { position: fixed; right: 24px; bottom: 126px; width: 360px; max-width: calc(100vw - 48px); height: 480px; max-height: calc(100vh - 130px); background: #fff; border: 1px solid #e9edf3; border-radius: 16px; box-shadow: 0 24px 60px rgba(15,23,42,.22); display: flex; flex-direction: column; overflow: hidden; z-index: 200; }
.sw-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #eef2f7; background: #2563eb; color: #fff; }
.sw-back, .sw-close { background: none; border: none; color: #fff; cursor: pointer; border-radius: 8px; padding: 4px 6px; display: grid; place-items: center; }
.sw-back:hover, .sw-close:hover { background: rgba(255,255,255,.18); }
.sw-title { flex: 1; font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sw-start { padding: 10px 12px; border-bottom: 1px solid #eef2f7; }
.sw-newform { display: flex; gap: 6px; align-items: center; }
.sw-newform .input { flex: 1; min-width: 0; }
.sw-conv { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 12px; border: none; border-bottom: 1px solid #eef2f7; background: none; cursor: pointer; width: 100%; }
.sw-conv:hover { background: #f8fafc; }
.sw-conv.unread { background: #f5f7ff; }
.sw-conv.unread:hover { background: #eef2ff; }
.sw-conv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sw-conv-t { font-weight: 550; color: #0f172a; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-conv-time { color: #94a3b8; font-size: .66rem; white-space: nowrap; }
.sw-conv-preview { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sw-conv-m { flex: 1; color: #94a3b8; font-size: .73rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-conv.unread .sw-conv-t { font-weight: 750; }
.sw-conv.unread .sw-conv-m { font-weight: 600; color: #334155; }
.sw-conv.unread .sw-conv-time { color: #4f46e5; font-weight: 600; }
.sw-conv-badge { flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #2563eb; color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; }
.sw-thread { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background-color: #f6f8fb; background-image: radial-gradient(rgba(37, 99, 235, .06) 1px, transparent 1px); background-size: 18px 18px; }
.sw-composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eef2f7; }
.sw-composer .input { flex: 1; }

/* ---------- Home ALT (anatomia stile riferimento) ---------- */
.alt-badge { text-align: left; }
.alt-badge-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--success); display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.alt-benefit { text-align: left; }
.alt-benefit-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px; }
.alt-partner { text-align: left; }
.alt-steps { list-style: none; counter-reset: s; padding-left: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 14px; }
.alt-steps li { counter-increment: s; position: relative; padding-left: 46px; color: var(--muted); line-height: 1.6; }
.alt-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.alt-steps li b { color: var(--text); }

/* ---------- Modal: attività bloccata da un plugin ---------- */
.cap-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 300; padding: 20px; }
.cap-modal { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(15,23,42,.28); padding: 24px; }
.cap-ico { width: 46px; height: 46px; border-radius: 50%; background: #fef3c7; color: #b45309; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; margin-bottom: 12px; }
.cap-title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 750; color: #0f172a; }
.cap-msg { color: #475569; line-height: 1.6; margin: 0 0 10px; }
.cap-steps { margin: 0 0 16px; padding-left: 18px; color: #475569; }
.cap-steps li { padding: 3px 0; }
.cap-actions { display: flex; justify-content: flex-end; gap: 10px; }
/* ---------- Verifiche banca/wallet (cliente) ---------- */
.verif-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.verif-head .verif-close { margin-left: auto; }
.verif-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.verif-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.verif-value { display: block; font-size: .92rem; font-weight: 650; color: var(--text); word-break: break-word; margin-top: 2px; }
.verif-note { background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 4px; padding: 10px 12px; margin-bottom: 12px; }
.verif-note p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.wallet-addr { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-dot.verification { background: #0ea5e9; }
@media (max-width: 640px) { .verif-grid { grid-template-columns: 1fr; } }

/* ---------- Home: elenco wallet + dettaglio wallet ---------- */
.wallets-home { margin-top: 22px; }
.wallets-home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.wallets-home-head .fy-head { margin: 0; }
.wallet-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wallet-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border: 1px solid #e9edf3; border-radius: 14px; background: #fff; cursor: pointer; }
.wallet-card:hover { border-color: #c7d2fe; box-shadow: 0 6px 18px rgba(37, 99, 235, .08); }
.wallet-card.frozen { background: #f8fafc; }
.wallet-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wallet-card-top b { font-size: .95rem; color: #0f172a; }
.wallet-card-bal { font-family: var(--mono); font-size: .9rem; color: #0f172a; }
.wallet-card-sub { font-size: .72rem; color: #94a3b8; }
.wallet-detail-head { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: #fff; border: 1px solid #e9edf3; border-radius: 16px; margin-bottom: 16px; }
.wallet-detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wallet-detail-type { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 700; margin-bottom: 2px; }
.wallet-back { margin-bottom: 10px; }
.wallet-detail-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wallet-detail-coin { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: .78rem; }
.wallet-detail-title { margin: 0 0 4px; font-size: 1.1rem; font-weight: 750; color: #0f172a; }
.wallet-detail-balance { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.wallet-detail-balance b { font-size: 1.15rem; font-family: var(--mono); color: #0f172a; }
.wallet-detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wallet-request-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.wallet-request-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.wallet-request-name { display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) {
  .wallet-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-detail-balance { text-align: left; }
}
@media (max-width: 600px) {
  .wallet-cards { grid-template-columns: 1fr; }
  .wallet-detail-actions { width: 100%; }
}

/* ---------- Home: azioni wallet + colonna destra (wallet/news) ---------- */

.alloc-static { cursor: default; }
.wallet-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; }
.wallet-picker-row:hover { border-color: var(--primary); background: var(--primary-soft); }
.aside-wallets { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.aside-wallet { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid #eef2f7; border-radius: 10px; background: #fff; cursor: pointer; }
.aside-wallet:hover { border-color: #c7d2fe; background: #f8faff; }
.aside-wallet-ccy { font-weight: 700; color: #0f172a; font-size: .86rem; }
.aside-wallet-bal { font-family: var(--mono); font-size: .8rem; color: #0f172a; }
.aside-news { border-top: 1px solid #eef2f7; padding-top: 14px; }
.news-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.news-item:last-child { border-bottom: none; }
.news-title { font-size: .82rem; font-weight: 600; color: #0f172a; line-height: 1.35; }
.news-meta { font-size: .7rem; color: #94a3b8; }
.news-item:hover .news-title { color: var(--primary); }


/* ---------- Verification: dettagli step (popup) ---------- */
.plugin-name-link { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: none; border: none; padding: 0; cursor: pointer; text-align: left; color: var(--text); font-weight: 600; }
.plugin-name-link:hover span:first-child { color: var(--primary); }
.plugin-name-more { font-size: .7rem; font-weight: 600; color: var(--primary); }
.plugin-details { max-width: 560px; }
.plugin-details-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.plugin-details-x { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 4px; }
.plugin-details-x:hover { background: var(--surface-2); }
.plugin-description { color: #475569; font-size: .88rem; line-height: 1.5; margin: 8px 0 0; }
.plugin-details-section { margin-top: 14px; }
.plugin-instructions-text { white-space: pre-wrap; color: #475569; line-height: 1.5; margin: 4px 0 0; }
.plugin-benefits { margin: 6px 0 0; padding-left: 18px; color: #475569; line-height: 1.5; }
.plugin-thread { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.plugin-thread-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); }
.plugin-thread-meta { font-size: .68rem; color: var(--muted); margin-bottom: 2px; }
.plugin-thread-body { font-size: .82rem; color: #334155; white-space: pre-wrap; line-height: 1.4; }
.plugin-thread-file { font-size: .78rem; color: var(--primary); font-family: var(--mono); margin-top: 2px; }
.plugin-reply-actions { display: flex; justify-content: flex-end; margin-top: 6px; }

/* Richiesta plugin lato cliente */
.plugin-request { max-width: 760px; }
.plugin-request .popup-body { padding: 20px 24px 24px; }
.plugin-request-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plugin-request-meta .muted { margin: 0; }
.plugin-request .plugin-thread { max-height: 260px; }
.plugin-request-form { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-soft); margin-top: 16px; padding-top: 16px; }
.plugin-request-form .field { margin-bottom: 10px; }
.plugin-request-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Popup azioni wallet (deposit/withdraw/swap) ---------- */
.action-modal { max-width: 640px; }
.popup-card { padding: 0; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; position: relative; }
.popup-bar { display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 6px; padding: 19px 14px; min-height: 66px; border-bottom: 1px solid #eef2f7; background: #fff; flex: 0 0 auto; }
.popup-title { margin: 0; text-align: center; text-transform: uppercase; letter-spacing: .06em; font-size: 1rem; font-weight: 750; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-x { border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; display: grid; place-items: center; justify-self: start; }
.popup-x:hover { background: var(--surface-2); color: var(--text); }
.popup-body { padding: 18px 24px 22px; overflow-y: auto; }
.popup-card .cap-actions { margin-top: 16px; }
.action-modal .card { box-shadow: none; border: 1px solid #eef2f7; padding: 16px; }
.action-modal .card + .card { margin-top: 12px; }
.action-modal .card-title { font-size: .92rem; }

/* Scrollbar sottile e quasi invisibile nei popup del portale */
.cap-modal, .portal-side, .portal-aside-stack, .plugin-thread, .popup-body { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.cap-modal.is-scrolling, .portal-side.is-scrolling, .portal-aside-stack.is-scrolling, .plugin-thread.is-scrolling, .popup-body.is-scrolling { scrollbar-color: rgba(15, 23, 42, .32) transparent; }
.cap-modal::-webkit-scrollbar, .portal-side::-webkit-scrollbar, .portal-aside-stack::-webkit-scrollbar, .plugin-thread::-webkit-scrollbar, .popup-body::-webkit-scrollbar { width: 2px; height: 2px; }
.cap-modal::-webkit-scrollbar-track, .portal-side::-webkit-scrollbar-track, .portal-aside-stack::-webkit-scrollbar-track, .plugin-thread::-webkit-scrollbar-track, .popup-body::-webkit-scrollbar-track { background: transparent; }
.cap-modal::-webkit-scrollbar-thumb, .portal-side::-webkit-scrollbar-thumb, .portal-aside-stack::-webkit-scrollbar-thumb, .plugin-thread::-webkit-scrollbar-thumb, .popup-body::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.cap-modal.is-scrolling::-webkit-scrollbar-thumb, .portal-side.is-scrolling::-webkit-scrollbar-thumb, .portal-aside-stack.is-scrolling::-webkit-scrollbar-thumb, .plugin-thread.is-scrolling::-webkit-scrollbar-thumb, .popup-body.is-scrolling::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .32); }
.cap-modal::-webkit-scrollbar-button, .portal-side::-webkit-scrollbar-button, .portal-aside-stack::-webkit-scrollbar-button, .plugin-thread::-webkit-scrollbar-button, .popup-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.plugin-current { display: flex; align-items: flex-start; gap: 14px; }
.plugin-current-order { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .95rem; }
.plugin-current-body { flex: 1; min-width: 0; }
.plugin-current-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plugin-current-desc { margin: 7px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.plugin-current-actions { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .plugin-current { flex-wrap: wrap; }
  .plugin-current-actions { width: 100%; justify-content: flex-start; padding-left: 52px; }
}
.plugin-kyc-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.plugin-kyc-docs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.plugin-kyc-doc { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 7px; background: var(--surface-2); font-size: .82rem; }
.popup-bar { background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%); border-bottom-color: rgba(255, 255, 255, .18); }
.popup-title { color: #fff; }
.popup-x { color: rgba(255, 255, 255, .92); }
.popup-x:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.plugin-details .popup-bar { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); }
.capability-modal .popup-bar { background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%); }
.action-kyc .popup-bar { background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%); }
.action-bank .popup-bar { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); }
.action-wallet .popup-bar { background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%); }
.sw-head { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%); border-bottom-color: rgba(255, 255, 255, .18); }
.popup-bar { grid-template-columns: 36px minmax(0, 1fr) 36px; }
.popup-x { grid-column: 3; grid-row: 1; justify-self: end; }
.popup-title { grid-column: 2; grid-row: 1; }
.popup-bar > span[aria-hidden="true"] { display: none; }
/* ---------- Importi con controvalore EUR ---------- */
.money { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.2; vertical-align: middle; max-width: 100%; }
.money-main { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.money-eur { color: var(--muted); font-size: .68em; font-family: var(--mono); white-space: nowrap; font-weight: 500; }
.aside-wallet-bal.money { align-items: flex-end; }
.field > .money-eur { margin-top: 2px; }
.money-eur { color: var(--muted); font-size: .66rem; line-height: 1.25; font-family: var(--mono); white-space: nowrap; font-weight: 500; }
.balance-sub .balance-eur { color: var(--muted); font-size: .72rem; font-family: var(--mono); font-weight: 500; margin-right: 4px; }

/* ---------- Dialog & form polish (frontend) ---------- */
.cap-overlay { display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: clamp(12px, 2.5vw, 24px); background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.cap-modal { max-height: calc(100dvh - 32px); }
.cap-modal:not(.popup-card) { overflow-y: auto; border-radius: 14px; }
.popup-card { width: 100%; max-height: calc(100dvh - 32px); border-radius: 14px; }
.popup-bar { min-height: 60px; padding: 14px 18px; grid-template-columns: 36px minmax(0, 1fr) 36px; }
.popup-title { text-transform: none; letter-spacing: 0; font-size: 1.05rem; line-height: 1.25; }
.popup-x { width: 34px; height: 34px; border-radius: 8px; }
.popup-body { padding: 20px 22px 22px; }
.modal-actions, .plugin-request-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.modal-actions .btn, .plugin-request-actions .btn { min-height: 40px; }
.btn { min-height: 40px; line-height: 1.1; }
.btn-sm { min-height: 32px; line-height: 1.1; }
.field { gap: 7px; }
.field label { font-size: .78rem; letter-spacing: .01em; }
.input, .select, .textarea { min-height: 42px; padding: 10px 12px; border-radius: 8px; }
.textarea { min-height: 96px; resize: vertical; }
.grid { gap: 16px; }
.action-modal .card { border-radius: 10px; }
.action-modal .card + .card { margin-top: 14px; }
.plugin-request-form { gap: 2px; }
.plugin-request-form .field { margin-bottom: 12px; }
.plugin-thread { padding-right: 4px; }
@media (max-width: 700px) {
  .cap-overlay { align-items: flex-start; padding: 10px; }
  .cap-modal { max-height: calc(100dvh - 20px); }
  .popup-card { max-height: calc(100dvh - 20px); }
  .popup-body { padding: 16px; }
  .modal-actions, .plugin-request-actions { justify-content: stretch; }
  .modal-actions .btn, .plugin-request-actions .btn { flex: 1 1 140px; }
}

/* ---------- Branding dinamico e Site management ---------- */
.brand-logo-img { border-radius: 7px; object-fit: contain; background: #fff; }
.site-admin-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface-2); }
.site-admin-card { width: min(760px, 100%); padding: 28px; }
.site-admin-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 14px; }
.site-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.site-admin-head h1 { margin: 0 0 4px; }
.site-admin-upload { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.site-admin-preview { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.site-admin-preview img { max-width: 140px; max-height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 4px; }
.site-admin-preview img.favicon { width: 32px; height: 32px; padding: 2px; }
.site-admin-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@media (max-width: 640px) {
  .site-admin-page { padding: 12px; align-items: flex-start; }
  .site-admin-card { padding: 20px; }
  .site-admin-head { flex-direction: column; }
  .site-admin-actions .btn { flex: 1 1 140px; }
}