:root {
  --bg: #0b1220;
  --bg-accent: #111b31;
  --card: rgba(15, 23, 42, 0.92);
  --card-border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #9fb1cc;
  --primary: #4f8cff;
  --primary-strong: #2f6cf6;
  --danger: #ef5a67;
  --success: #2ecc9a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(79, 140, 255, 0.24),
      transparent 28%
    ),
    radial-gradient(
      circle at right 20%,
      rgba(46, 204, 154, 0.12),
      transparent 18%
    ),
    linear-gradient(160deg, var(--bg) 0%, #0c1528 50%, #08101d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 95%);
}

.shell,
.login-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.panel,
.login-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  border-radius: 30px;
  padding: 32px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8bb6ff;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  margin-bottom: 14px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 70ch;
}

.meta-row,
.panel-head,
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.meta-row {
  margin-top: 26px;
  color: var(--muted);
}

.meta-row a,
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
  cursor: pointer;
}

.meta-row a,
.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

button,
.button:not(.secondary) {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

button:hover,
.button:hover,
.meta-row a:hover {
  transform: translateY(-1px);
}

.button.danger {
  background: linear-gradient(135deg, #f46a76, #e84755);
}

.panel,
.login-panel {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.panel-head span,
small,
.tiny-note,
.empty-state,
label {
  color: var(--muted);
}

.upload-form,
.login-form {
  display: grid;
  gap: 16px;
}

select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.5);
  color: var(--text);
  padding: 14px 16px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.5);
  color: var(--text);
  padding: 14px 16px;
}

input[type="file"] {
  padding: 12px;
}

.file-list {
  display: grid;
  gap: 14px;
}

.file-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.13);
}

.file-main {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
}

.preview-frame {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: grid;
  place-items: center;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-label {
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: #cfe0ff;
  font-weight: 800;
}

.preview-pdf {
  background: linear-gradient(135deg, rgba(239, 90, 103, 0.18), rgba(79, 140, 255, 0.12));
}

.preview-text {
  background: linear-gradient(135deg, rgba(46, 204, 154, 0.18), rgba(79, 140, 255, 0.12));
}

.preview-none {
  background: rgba(255, 255, 255, 0.03);
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
}

.file-card h3 {
  margin-bottom: 6px;
}

.file-card p,
.file-card small {
  display: block;
  margin-bottom: 0;
  word-break: break-word;
}

.actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.actions form {
  margin: 0;
}

.alert {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(46, 204, 154, 0.14);
  border: 1px solid rgba(46, 204, 154, 0.28);
  color: #baf7e4;
}

.empty-state {
  padding: 18px 0 6px;
}

.login-body {
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
}

.tiny-note {
  margin: 16px 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .shell,
  .login-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 16px;
  }

  .hero,
  .panel,
  .login-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .file-card,
  .file-main,
  .meta-row,
  .panel-head,
  .actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-frame {
    width: 100%;
    height: 180px;
  }

  .actions {
    width: 100%;
  }

  .actions .button,
  .actions button,
  .meta-row a {
    width: 100%;
  }
}
