/* Shared theme for the sign-in page and the /files/ browser */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080b10;
  --surface:   #0e1318;
  --border:    rgba(255,255,255,0.07);
  --accent:    #00a4dc;
  --accent2:   #0073a8;
  --warn:      #e05252;
  --ok:        #3ccf8e;
  --text:      #d8e0e8;
  --muted:     #5a6470;
  --glow:      rgba(0,164,220,0.18);
  --radius:    10px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
}

/* ── Cinematic background ── */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,   rgba(0,80,120,0.35) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 90% 80%,  rgba(0,40,80,0.4)  0%, transparent 65%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(0,0,0,0.6)    0%, transparent 100%),
    var(--bg);
}
.bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}
.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    transparent 0px, transparent 3px, rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px);
}

/* ── Layout ── */
.page {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, rgba(14,19,24,0.95), rgba(8,11,16,0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03), 0 24px 80px rgba(0,0,0,0.7), 0 0 60px var(--glow);
  padding: 44px 40px 36px;
  animation: cardIn 0.6s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo ── */
.logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; animation: fadeUp 0.5s 0.1s both; }
.logo-wrap a { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-icon { width: 40px; height: 40px; flex-shrink: 0; }
.logo-text { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 0.08em; color: #fff; line-height: 1; }
.logo-text span { color: var(--accent); }

/* ── Disclaimer / notices ── */
.disclaimer {
  background: rgba(224,82,82,0.08);
  border: 1px solid rgba(224,82,82,0.3);
  border-left: 3px solid var(--warn);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 24px;
  animation: fadeUp 0.5s 0.18s both;
}
.disclaimer-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--warn); margin-bottom: 5px;
}
.disclaimer p { font-size: 12px; font-weight: 300; line-height: 1.6; color: rgba(216,224,232,0.65); }

.notice { font-size: 13px; border-radius: 8px; padding: 10px 14px; margin-bottom: 20px; border: 1px solid; }
.notice.bad  { color: #ff8a8a; background: rgba(224,82,82,0.10); border-color: rgba(224,82,82,0.35); }
.notice.good { color: var(--ok); background: rgba(60,207,142,0.08); border-color: rgba(60,207,142,0.3); }
.notice.info { color: var(--accent); background: rgba(0,164,220,0.08); border-color: rgba(0,164,220,0.3); }

/* ── Form ── */
.form-group { margin-bottom: 18px; animation: fadeUp 0.5s both; }
.form-group:nth-of-type(1) { animation-delay: 0.22s; }
.form-group:nth-of-type(2) { animation-delay: 0.28s; }
label {
  display: block; font-size: 11.5px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.input-wrap { position: relative; }
.input-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); transition: color var(--transition); pointer-events: none;
}
input[type=text], input[type=password] {
  width: 100%;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 12px 42px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input::placeholder { color: var(--muted); }
input:focus { border-color: var(--accent); background: rgba(0,164,220,0.05); box-shadow: 0 0 0 3px rgba(0,164,220,0.12); }
.input-wrap:focus-within svg { color: var(--accent); }
.hint { font-size: 12px; font-weight: 300; color: var(--muted); margin: 4px 0 20px; animation: fadeUp 0.5s 0.34s both; }

/* ── Buttons ── */
.btn-primary, .btn {
  border: none; border-radius: var(--radius); color: #fff; cursor: pointer;
  font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.15em;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition), background var(--transition);
}
.btn-primary {
  width: 100%; padding: 13px; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 4px 24px rgba(0,164,220,0.3);
  animation: fadeUp 0.5s 0.42s both;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(0,164,220,0.45); filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); filter: brightness(0.95); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 15px; text-decoration: none;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
}
.btn:hover { background: rgba(0,164,220,0.12); border-color: rgba(0,164,220,0.4); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }

/* ── Footer ── */
.footer {
  margin-top: 28px; text-align: center; font-size: 11px; font-weight: 300; line-height: 1.8;
  color: var(--muted); letter-spacing: 0.04em; animation: fadeUp 0.5s 0.5s both;
}
.footer a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); word-break: break-all; }
.footer a:hover { opacity: 0.75; }

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

@media (max-width: 480px) {
  .card { padding: 32px 24px 28px; }
}

/* ═════════ /files/ browser ═════════ */
body.files .page { place-items: start center; }
.panel {
  position: relative; z-index: 2;
  width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 16px 48px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar .logo-wrap { margin-bottom: 0; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; word-break: break-all; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed rgba(0,164,220,0.35);
  border-radius: 14px;
  background: rgba(0,164,220,0.04);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 16px;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.over {
  background: rgba(0,164,220,0.10); border-color: var(--accent); box-shadow: 0 0 40px var(--glow); outline: none;
}
.dropzone svg { color: var(--accent); }
.dropzone strong { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 0.1em; color: #fff; font-weight: 400; }
.dropzone span { font-size: 13px; color: var(--muted); }

/* full-window overlay while dragging files over the page */
.drop-overlay {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center;
  background: rgba(8,11,16,0.85); border: 3px dashed var(--accent);
  font-family: 'Bebas Neue', sans-serif; font-size: 40px; letter-spacing: 0.12em; color: #fff;
  pointer-events: none;
}
body.dragging .drop-overlay { display: grid; }

.queue { list-style: none; margin-bottom: 16px; display: grid; gap: 8px; }
.queue li {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 13px;
}
.queue .row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.queue .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .state { color: var(--muted); flex-shrink: 0; }
.queue .done .state { color: var(--ok); }
.queue .fail .state { color: #ff8a8a; }
.bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.15s; }
.queue .done .bar i { background: var(--ok); }
.queue .fail .bar i { background: var(--warn); }

/* Apache autoindex table */
.listing {
  background: linear-gradient(145deg, rgba(14,19,24,0.95), rgba(8,11,16,0.98));
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  overflow-x: auto;
}
.listing table { width: 100%; border-collapse: collapse; font-size: 14px; }
.listing th, .listing td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.listing th { font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.listing th a { color: var(--muted); text-decoration: none; }
.listing th a:hover { color: var(--accent); }
.listing td { border-bottom: 1px solid rgba(255,255,255,0.03); color: rgba(216,224,232,0.7); }
.listing td:nth-child(2) { width: 100%; white-space: normal; word-break: break-all; }
.listing td a { color: var(--text); text-decoration: none; }
.listing td a:hover { color: var(--accent); }
.listing tr:hover td { background: rgba(0,164,220,0.04); }
.listing td.indexcolicon, .listing th.indexcolicon { width: 1px; padding-right: 0; }
.listing td.indexcolicon img, .listing th.indexcolicon img { filter: invert(0.8) sepia(1) hue-rotate(160deg); opacity: 0.8; }
.listing tr:has(hr), .listing hr { display: none; }
.listing td.indexcollastmod, .listing td.indexcolsize { font-variant-numeric: tabular-nums; }
.listing td.indexcolsize { text-align: right; }

@media (max-width: 640px) {
  .listing td.indexcollastmod, .listing th.indexcollastmod { display: none; }
}
