* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #0d0e0a; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fbc-light);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Soft brand colour behind the glass gives the blur something to refract. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #0d0e0a;
}
.backdrop i {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.backdrop i:nth-child(1) { width: 55vw; height: 55vw; top: -18vw; left: -10vw; background: rgba(193, 216, 47, 0.2); }
.backdrop i:nth-child(2) { width: 50vw; height: 50vw; bottom: -20vw; right: -8vw; background: rgba(139, 107, 61, 0.55); }
.backdrop i:nth-child(3) { width: 28vw; height: 28vw; top: 32%; left: 52%; background: rgba(155, 176, 32, 0.2); }

h1, h2 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; }
h1 { font-size: 1.9rem; }
a { color: var(--fbc-green); }

.page { max-width: 1180px; margin: 0 auto; padding: 16px 16px 64px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-radius: 22px;
  margin-bottom: 28px;
}
.logo-link { display: flex; }
/* The logo is drawn for white pages, so it keeps its colours on a light chip. */
.logo { height: 48px; display: block; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); box-shadow: inset 0 1px 0 #fff; }
.spacer { flex: 1; }
.who { font-size: 0.875rem; color: rgba(255, 255, 255, 0.75); }

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 8px 16px;
  min-height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font: 500 0.9rem var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.2); }
.btn:active { transform: scale(0.97); }
.btn.primary { color: var(--fbc-dark); background: var(--fbc-green); border-color: rgba(255, 255, 255, 0.5); font-weight: 600; }
.btn.primary:hover { background: #d0e643; }
.btn.danger { background: rgba(190, 58, 48, 0.75); }
.btn.danger:hover { background: rgba(214, 67, 55, 0.95); }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: 0.35; cursor: default; }
:focus-visible { outline: 2px solid var(--fbc-green); outline-offset: 2px; }

label { display: block; font-size: 0.78rem; font-weight: 500; color: rgba(255, 255, 255, 0.78); }

input {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 40px;
  padding: 8px 12px;
  color: #fff;
  color-scheme: dark;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font: 400 0.92rem var(--font-body);
}
input:focus { outline: none; border-color: var(--fbc-green); }
input::placeholder { color: rgba(255, 255, 255, 0.45); }
input:disabled { color: rgba(255, 255, 255, 0.55); }

/* Sign in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); padding: 32px; border-radius: 30px; }
.login-card .logo { height: 76px; margin: 0 auto 22px; }
.login-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: 6px; }
.login-card p { text-align: center; margin: 0 0 20px; color: rgba(255, 255, 255, 0.75); font-size: 0.92rem; }
.login-card .btn { width: 100%; margin-top: 14px; }

/* Slideshow list */
.heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.heading .sub { width: 100%; margin-top: -8px; color: rgba(255, 255, 255, 0.7); font-size: 0.92rem; overflow-wrap: anywhere; }
.create { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; padding: 18px; border-radius: 24px; margin-bottom: 24px; }
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.show-card { display: block; padding: 20px; border-radius: 24px; color: #fff; text-decoration: none; transition: transform 0.15s; }
.show-card:hover { transform: translateY(-2px); }
.show-card h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.show-card p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 0.875rem; overflow-wrap: anywhere; }
.empty { padding: 44px 20px; text-align: center; border-radius: 24px; color: rgba(255, 255, 255, 0.78); }

/* Upload */
.drop {
  padding: 26px;
  margin-bottom: 20px;
  text-align: center;
  border-radius: 24px;
  border-style: dashed;
  cursor: pointer;
  transition: background 0.15s;
}
.drop.over { background: rgba(193, 216, 47, 0.3); }
.drop strong { font-weight: 600; }
.drop small { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.7); }
.progress { height: 6px; margin-top: 12px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.16); }
.progress div { height: 100%; width: 0; background: var(--fbc-green); transition: width 0.15s; }

/* Slides */
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.slide-card { border-radius: 24px; padding: 10px; }
.slide-card.dragging { opacity: 0.4; }
.slide-card.drop-target { outline: 2px solid var(--fbc-green); outline-offset: 2px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; cursor: grab; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.num, .badge {
  position: absolute;
  top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.num { left: 8px; background: rgba(0, 0, 0, 0.72); color: #fff; }
.badge { right: 8px; color: #fff; background: rgba(0, 0, 0, 0.72); }
.badge.live { background: var(--fbc-green); color: var(--fbc-dark); }
.badge.scheduled { background: #e8c262; color: var(--fbc-dark); }
.fields { display: grid; gap: 8px; padding: 12px 6px 4px; }
.fields label { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; }
.fields input { margin-top: 0; }
.slide-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; align-items: center; }
.slide-actions label { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.slide-actions input { width: 76px; margin-top: 0; }
.hint { margin-left: 4px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.78); }

dialog {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  border-radius: 26px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog p { margin: 0 0 18px; overflow-wrap: anywhere; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }

#toasts { position: fixed; z-index: 20; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 16px; color: #fff; background: rgba(28, 28, 28, 0.95); border: 1px solid rgba(255, 255, 255, 0.2); max-width: 100%; overflow-wrap: anywhere; }
.toast.error { background: rgba(160, 45, 37, 0.97); }

@media (max-width: 640px) {
  .create { grid-template-columns: 1fr; }
  .logo { height: 40px; }
  .who { display: none; }
  .slide-grid, .show-grid { grid-template-columns: 1fr; }
}
