:root {
  /* Palette from the PlumExternal "Halfway Out" logo. */
  --bg: #140612;
  --bg-glow: #2b0c28;
  --card: #1d0a1a;
  --card-border: #36172f;
  --input-border: #4a2443;
  --input-focus: #e2b3d6;
  --text: #f3f0ec;
  --muted: #bba7b6;
  --faint: #8f7689;
  --button: #e2b3d6;
  --button-hover: #edc8e3;
  --button-text: #2b0c28;
  --error: #ff8f8f;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: var(--input-border) transparent;
}

::selection {
  background: rgb(226 179 214 / 0.32);
  color: var(--text);
}

input,
textarea {
  caret-color: var(--button);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.stack {
  width: 100%;
  max-width: 408px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 40px 24px 22px;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.6);
  text-align: center;
}

.logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 30px;
}

h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 6px 0 24px;
  font-size: 14px;
  color: var(--muted);
}

.input {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 120ms ease;
}

.input::placeholder {
  color: var(--faint);
}

.input:focus {
  border-color: var(--input-focus);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.error {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--error);
  text-align: left;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease;
}

.button:hover:not(:disabled) {
  background: var(--button-hover);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button:focus-visible,
.footer a:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 2px;
}

.fine {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.success-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}

.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding: 0 2px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 16px;
}

/* On narrow screens the links drop to their own line instead of squeezing. */
.footer {
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer > *,
.footer-links a {
  white-space: nowrap;
}

.footer a {
  color: var(--muted);
}

/* Placeholder links with no destination yet. */
.footer a:not([href]) {
  text-decoration: underline;
  cursor: default;
}

.footer a:hover {
  color: var(--text);
}

/* ---------- Top bar shared by the configs and wiki pages ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--page-width, 1120px);
  margin: 0 auto;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 152px;
  height: auto;
}

/* "plumexternal | Wiki" style label next to the logo. */
.brand-section {
  margin-top: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--input-border);
  line-height: 20px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-text-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms ease;
}

.topbar-text-link:hover,
.topbar-text-link[aria-current="page"] {
  color: var(--text);
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.topbar-link:hover {
  border-color: var(--input-border);
}

.brand:focus-visible,
.topbar-link:focus-visible,
.topbar-text-link:focus-visible {
  outline: 2px solid var(--input-focus);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .brand img {
    width: 120px;
  }
  .brand-section {
    padding-left: 10px;
  }
  /* "Download loader" becomes "Loader" on phones. */
  .wide-only {
    display: none;
  }
}

/* Small phones (360px): logo, section label and two links still fit on one row. */
@media (max-width: 400px) {
  .topbar {
    gap: 8px;
  }
  .brand {
    gap: 8px;
  }
  .brand img {
    width: 104px;
  }
  .brand-section {
    padding-left: 8px;
  }
  .topbar-nav {
    gap: 2px;
  }
  .topbar-text-link {
    padding: 0 8px;
  }
  .topbar-link {
    padding: 0 12px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.turnstile {
  margin-top: 16px;
  min-height: 65px;
}

.turnstile:empty {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  h1 {
    font-size: 22px;
  }
}
