:root {
  --bg-1: #1a0a2e;
  --bg-2: #2d1b4e;
  --bg-3: #0f3460;
  --accent: #e94560;
  --accent-dim: #ff6b8a;
  --text: #f4f1f8;
  --text-muted: #b8a9c9;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --spark: rgba(233, 69, 96, 0.55);
  --spark-fill: rgba(233, 69, 96, 0.12);
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 20% -10%, rgba(233, 69, 96, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(15, 52, 96, 0.5), transparent);
  z-index: 0;
}

.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.spark-deco {
  position: fixed;
  z-index: 0;
  opacity: 0.45;
  pointer-events: none;
}

.spark-deco--tl {
  top: 0;
  left: 0;
  width: min(420px, 90vw);
  height: 120px;
}

.spark-deco--br {
  bottom: 0;
  right: 0;
  width: min(380px, 85vw);
  height: 100px;
  transform: rotate(180deg);
}

.spark-deco svg {
  width: 100%;
  height: 100%;
  display: block;
}

.spark-path {
  fill: none;
  stroke: var(--spark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-area {
  fill: var(--spark-fill);
  stroke: none;
}

header.site-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--accent-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 28rem;
  line-height: 1.45;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

a {
  color: var(--accent-dim);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c73e54);
  color: #fff;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(233, 69, 96, 0.45);
  text-decoration: none;
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.file-name {
  font-weight: 500;
  word-break: break-word;
}

.empty-hint {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

form.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

input[type="file"] {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type="password"],
input[type="text"] {
  width: 100%;
  max-width: 320px;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.error-msg {
  color: var(--accent-dim);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.btn-danger {
  background: transparent;
  color: var(--accent-dim);
  border: 1px solid rgba(233, 69, 96, 0.4);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-danger:hover {
  background: rgba(233, 69, 96, 0.15);
}

.mini-spark {
  display: inline-block;
  vertical-align: middle;
  width: 72px;
  height: 28px;
  margin-left: 0.5rem;
  opacity: 0.85;
}

.mini-spark svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Upload progress (admin) */
.fus-progress-wrap {
  margin-top: 1.15rem;
}

.fus-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fus-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.fus-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c73e54, var(--accent), var(--accent-dim));
  background-size: 200% 100%;
  transition: width 0.15s ease-out;
}

.fus-progress-wrap--busy .fus-progress-fill {
  box-shadow: 0 0 16px rgba(233, 69, 96, 0.35);
}

.fus-progress-indeterminate .fus-progress-fill {
  width: 35% !important;
  animation: fus-progress-pulse 1.1s ease-in-out infinite;
}

@keyframes fus-progress-pulse {
  0% {
    transform: translateX(-30%);
    opacity: 0.85;
  }
  50% {
    transform: translateX(190%);
    opacity: 1;
  }
  100% {
    transform: translateX(410%);
    opacity: 0.85;
  }
}
