:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .95rem; }
.nav-links a:hover { color: var(--primary); }

/* ── Main ── */
main { flex: 1; max-width: 680px; margin: 0 auto; width: 100%; padding: 2rem 1rem; }

/* ── Footer ── */
footer { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: .85rem; }
footer a { color: var(--text-muted); }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* ── Hero ── */
.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: .5rem; }
.subtitle { color: var(--text-muted); }

/* ── Form ── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); margin-bottom: .375rem;
}
.hint { font-weight: 400; font-size: .8rem; }
input[type=email], input[type=text], input[type=password],
textarea, select {
  width: 100%; padding: .625rem .875rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; color: var(--text);
  background: var(--surface); transition: border .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
input[readonly] { background: var(--bg); color: var(--text-muted); cursor: default; }
textarea { resize: vertical; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2.5rem 2rem; text-align: center; cursor: pointer;
  transition: all .2s; margin-bottom: 1.25rem; position: relative;
}
.drop-zone.drag-over { border-color: var(--primary); background: rgba(79,70,229,.04); }
.drop-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.drop-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.drop-text { font-size: .95rem; color: var(--text-muted); margin-bottom: .25rem; }
.drop-text .link-text { color: var(--primary); font-weight: 500; }
.drop-hint { font-size: .8rem; color: var(--text-muted); }

/* ── File list (în dropzone) ── */
.file-list { margin-top: 1rem; text-align: left; }
.file-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .4rem .75rem; background: var(--bg);
  border-radius: 6px; margin-top: .35rem; font-size: .875rem;
}
.file-list-item .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list-item .fsize { color: var(--text-muted); margin-left: .75rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .55rem 1.25rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-weight: 500; cursor: pointer;
  text-decoration: none; color: var(--text);
  background: var(--surface); transition: all .15s;
}
.btn:hover { background: var(--bg); }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-primary:disabled { background: #a5b4fc; border-color: #a5b4fc; cursor: not-allowed; }
.btn-lg { padding: .75rem 2rem; font-size: 1rem; width: 100%; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-danger { color: var(--error); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }

/* ── Flashes ── */
.flashes { margin-bottom: 1.25rem; }
.flash {
  padding: .75rem 1rem; border-radius: 8px; margin-bottom: .5rem;
  font-size: .9rem;
}
.flash-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Download page ── */
.download-card { }
.download-header { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.5rem; }
.download-icon { font-size: 3rem; flex-shrink: 0; }
.download-header h2 { font-size: 1.2rem; margin-bottom: .25rem; word-break: break-word; }
.meta { color: var(--text-muted); font-size: .875rem; }
.message-box {
  background: var(--bg); border-left: 3px solid var(--primary);
  padding: .5rem .75rem; border-radius: 4px; margin-top: .75rem;
  font-size: .9rem; color: var(--text);
}
.file-grid { display: flex; flex-direction: column; gap: .5rem; }
.file-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border);
}
.file-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: .8rem; color: var(--text-muted); }
.download-all { margin-top: 1.25rem; text-align: center; }

/* ── Auth ── */
.auth-card { max-width: 400px; margin: 0 auto; }
.auth-card h2 { margin-bottom: 1.5rem; }
.auth-link { margin-top: 1.25rem; text-align: center; font-size: .9rem; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* ── Dashboard ── */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.dashboard-header h2 { font-size: 1.3rem; }
.transfers-list { display: flex; flex-direction: column; gap: .75rem; }
.transfer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow);
}
.transfer-card.expired { opacity: .6; }
.transfer-info { flex: 1; min-width: 0; }
.transfer-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.to-badge { font-weight: 500; font-size: .9rem; }
.transfer-details { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.transfer-link { display: flex; gap: .5rem; align-items: center; }
.link-input { font-size: .8rem; padding: .3rem .5rem; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-red   { background: #fee2e2; color: #991b1b; }
.empty-state { text-align: center; padding: 3rem; }
.empty-state > div { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1rem; }

/* ── Guest note ── */
.guest-note { text-align: center; margin-top: 1rem; font-size: .875rem; color: var(--text-muted); }
.guest-note a { color: var(--primary); }

.hidden { display: none !important; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  nav { padding: 0 1rem; }
  .card { padding: 1.25rem; }
}

/* ── Auth îmbunătățit ── */
.auth-card { max-width: 420px; margin: 0 auto; }
.auth-icon { font-size: 2.5rem; text-align: center; margin-bottom: .75rem; }
.auth-card h2 { text-align: center; margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; }

.auth-separator {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0; color: var(--text-muted); font-size: .85rem;
}
.auth-separator::before,
.auth-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-alt { text-align: center; }
.auth-alt p { color: var(--text-muted); font-size: .875rem; margin-bottom: .75rem; }

.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: rgba(79,70,229,.06); }

/* ── Progress bar ── */
.progress-wrap {
  display: flex; align-items: center; gap: .75rem;
  margin: 1rem 0; padding: .75rem 1rem;
  background: var(--bg); border-radius: 8px; border: 1px solid var(--border);
}
.progress-bar-track {
  flex: 1; height: 8px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--primary);
  border-radius: 4px; transition: width .2s ease;
}
.progress-pct {
  font-size: .85rem; font-weight: 600;
  color: var(--primary); min-width: 36px; text-align: right;
}

/* ── File list îmbunătățit ── */
.file-list-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem; background: var(--bg);
  border-radius: 6px; margin-top: .35rem; font-size: .875rem;
}
.file-list-item.file-error { background: #fee2e2; border: 1px solid #fecaca; }
.file-icon-sm { font-size: 1.1rem; flex-shrink: 0; }
.fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.ferror { color: var(--error); font-size: .8rem; white-space: nowrap; }
.file-summary {
  margin-top: .5rem; padding: .4rem .75rem;
  font-size: .85rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Upload success ── */
.upload-success {
  text-align: center; padding: 1.5rem;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: var(--radius); margin-top: 1rem;
}
.success-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.success-link {
  display: flex; gap: .5rem; align-items: center;
  margin: .75rem 0; text-align: left;
}
.success-link .link-input { font-size: .8rem; }

/* ── Upload status msg ── */
.upload-status-msg {
  font-size: .85rem; color: var(--text-muted);
  text-align: center; margin-top: .5rem;
  animation: pulse-text 1.5s infinite;
}
@keyframes pulse-text { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Progress info row ── */
.progress-info {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: .4rem; font-size: .85rem;
}
.progress-pct   { font-weight: 700; color: var(--primary); min-width: 36px; }
.progress-speed { color: var(--text-muted); }
.progress-eta   { color: var(--text-muted); margin-left: auto; }
