/* iSwiss Pay web: stesso stile dello studio sulla tela (Archivo, bianco e nero, sfondo grigio chiaro). */
:root {
  --ground: #F3F4F6;
  --card: #FFFFFF;
  --ink: #111111;
  --muted: #4B5563;
  --line: #E5E7EB;
  --hair: #F3F4F6;
  --field: #D1D5DB;
  --good: #0F6E43;
  --good-bg: #DCFCE7;
  --good-ink: #14532D;
  --warn: #92400E;
  --bad: #B91C1C;
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ground); color: var(--ink); font-family: Archivo, system-ui, sans-serif; font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }

/* Struttura: barra laterale + contenuto; su schermo stretto la barra va sopra. */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 0 0 240px; padding: 28px 16px; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side .logo { display: flex; align-items: center; padding: 8px 14px 28px; }
.side .logo img { height: 32px; width: auto; }
.nav { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 500; border: 0; background: transparent; text-align: left; width: 100%; }
.nav:hover { background: var(--ground); }
.nav[aria-current="page"] { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.nav svg { flex: 0 0 auto; }
.side .spacer { flex: 1 1 auto; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 800px) {
  .side { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { padding: 6px 4px; flex-basis: 100%; }
  .side .spacer { display: none; }
  .nav { width: auto; padding: 10px 12px; }
  .main { padding: 20px 16px 40px; gap: 20px; }
}

.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.iconbtn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; }

.card { background: var(--card); border-radius: var(--radius); padding: 24px 28px; }
.hero { padding: 32px 36px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.label { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.balance { font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.balance small { font-size: 24px; font-weight: 600; color: var(--muted); }
@media (max-width: 800px) { .balance { font-size: 40px; } .hero { padding: 24px; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid var(--field); background: var(--card); color: var(--ink); font-weight: 600; }
.btn.primary { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.btn.small { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn.block { width: 100%; height: 52px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; font-weight: 700; }
.accounts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.account { background: var(--card); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; border: 2px solid transparent; text-align: left; width: 100%; }
.account[aria-pressed="true"] { border-color: var(--ink); }
.coin { width: 40px; height: 40px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.coin.ink { background: var(--ink); color: #FFFFFF; }
.coin.gold { background: #F1E3B0; color: #5A4300; }
.account .name { font-size: 14px; color: var(--muted); }
.account .amt { font-size: 22px; font-weight: 700; }

.columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.columns > .wide { flex: 999 1 420px; min-width: 0; }
.columns > .narrow { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.day { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 14px 0 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hair); width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.row .who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .title { font-weight: 600; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .amount { font-weight: 700; text-align: right; }
.row .amount.in { color: var(--good); }
.row .state { font-size: 12px; color: var(--muted); text-align: right; }
.row .state.warn { color: var(--warn); }
.row .state.bad { color: var(--bad); }
.empty { padding: 24px 0; color: var(--muted); }

.dark { background: var(--ink); color: #FFFFFF; }
.dark .muted { color: #D1D5DB; }
.dark .btn { background: transparent; color: #FFFFFF; border-color: #4B5563; }
.detail { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: #262626; }
.detail .k { font-size: 12px; color: #9CA3AF; letter-spacing: 0.04em; text-transform: uppercase; }
.detail .v { font-weight: 600; word-break: break-all; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.off { background: var(--warn); }

/* Accesso */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth .intro { flex: 1 1 420px; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; position: relative; overflow: hidden; isolation: isolate; }
.auth .intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.auth .intro::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.35) 45%, rgba(10,10,10,0.75) 100%); }
.auth .intro > :not(.intro-bg) { position: relative; }
.auth .intro p.muted, .auth .intro ul.muted { color: #F3F4F6; }
.auth .intro h1 { text-shadow: 0 2px 18px rgba(0,0,0,0.35); }
.auth .intro img { height: 36px; width: auto; align-self: flex-start; }
.auth .intro h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; max-width: 480px; }
.auth .intro p { font-size: 17px; line-height: 1.5; max-width: 480px; }
.auth .intro ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.auth .intro li { display: flex; align-items: center; gap: 10px; }
.auth .intro li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FFFFFF; }
.auth .pane { flex: 999 1 480px; min-width: 0; padding: 56px 40px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 800px) { .auth .intro { padding: 32px 24px; gap: 28px; } .auth .intro h1 { font-size: 30px; } .auth .pane { padding: 24px 16px; } }
.form { width: 100%; max-width: 420px; background: var(--card); border-radius: 24px; padding: 36px; display: flex; flex-direction: column; gap: 20px; }
.form h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .between { display: flex; justify-content: space-between; align-items: center; }
.input { height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--field); background: var(--card); width: 100%; }
.input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.input.code { font-size: 28px; font-weight: 700; letter-spacing: 0.3em; text-align: center; height: 64px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 12px; background: var(--ground); font-size: 13px; color: #374151; line-height: 1.5; }
.error { padding: 12px 14px; border-radius: 12px; background: #FEE2E2; color: #7F1D1D; font-size: 14px; }
.link { background: none; border: 0; padding: 0; font-weight: 600; color: var(--muted); text-decoration: underline; }
.center { text-align: center; }

/* Movimenti */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--line); }
.seg button { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; font-weight: 600; font-size: 14px; color: #374151; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); }
.row.selected { background: var(--ground); border-radius: 12px; padding-left: 10px; padding-right: 10px; margin: 0 -10px; width: calc(100% + 20px); }
.row:hover { background: var(--ground); border-radius: 12px; padding-left: 10px; padding-right: 10px; margin: 0 -10px; width: calc(100% + 20px); cursor: pointer; }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; font-size: 13px; font-weight: 600; background: var(--good-bg); color: var(--good-ink); }
.pill.inProgress { background: #FEF3C7; color: #78350F; }
.pill.declined { background: #FEE2E2; color: #7F1D1D; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 6px 0; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.card.narrow { display: flex; flex-direction: column; position: sticky; top: 20px; }

/* Pagamenti */
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .kinds { grid-template-columns: 1fr; } }
.kind { text-align: left; padding: 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 4px; }
.kind[aria-pressed="true"] { border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 13px; color: var(--muted); }
.hint.bad, .bad { color: var(--bad); }
.hint .good, .good { color: var(--good); font-weight: 600; }
.input.bad { border-color: var(--bad); }
.facts.dark { border-color: #374151; }
.facts.dark dt { color: #9CA3AF; }
.facts.dark dd { color: #FFFFFF; }

/* Conto in euro */
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
