/* PFlix — dark, quiet, out of the way of the artwork. */

:root {
  --bg: #08080b;
  --bg-2: #0e0e13;
  --surface: #15151c;
  --surface-2: #1c1c26;
  --line: #262633;
  --text: #f4f4f7;
  --muted: #8e8ea3;
  --muted-dim: #5f5f72;
  --accent: #ff4d8d;
  --accent-2: #8b5cf6;
  --danger: #ff5c5c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --font: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 77, 141, .10), transparent 62%),
    radial-gradient(900px 560px at 92% 6%, rgba(139, 92, 246, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.screen { min-height: 100dvh; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ */
/* brand                                                              */
/* ------------------------------------------------------------------ */

.brand { display: flex; align-items: baseline; gap: 4px; }

.brand-mark {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.8px;
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

/* ------------------------------------------------------------------ */
/* boot                                                               */
/* ------------------------------------------------------------------ */

.boot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.boot-mark {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.4px;
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid rgba(255, 255, 255, .12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.boot-text { color: var(--muted-dim); font-size: 14px; margin: 0; }

/* ------------------------------------------------------------------ */
/* auth                                                               */
/* ------------------------------------------------------------------ */

.auth {
  display: grid;
  place-items: center;
  padding: 32px 20px 64px;
  position: relative;
}

.auth-glow {
  position: fixed;
  inset: auto auto 0 50%;
  transform: translateX(-50%);
  width: min(760px, 96vw);
  height: 320px;
  background: radial-gradient(closest-side, rgba(255, 77, 141, .14), transparent);
  filter: blur(20px);
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(28, 28, 38, .92), rgba(17, 17, 23, .96));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 32px 28px;
  box-shadow: var(--shadow);
}

.auth-card .brand { margin-bottom: 26px; }

.auth-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.5px;
  margin: 0 0 5px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 26px;
}

.field { display: block; margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: .2px;
}

.field-label em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted-dim);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field input:hover { border-color: #34344a; }

.field input:focus {
  border-color: var(--accent);
  background: #101016;
  box-shadow: 0 0 0 3px rgba(255, 77, 141, .16);
}

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 62px; }

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.pw-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted-dim);
  margin-top: 6px;
}

.form-error {
  background: rgba(255, 92, 92, .1);
  border: 1px solid rgba(255, 92, 92, .3);
  color: #ffb3b3;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 14px;
}

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: filter .15s, transform .08s;
}

.btn-primary:hover { filter: brightness(1.09); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; filter: none; }

.btn-spin {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 20px 0 0;
}

.link {
  background: none;
  border: 0;
  padding: 0 0 0 5px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
}

.link:hover { text-decoration: underline; }

.auth-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(139, 92, 246, .09);
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: var(--radius-sm);
}

.offline-note {
  position: relative;
  margin: 18px 0 0;
  font-size: 13px;
  color: #ffb3b3;
}

/* ------------------------------------------------------------------ */
/* home                                                               */
/* ------------------------------------------------------------------ */

.home { display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 11, .72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.who { font-size: 13.5px; color: var(--muted); }
.who strong { color: var(--text); font-weight: 650; }

.btn-ghost {
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.btn-ghost:hover { color: var(--text); border-color: #3a3a52; background: rgba(255, 255, 255, .04); }

.home-main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 56px) 40px;
}

.home-head { margin-bottom: 26px; }

.home-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -1px;
  margin: 0 0 6px;
}

.home-sub { color: var(--muted); font-size: 14.5px; margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 2.2vw, 24px);
}

.card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .7, .3, 1), border-color .18s, box-shadow .18s;
}

.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--accent));
  box-shadow: 0 16px 44px rgba(0, 0, 0, .5), 0 0 0 1px var(--card-accent, var(--accent));
  outline: none;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s cubic-bezier(.2, .7, .3, 1);
}

.card:hover .card-media img { transform: scale(1.045); }

.card-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 34%, rgba(8, 8, 11, .82) 100%);
}

.card-name {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .8);
}

.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 15px;
}

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

.card-count {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--card-accent, var(--accent));
  white-space: nowrap;
}

.card-count.empty { color: var(--muted-dim); }

.card.unavailable { cursor: default; }
.card.unavailable .card-media img { filter: grayscale(.75) brightness(.6); }
.card.unavailable:hover { transform: none; box-shadow: none; border-color: var(--line); }
.card.unavailable:hover .card-media img { transform: none; }

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(8, 8, 11, .82);
  border: 1px solid var(--line);
  color: var(--muted);
  backdrop-filter: blur(6px);
}

.badge.warn { color: #ffc978; border-color: rgba(255, 201, 120, .35); }

.image-hint {
  margin: 30px 0 0;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
}

.image-hint code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: #d8d8e6;
  background: rgba(255, 255, 255, .05);
  padding: 2px 6px;
  border-radius: 5px;
}

.foot {
  padding: 16px clamp(20px, 5vw, 56px) 26px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-dim);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.foot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.addr-label {
  font-weight: 650;
  color: var(--muted);
}

