@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 49, 89, .35), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, .08), transparent 30%),
    linear-gradient(135deg, #140407, #08090d 55%, #19070b);
}

button, input, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.topbar,
.hero,
.upload-card,
.file-list,
.login-card {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  backdrop-filter: blur(22px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 28px;
  padding: 18px 22px;
  margin-bottom: 18px;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; letter-spacing: -1px; }
h2 { font-size: clamp(30px, 6vw, 64px); line-height: .98; letter-spacing: -3px; max-width: 760px; margin-top: 8px; }
h3 { font-size: 22px; }

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff8da0;
}

.muted { color: rgba(255,255,255,.68); }

.hero {
  border-radius: 34px;
  padding: clamp(26px, 5vw, 54px);
  min-height: 280px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -140px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(255, 55, 95, .23);
  filter: blur(20px);
}

.quota-card {
  width: min(260px, 100%);
  padding: 18px;
  border-radius: 22px;
  background: rgba(0,0,0,.2);
  position: relative;
  z-index: 1;
}

.quota-card span {
  display: block;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 10px;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff3159, #ffd1d9);
}

.upload-card {
  border-radius: 28px;
  padding: 18px;
  margin-bottom: 18px;
  align-items: center;
}

.upload-card form {
  display: flex;
  gap: 12px;
  align-items: center;
}

input[type="file"], input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.24);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

input[type="file"]::file-selector-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-right: 12px;
  font-weight: 700;
  color: #fff;
  background: #ff3159;
}

button, .actions a {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  background: #ff3159;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ghost {
  background: rgba(255,255,255,.1);
}

.file-list {
  border-radius: 28px;
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  color: rgba(255,255,255,.72);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  margin-top: 10px;
}

.file-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.12);
}

.file-main { flex: 1; min-width: 0; }
.file-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main span { display: block; font-size: 13px; color: rgba(255,255,255,.58); }

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions form { margin: 0; }
.danger { background: rgba(255,255,255,.12); }
.empty { padding: 28px; text-align: center; color: rgba(255,255,255,.6); }

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  border-radius: 34px;
  padding: 34px;
}

.login-card h1 { font-size: 38px; margin: 6px 0 8px; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
.login-card label { font-size: 13px; color: rgba(255,255,255,.7); }
.login-card button { margin-top: 8px; }

.brand-dot {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff3159, #ffd1d9);
  box-shadow: 0 0 40px rgba(255,49,89,.55);
  margin-bottom: 18px;
}

.alert {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,49,89,.16);
  border: 1px solid rgba(255,49,89,.35);
  color: #ffd4dc;
}

@media (max-width: 760px) {
  .topbar, .hero, .upload-card form, .file-row, .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar { gap: 16px; }
  .hero { align-items: start; }
  .actions a, .actions button { display: block; width: 100%; text-align: center; }
}

.dropzone {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed rgba(255,255,255,.28);
  border-radius: 24px;
  background: rgba(255,255,255,.05);
  cursor: pointer;
}

.dropzone strong {
  font-size: 18px;
}

.dropzone span {
  color: rgba(255,255,255,.58);
  font-size: 13px;
}

.dropzone input {
  margin-top: 10px;
}

.selected-files {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.selected-files div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.82);
}

.selected-files span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-files small {
  color: rgba(255,255,255,.52);
  white-space: nowrap;
}

/* CENTER FIX */
.portal-shell,
.container,
main {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.upload-card,
.upload-section,
form[action="/upload"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  gap: 22px;
}

.dropzone {
  width: min(100%, 520px);
  margin-left: auto;
  margin-right: auto;
}

.upload-card button,
.upload-section button,
form[action="/upload"] button {
  align-self: center;
}

.selected-files {
  width: min(100%, 520px);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.file-row {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.hover-preview {
  position: fixed;

  width: 340px;
  height: 220px;

  opacity: 0;
  visibility: hidden;
  transform: translate(14px, 14px) scale(.96);

  border-radius: 22px;
  overflow: hidden;

  background: rgba(20, 18, 22, .98);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 30px 90px rgba(0,0,0,.75);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  z-index: 2147483647;
  pointer-events: none;

  transition:
    opacity .14s ease,
    visibility .14s ease,
    transform .14s ease;
}

.hover-preview.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(14px, 14px) scale(1);
}

.hover-preview img,
.hover-preview iframe,
.hover-preview video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
  background: #111;
}

.preview-fallback {
  width: 100%;
  height: 100%;
  padding: 20px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;

  text-align: center;
  color: white;
}

.preview-fallback span {
  font-size: 34px;
}

.preview-fallback strong {
  max-width: 100%;
  font-size: 14px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-fallback small {
  color: rgba(255,255,255,.55);
  font-size: 12px;
}

.files-card,
.file-list,
.files-section {
  overflow: visible !important;
}

.file-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  display: grid;
  place-items: center;

  border-radius: 16px;
  font-size: 21px;

  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}

.file-icon.image {
  background: linear-gradient(135deg, rgba(255, 46, 99, .28), rgba(255, 255, 255, .08));
}

.file-icon.archive {
  background: linear-gradient(135deg, rgba(255, 176, 0, .28), rgba(255, 255, 255, .08));
}

.file-icon.video {
  background: linear-gradient(135deg, rgba(142, 84, 255, .30), rgba(255, 255, 255, .08));
}

.file-icon.audio {
  background: linear-gradient(135deg, rgba(0, 205, 172, .26), rgba(255, 255, 255, .08));
}

.file-icon.pdf {
  background: linear-gradient(135deg, rgba(255, 55, 55, .30), rgba(255, 255, 255, .08));
}

.file-icon.word {
  background: linear-gradient(135deg, rgba(64, 130, 255, .28), rgba(255, 255, 255, .08));
}

.file-icon.sheet {
  background: linear-gradient(135deg, rgba(44, 210, 117, .26), rgba(255, 255, 255, .08));
}

.file-icon.slide {
  background: linear-gradient(135deg, rgba(255, 120, 45, .28), rgba(255, 255, 255, .08));
}

.file-icon.code {
  background: linear-gradient(135deg, rgba(120, 230, 255, .22), rgba(255, 255, 255, .08));
}

.file-icon.doc {
  background: rgba(255,255,255,.08);
}

.file-list,
.files-card {
  padding-bottom: 230px;
}