/* TransferDom — stile condiviso (tema professionale, carattere Calibri/Carlito) */
@import url('https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --bg: #eef1f6;
  --bg-2: #e4e9f2;
  --ink: #1b2533;
  --ink-soft: #5a6678;
  --accent: #2a4d9b;
  --accent-dark: #1f3a78;
  --line: #dde3ec;
  --card: #ffffff;
  --ok: #1f8a52;
  --err: #c8372b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 14px 34px -18px rgba(16,24,40,.22);
  --display: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    linear-gradient(180deg, #f4f6fa 0%, var(--bg) 220px),
    radial-gradient(720px 380px at 92% -10%, rgba(42, 77, 155, .07), transparent 60%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .bolt {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-family: var(--display);
  font-size: 21px; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 6px 16px -6px rgba(42,77,155,.6);
}
.brand b { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.nav-links a {
  font-weight: 700; color: var(--ink-soft); text-decoration: none; font-size: 15px;
  padding: 8px 15px; border-radius: 8px; transition: .15s;
}
.nav-links a:hover { background: var(--bg-2); color: var(--ink); }

/* Tipografia */
h1.hero {
  font-family: var(--display); font-weight: 700; line-height: 1.05;
  font-size: clamp(32px, 5vw, 52px); letter-spacing: -1px; margin: 14px 0 14px;
}
h1.hero em { color: var(--accent); font-style: normal; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--ink-soft); max-width: 46ch; line-height: 1.5; }

/* Card */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px;
}

/* Form */
label { display: block; font-weight: 700; font-size: 13.5px; margin: 0 0 6px; color: var(--ink); }
input, textarea, select {
  width: 100%; font-family: var(--body); font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px; transition: .15s; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,77,155,.12); }
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }

/* Bottoni */
.btn {
  font-family: var(--body); font-weight: 700; font-size: 15px; cursor: pointer;
  border: none; border-radius: 9px; padding: 12px 22px; transition: .16s;
  background: var(--accent); color: #fff; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px -8px rgba(42,77,155,.55);
}
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 8px 14px; font-size: 13.5px; box-shadow: none; }
.btn.danger { background: #fff; color: var(--err); border: 1px solid #e8c4c0; box-shadow: none; }
.btn.danger:hover { background: #fbeeec; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 38px 20px; text-align: center;
  cursor: pointer; transition: .2s; background: #fafbfd;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #f1f5fc; }
.dropzone .plus {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 30px; display: grid; place-items: center; margin: 0 auto 14px;
  box-shadow: 0 8px 20px -8px rgba(42,77,155,.6);
}

/* Lista file */
.filelist { list-style: none; margin: 16px 0 0; }
.filelist li {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line);
}
.filelist .fname { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--ink-soft); font-size: 13px; }
.filelist .rm { cursor: pointer; color: var(--ink-soft); border: none; background: none; font-size: 19px; }
.filelist .rm:hover { color: var(--err); }
.ic { color: var(--ink-soft); }

/* Messaggi */
.alert { padding: 11px 15px; border-radius: 9px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.alert.ok { background: #e7f4ec; color: var(--ok); }
.alert.err { background: #fbeeec; color: var(--err); }
.muted { color: var(--ink-soft); font-size: 14px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.live { background: #e7f4ec; color: var(--ok); }
.pill.exp { background: #fbeeec; color: var(--err); }

/* Tabella */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 700; color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
tr:hover td { background: #f7f9fc; }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 14.5px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.spin { display: inline-block; width: 16px; height: 16px; border: 2.5px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 40px 0 30px; }

/* FTP browser */
.crumbs { font-size: 14px; color: var(--ink-soft); margin-bottom: 10px; word-break: break-all; }
.crumbs a { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 600; }
.ftp-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: default; }
.ftp-item:hover { background: #f7f9fc; }
.ftp-item .ic { width: 24px; text-align: center; }
.ftp-item.dir { cursor: pointer; }
.ftp-item .nm { flex: 1; font-weight: 600; }
.ftp-item .sz { color: var(--ink-soft); font-size: 13px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* FTP drag & drop upload */
.ftp-drop {
  border: 2px dashed var(--line); border-radius: 10px; padding: 14px 16px; text-align: center;
  font-size: 14px; color: var(--ink-soft); background: #fafbfd; transition: .2s; margin-bottom: 12px; cursor: default;
}
.ftp-drop.over { border-color: var(--accent); background: #f1f5fc; color: var(--ink); }
.ftp-drop a { color: var(--accent); cursor: pointer; font-weight: 700; }

/* Editor file FTP (modale) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,28,40,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow); padding: 18px 18px 16px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head b { font-family: var(--display); font-size: 17px; }
.modal textarea {
  flex: 1; min-height: 52vh; width: 100%;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55; resize: vertical; background: #fbfcfe; tab-size: 2;
}
.modal-foot { display: flex; gap: 8px; margin-top: 12px; }