.addr-url {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: #d8d8e6;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.addr-url:hover { color: #fff; border-color: var(--accent-2); background: rgba(139, 92, 246, .12); }

.addr-alt { color: var(--muted-dim); }

.addr-alt code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  color: var(--muted);
}

.addr-changed { color: #ffc978; }

.dot-ok, .dot-bad {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}

.dot-ok { background: #3ddc84; box-shadow: 0 0 9px rgba(61, 220, 132, .6); }
.dot-bad { background: var(--danger); box-shadow: 0 0 9px rgba(255, 92, 92, .6); }

/* ------------------------------------------------------------------ */
/* toast                                                              */
/* ------------------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 14px);
  max-width: min(460px, 92vw);
  padding: 13px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 560px) {
  .auth-card { padding: 28px 22px 24px; }
  .card-name { font-size: 20px; }
}

/* ------------------------------------------------------------------ */
/* the master's way in                                                */
/* ------------------------------------------------------------------ */

/* Deliberately quiet. It sits under the sign-in card because that is where
   the master was told to look for it, and it is dim because nobody else has
   any use for it - the page behind it asks for a code before it shows
   anything at all. */
.master-link {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.master-link a {
  color: var(--dim, #8b8b9e);
  text-decoration: none;
  opacity: .55;
  transition: opacity .15s, color .15s;
}
.master-link a:hover,
.master-link a:focus-visible { opacity: 1; color: var(--accent, #ff4d8d); }

/* ------------------------------------------------------------------ */
/* the gate screen                                                    */
/* ------------------------------------------------------------------ */

#accessCode {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
}
#gate .auth-switch { gap: 8px; }

/* ------------------------------------------------------------------ */
/* sending a video in                                                 */
/* ------------------------------------------------------------------ */

.send-dlg {
  width: min(460px, 92vw);
  border: 1px solid var(--line, #2a2a38);
  border-radius: 16px;
  background: var(--panel, #14141c);
  color: inherit;
  padding: 26px 24px 22px;
}
.send-dlg::backdrop { background: rgba(0, 0, 0, .72); }
.send-dlg h3 { margin: 0 0 6px; font-size: 18px; }
.send-note { margin: 0 0 18px; font-size: 13px; color: var(--dim, #8b8b9e); line-height: 1.5; }
.send-dlg .opt { opacity: .6; text-transform: none; letter-spacing: 0; }
.send-dlg input[type="file"] { padding: 9px; font-size: 13px; }

.send-progress { display: flex; align-items: center; gap: 11px; margin-top: 16px; }
.send-bar { flex: 1; height: 6px; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.08); }
.send-fill { height: 100%; width: 0; background: var(--accent, #ff4d8d); transition: width .18s ease-out; }
.send-pct { font-size: 12px; color: var(--dim, #8b8b9e); white-space: nowrap; font-variant-numeric: tabular-nums; }

.send-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.send-mine { margin-top: 20px; }
.send-mine h4 {
  margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .09em; color: var(--dim, #8b8b9e); font-weight: 600;
}
.send-mine-row {
  font-size: 13px; padding: 6px 0;
  border-top: 1px solid var(--line, #2a2a38);
  color: var(--dim, #8b8b9e);
}

/* ------------------------------------------------------------------ */
/* today's internet address                                           */
/* ------------------------------------------------------------------ */

/* Given more weight than the Wi-Fi address on purpose: this is the one that
   is regenerated on every restart, so it is the one people come here to look
   up. The Wi-Fi address they mostly already know. */
.public-addr {
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.public-addr .addr-url {
  color: var(--accent, #ff4d8d);
  font-weight: 600;
  word-break: break-all;
  text-align: left;
}
.public-addr .addr-label {
  color: var(--dim, #8b8b9e);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* what kind of upload is it                                          */
/* ------------------------------------------------------------------ */

/* Three plain radios rather than a dropdown: there are only ever three
   choices, and a closed dropdown hides the fact that a choice was made at
   all - which is how files end up in the wrong folder. */
.send-type {
  border: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.send-type legend {
  padding: 0;
  margin-bottom: 8px;
  float: left;
  width: 100%;
}
.send-type label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line, #2a2a38);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.send-type label:hover { border-color: var(--accent, #ff4d8d); }
.send-type input { accent-color: var(--accent, #ff4d8d); margin: 0; }
.send-type label:has(input:checked) {
  border-color: var(--accent, #ff4d8d);
  background: rgba(255, 77, 141, .12);
}

/* ------------------------------------------------------------------ */
/* a locked category                                                  */
/* ------------------------------------------------------------------ */

/* Dimmed and desaturated rather than hidden. Somebody who cannot get in
   should be able to see that the door exists - otherwise there is nothing
   to click to ask for the key. */
.card.locked .card-media img { filter: grayscale(1) brightness(.45); }
.card.locked { opacity: .85; }
.card.locked:hover { opacity: 1; }

.card-lock {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8));
}

#dxCode {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
}
