/* ── Persian font: Vazirmatn (self-hosted) ─────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f4fb;
  --card: rgba(255, 255, 255, 0.84);
  --ink: #22263b;
  --muted: #6b7280;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --accent-line: rgba(99, 102, 241, 0.18);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.1);
  --err: #e11d48;
  --err-soft: rgba(225, 29, 72, 0.08);
  --line: #e6e8f2;
  --shadow: 0 24px 60px -18px rgba(67, 56, 202, 0.25);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(56, 189, 248, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.7;
}

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.blob-1 {
  width: 340px;
  height: 340px;
  background: rgba(99, 102, 241, 0.28);
  top: -90px;
  right: -70px;
}

.blob-2 {
  width: 280px;
  height: 280px;
  background: rgba(139, 92, 246, 0.24);
  bottom: -80px;
  left: -60px;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: rgba(56, 189, 248, 0.22);
  top: 40%;
  left: 55%;
}

.card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: rise 0.5s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.55);
}

.brand-icon svg {
  width: 26px;
  height: 26px;
}

.brand-text h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.upload-area {
  display: grid;
  gap: 14px;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 20px;
  border: 2px dashed var(--accent-line);
  border-radius: 18px;
  background: var(--accent-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.14);
  transform: scale(1.015);
  box-shadow: 0 12px 30px -12px rgba(99, 102, 241, 0.45);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.5);
}

.drop-icon svg {
  width: 28px;
  height: 28px;
}

.drop-title {
  font-size: 15.5px;
  font-weight: 700;
}

.drop-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
}

.file-chip-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.file-chip-icon svg {
  width: 22px;
  height: 22px;
}

.file-chip-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.file-chip-name {
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
}

.file-chip-detail {
  color: var(--muted);
  font-size: 12.5px;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button svg {
  width: 19px;
  height: 19px;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(99, 102, 241, 0.65);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #eceefc;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}

.progress-label {
  color: var(--muted);
  font-size: 12.5px;
  min-width: 42px;
  text-align: left;
}

.status {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  min-height: 20px;
  transition: background 0.2s ease, color 0.2s ease;
}

.status.ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.status.err {
  color: var(--err);
  background: var(--err-soft);
}

.recent {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.slot-badge {
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.file-list li:hover {
  border-color: var(--accent-line);
  box-shadow: 0 8px 20px -14px rgba(67, 56, 202, 0.35);
}

.file-list-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.file-list-icon svg {
  width: 21px;
  height: 21px;
}

.file-list-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fname {
  font-size: 13.5px;
  font-weight: 700;
  word-break: break-all;
}

.fmeta {
  color: var(--muted);
  font-size: 12px;
}

.card-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.45);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 480px) {
  body {
    padding: 14px;
  }
  .card {
    padding: 20px;
  }
  .drop-zone {
    padding: 26px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
