/* Shared base for every member site: colours, type, buttons, form fields, message box, spinner.
   No url() to any external host. */

@font-face {
  font-family: "Nunito Sans";
  src: url(../fonts/nunito-sans-latin-wght.woff2) format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  line-height: 1;
  font-size: 100%;
  border: 0;
  box-sizing: border-box;
  min-height: 0;
  min-width: 0;
  font-weight: 400;
}

[hidden] {
  display: none !important;
}

::placeholder {
  color: inherit;
  opacity: .65;
}

a {
  color: inherit;
}

strong {
  font-weight: 700;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
  background: 0 0;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

:root {
  --color-brand: #1E8DC7;
  --color-gray: #272727;
  --color-error: #ff6b6b;
  --color-success: #5ad18a;
  --color-info: #8cc8ea;
  --color-warning: #f5b942;
}

html {
  scroll-behavior: smooth;
  background: #141414;
}

body {
  background: #000;
  color: #fff;
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
}

p,
li,
label,
td,
legend {
  line-height: 1.4em;
}

/* ---- layout helpers ---- */

.inner {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.muted {
  opacity: .75;
}

.small {
  font-size: 14px;
}

/* ---- buttons and fields ---- */

.button {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 12px;
  border: 0;
  background: var(--color-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.button.button-small {
  font-size: 12px;
  padding: 5px 10px;
  min-height: 0;
}

.button:disabled,
.link-button:disabled,
input:disabled,
button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.link-button {
  display: inline-block;
  min-height: 44px;
  padding: 10px 4px;
  text-decoration: underline;
  font-size: 16px;
}

.input {
  padding: 6px;
  border-radius: 4px;
  background: #444;
  color: #fff;
  border: .5px solid #fff;
  font-size: 16px;
}

:focus-visible {
  outline: 2px solid #1e8dc7;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #fff;
}

/* Larger touch targets on phones only; desktop keeps the original compact fields and buttons. */
@media (max-width: 700px) {
  .button,
  .input {
    min-height: 44px;
  }

  .button.button-small {
    min-height: 0;
  }
}

/* Screen headings are focused by script on a screen change (for screen readers); no ring is drawn for that. */
[tabindex="-1"]:focus {
  outline: none;
  box-shadow: none;
}

/* ---- message box (replaces sweetalert) ---- */

.notice {
  --notice-color: var(--color-info);
  --notice-tint: rgba(30, 141, 199, .18);
  /* Shown as a floating message under the logo, the same place on every screen, never inside a card. */
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: min(560px, calc(100vw - 30px));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--notice-color);
  background: linear-gradient(var(--notice-tint), var(--notice-tint)), #1b1b1b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
  color: #fff;
  animation: notice-in .2s ease-out;
  font-size: 15px;
  text-align: left;
  line-height: 1.4em;
}

.notice[hidden] {
  display: none;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice {
    animation: none;
  }
}

@media (max-width: 700px) {
  .notice {
    top: 12px;
  }
}

/* Round badge in front of the text: i, ! or a tick. The kind is never shown by colour alone. */
.notice::before {
  content: "i";
  flex: 0 0 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--notice-color);
  color: #000;
  font-size: 13px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.notice--error {
  --notice-color: var(--color-error);
  --notice-tint: rgba(255, 107, 107, .16);
}

.notice--error::before {
  content: "!";
}

.notice--success {
  --notice-color: var(--color-success);
  --notice-tint: rgba(90, 209, 138, .16);
}

.notice--success::before {
  content: "\2713";
}

/* ---- callout: a message that stays in the page (the floating .notice above is for short-lived messages) ---- */

.callout {
  --callout-color: var(--color-info);
  --callout-tint: rgba(30, 141, 199, .18);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--callout-color);
  background: linear-gradient(var(--callout-tint), var(--callout-tint)), #1b1b1b;
  color: #fff;
  font-size: 15px;
  text-align: left;
  line-height: 1.4em;
}

.callout[hidden] {
  display: none;
}

/* Same round badge as .notice; the kind is never shown by colour alone. */
.callout::before {
  content: "i";
  flex: 0 0 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--callout-color);
  color: #000;
  font-size: 13px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.callout--warning {
  --callout-color: var(--color-warning);
  --callout-tint: rgba(245, 185, 66, .16);
}

.callout--warning::before {
  content: "!";
}

/* ---- error dialog (replaces sweetalert; same look as the original site's pop-up) ---- */

.dialog {
  margin: auto;
  width: min(480px, calc(100vw - 30px));
  padding: 45px 30px 20px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #000;
  color: #fff;
  text-align: center;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .6);
}

.dialog p {
  font-size: 16px;
  line-height: 1.4em;
  margin-bottom: 30px;
}

/* ---- Turnstile ---- */

/* No space is reserved while the check is hidden. turnstile.js adds "is-shown" while Cloudflare shows the box
   (page CSS cannot style the widget itself), and only then is it spaced from the fields around it. */
.turnstile {
  min-width: 0;
  max-width: 100%;
}

.turnstile.is-shown {
  margin-top: 15px;
}

/* ---- spinner overlay ---- */

@keyframes busy-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.busy-overlay {
  display: none;
}

html.is-busy .busy-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, .85) url(../img/spinner.svg) no-repeat center;
  background-size: 50px;
}

.busy-text {
  margin-top: 110px;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.is-busy .busy-overlay {
    background-image: none;
  }

  /* No spinning for people who turned animations off, but not frozen either: the ring fades in and out
     so it still reads as "working" (a still ring looked like the page had hung). */
  html.is-busy .busy-overlay::before {
    content: "";
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 4px solid var(--color-brand);
    animation: busy-pulse 1.6s ease-in-out infinite;
  }

  .busy-text {
    margin-top: 20px;
  }
}
