/* Arkage Transfer — linguaggio visivo di thearkage.com */
:root {
  --bg: #000;
  --bg-elev: #121216;
  --bg-elev-2: #1a1a20;
  --border: #26262b;
  --border-strong: #3a3a42;
  --fg: #fff;
  --fg-muted: #a1a1aa;
  --fg-dim: #71717a;
  --brand-deep: #8c1832;
  --brand-border: #af283f;
  --brand-display: #b5394d;
  --brand-lift: #d47b83;
  --glow: #ef1f4f;
  --danger: #ff3d6e;
  --ok: #84cc16;
  --font-display: 'Syne', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'Azeret Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* glow brand */
  content: '';
  position: fixed;
  inset: -20vmax -10vmax auto auto;
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(circle at center, rgba(239, 31, 79, .22), rgba(140, 24, 50, .12) 35%, transparent 65%);
  pointer-events: none;
  z-index: -1;
  filter: blur(20px);
}
a { color: var(--brand-lift); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- tipografia ---------- */
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.02; margin: 0; }
.h1 { font-size: clamp(34px, 5vw, 56px); }
.h2 { font-size: clamp(24px, 3vw, 32px); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-lift);
}
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--fg-muted); }
.dim { color: var(--fg-dim); }

/* ---------- layout ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.brand span { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); letter-spacing: .12em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab {
  background: none; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-muted); transition: .15s var(--ease);
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); background: var(--bg-elev-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-deep); color: #fff; font-weight: 600; font-size: 12px;
}
main { padding: 36px 28px 80px; max-width: 1240px; margin: 0 auto; }

/* ---------- card ---------- */
.card {
  background: linear-gradient(180deg, rgba(26, 26, 32, .9), rgba(18, 18, 22, .92));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}

/* ---------- form ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); }
.input, select.input, textarea.input {
  width: 100%;
  background: #0a0a0d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 72px; }
.input:focus { border-color: var(--brand-border); box-shadow: 0 0 0 3px rgba(175, 40, 63, .25); }
.row { display: flex; gap: 12px; align-items: center; }
.row > .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--fg);
  font-weight: 500; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: .15s var(--ease);
}
.btn:hover { border-color: var(--fg-dim); background: #222229; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand-border); border-color: var(--brand-border); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 30px -6px var(--glow); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn.ghost:hover { color: var(--fg); background: var(--bg-elev-2); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 14px 26px; font-size: 16px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 8px; border: 0; background: none; color: var(--fg-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--fg); }
svg.i { width: 18px; height: 18px; flex: none; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s var(--ease); }
.switch input:checked { background: var(--brand-border); }
.switch input:checked::after { left: 18px; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; border: 1px solid; }
.alert.err { color: #ffb3c3; background: rgba(255, 61, 110, .08); border-color: rgba(255, 61, 110, .35); }
.alert.ok { color: #d9f99d; background: rgba(132, 204, 22, .08); border-color: rgba(132, 204, 22, .35); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); }
.auth-hero p { max-width: 460px; font-size: 17px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-panel .card { width: 100%; max-width: 420px; }
.auth-switch { margin-top: 18px; font-size: 14px; color: var(--fg-muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-switch a { cursor: pointer; }

/* ---------- send (stile wetransfer) ---------- */
.send-layout { display: grid; grid-template-columns: 420px 1fr; gap: 48px; align-items: start; }
.send-intro { padding-top: 40px; }
.send-intro p { max-width: 460px; font-size: 17px; }
.drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  transition: .15s var(--ease);
}
.drop.over { border-color: var(--glow); background: rgba(239, 31, 79, .06); }
.drop .plus {
  width: 52px; height: 52px; margin: 0 auto 10px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-border); color: #fff; cursor: pointer;
  transition: .15s var(--ease);
}
.drop .plus:hover { background: var(--glow); box-shadow: 0 0 30px -4px var(--glow); }
.drop .links { display: flex; justify-content: center; gap: 14px; font-size: 13px; margin-top: 6px; }
.drop .links a { cursor: pointer; }
.queue { margin: 14px 0; max-height: 220px; overflow: auto; border-radius: 10px; }
.queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.queue-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-sum { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); margin-bottom: 14px; }

.progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-deep), var(--glow)); transition: width .2s; }
.ring-wrap { text-align: center; padding: 18px 0; }
.ring { width: 150px; height: 150px; }
.ring circle { fill: none; stroke-width: 8; }
.ring .bg { stroke: var(--border); }
.ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .3s; transform: rotate(-90deg); transform-origin: center; }
.ring text { fill: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 30px; }

.link-box { display: flex; gap: 8px; align-items: center; background: #0a0a0d; border: 1px solid var(--brand-border); border-radius: 12px; padding: 6px 6px 6px 14px; }
.link-box input { flex: 1; background: none; border: 0; outline: none; font-family: var(--font-mono); font-size: 14px; min-width: 0; }

/* ---------- browser ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 13px; flex: 1; min-width: 200px; }
.crumbs a { color: var(--fg-muted); text-decoration: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.crumbs a:hover { color: var(--fg); background: var(--bg-elev-2); }
.crumbs a:last-child { color: var(--fg); }
.crumbs .sep { color: var(--fg-dim); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr.item:hover td { background: rgba(255, 255, 255, .025); }
.table tr.selected td { background: rgba(175, 40, 63, .12); }
.table .name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table .name-cell a, .table .name-cell span.n { color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.table .name-cell a:hover { color: var(--brand-lift); }
.table td.num { font-family: var(--font-mono); font-size: 12px; color: var(--fg-muted); white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table input[type=checkbox] { accent-color: var(--brand-border); width: 16px; height: 16px; cursor: pointer; }
.ficon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--fg-muted); }
.ficon.folder { color: var(--brand-lift); background: rgba(140, 24, 50, .18); border-color: rgba(175, 40, 63, .35); }
.ficon.thumb { padding: 0; overflow: hidden; }
.ficon.thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty { text-align: center; padding: 60px 20px; color: var(--fg-muted); }
.empty .display { color: var(--fg); margin-bottom: 8px; font-size: 22px; }
.browser-drop.over { outline: 2px dashed var(--glow); outline-offset: 6px; border-radius: 16px; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-muted); white-space: nowrap; }
.badge.red { border-color: rgba(175, 40, 63, .6); color: var(--brand-lift); }
.badge.bad { border-color: rgba(255, 61, 110, .5); color: var(--danger); }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; }
.modal h3 { margin: 0 0 18px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes fade { from { opacity: 0; } }

.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--bg-elev-2); border: 1px solid var(--border-strong); padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); animation: fade .2s; }
.toast.err { border-color: var(--danger); color: #ffb3c3; }

/* uploads panel */
.uploads { position: fixed; right: 24px; bottom: 24px; width: 360px; z-index: 90; padding: 16px; }
.uploads .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .92); display: grid; grid-template-rows: auto 1fr; }
.lightbox .bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.lightbox .bar .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .stage { display: grid; place-items: center; padding: 20px; min-height: 0; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 8px; }

/* ---------- share page ---------- */
.share-page { max-width: 1040px; margin: 0 auto; padding: 48px 24px 80px; }
.share-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 28px; }
.share-hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.share-msg { white-space: pre-wrap; color: var(--fg-muted); max-width: 640px; margin-top: 14px; font-size: 16px; }
.gate { max-width: 400px; margin: 10vh auto 0; text-align: center; }
.gate .lock { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: rgba(140, 24, 50, .25); color: var(--brand-lift); border: 1px solid var(--brand-border); }
.footer { text-align: center; padding: 30px; color: var(--fg-dim); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.spin { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--glow); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-hero .h1 { font-size: 36px; }
  .send-layout { grid-template-columns: 1fr; gap: 28px; }
  .send-intro { padding-top: 0; order: -1; }
  .share-hero { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .user-chip .email { display: none; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  main { padding: 24px 16px 80px; }
  .card { padding: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .table .hide-sm { display: none; }
  .uploads { left: 16px; right: 16px; width: auto; }
}

/* mirror di disaster recovery in sola lettura */
.ro-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; font-family: var(--font-mono); font-size: 12px; color: var(--brand-lift); background: rgba(140, 24, 50, .14); border-bottom: 1px solid rgba(175, 40, 63, .4); text-align: center; }
