:root {
  --bg: #141414;
  --bg-raise: #1a1a1a;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-strong: rgba(255, 255, 255, 0.05);
  --border: #262626;
  --border-strong: #2f2f2f;
  --fg: #fafafa;
  --muted: #8d8d8d;
  --dim: #414141;
  --neon: #ceff00;
  --neon-soft: rgba(206, 255, 0, 0.12);
  --danger: #ff0101;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(60, 60, 60, 0.35) 0%, rgba(20, 20, 20, 0) 55%),
    radial-gradient(ellipse at 50% 120%, rgba(206, 255, 0, 0.05) 0%, rgba(20, 20, 20, 0) 45%);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----- header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
}

.site-logo img {
  height: 26px;
  width: auto;
  display: block;
  filter: invert(1);
}

.site-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
}

/* ----- main layout ----- */

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem 1.5rem 3rem;
}

.container {
  width: 100%;
  max-width: 500px;
}

/* ----- hero ----- */

.hero {
  margin-bottom: 2.5rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0 0 1.5rem;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--neon);
  display: inline-block;
}

.eyebrow.is-muted {
  color: var(--muted);
}

.eyebrow.is-muted::before {
  background: var(--muted);
}

.eyebrow.is-danger {
  color: var(--danger);
}

.eyebrow.is-danger::before {
  background: var(--danger);
}

h1 {
  font-family: var(--font-sans);
  font-size: 4.25rem;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 1.5rem;
  color: var(--fg);
}

h1.is-large {
  font-size: 5.25rem;
}

.subtitle {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.55;
  margin: 0;
  max-width: 44ch;
}

/* ----- sections / labels ----- */

section {
  margin-bottom: 2.25rem;
}

section:last-of-type {
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.runtime-note,
.integration-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.5rem 0;
}

.runtime-note code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg);
}

/* ----- form fields ----- */

form {
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.field label,
.field-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.field input {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--fg);
  padding: 0.95rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

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

.field input:hover {
  border-color: var(--dim);
}

.field input:focus {
  border-color: var(--neon);
  background: var(--panel-strong);
}

.field-value {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--fg);
  padding: 0.4rem 0;
}

/* ----- buttons ----- */

button,
.btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.08s ease;
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

/* primary CTA — solid neon (submit-btn) */
.btn-primary,
button[type="submit"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  background: var(--neon);
  color: #0b0b0b;
  border: 0;
  padding: 1.05rem 1.3rem;
}

.btn-primary .btn-icons,
button[type="submit"] .btn-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.btn-primary:hover:not(:disabled),
button[type="submit"]:hover:not(:disabled) {
  background: #e4ff4d;
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled),
button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled,
button[type="submit"]:disabled {
  background: var(--bg-raise);
  color: var(--dim);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.btn-primary:disabled .btn-icons,
button[type="submit"]:disabled .btn-icons {
  color: var(--dim);
}

/* secondary / outline (location-btn, back link) */
.btn-outline,
button.btn-outline,
#location-btn {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  padding: 0.7rem 1.1rem;
}

.btn-outline:hover:not(:disabled),
#location-btn:hover:not(:disabled) {
  border-color: var(--fg);
  background: var(--panel);
}

.btn-outline:disabled,
#location-btn:disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.form-actions {
  margin-top: 1.75rem;
}

.location-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ----- widget slot ----- */

.widget-slot {
  margin-bottom: 0.25rem;
}

/* dark-theme overrides for the mcl-loader widget */
#status.mcl-widget {
  background: var(--panel);
  border-color: var(--border-strong);
  box-shadow: none;
  color: var(--fg);
}

#status.mcl-widget .status-title {
  color: var(--fg);
}

#status.mcl-widget .status-subtitle {
  color: var(--muted);
}

#status.mcl-widget .status-brand {
  color: var(--muted);
}

#status.mcl-widget .status-brand-logo svg path {
  fill: var(--fg);
}

#status.mcl-widget .status-checkbox {
  background: var(--bg-raise);
  border-color: var(--border-strong);
}

#status.mcl-widget .status-check::before {
  border-color: #0b0b0b;
}

#status.mcl-widget .status-spinner::before {
  border-color: rgba(255, 255, 255, 0.18);
  border-top-color: var(--neon);
}

#status.mcl-widget .status-action {
  color: var(--fg);
  border-color: var(--border-strong);
}

#status.mcl-widget .status-action:hover {
  background: var(--panel-strong);
}

#status.mcl-widget.idle .status-checkbox {
  background: var(--bg-raise);
  border-color: var(--border-strong);
}

#status.mcl-widget.idle .status-checkbox:hover {
  border-color: var(--neon);
}

#status.mcl-widget.verifying .status-checkbox {
  background: var(--bg-raise);
  border-color: var(--neon);
}

#status.mcl-widget.verified .status-checkbox {
  background: var(--neon);
  border-color: var(--neon);
  box-shadow: 0 0 0 4px rgba(206, 255, 0, 0.18);
}

#status.mcl-widget.verified {
  border-color: rgba(206, 255, 0, 0.6);
  box-shadow: 0 0 28px rgba(206, 255, 0, 0.22), 0 12px 34px rgba(206, 255, 0, 0.14);
}

#status.mcl-widget.err {
  background: rgba(255, 1, 1, 0.06);
  border-color: rgba(255, 1, 1, 0.4);
}

#status.mcl-widget.err .status-title {
  color: #ff6b6b;
}

#status.mcl-widget.err .status-action {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

/* ----- integration snippet ----- */

.integration-details {
  border: 1px solid var(--border-strong);
  background: var(--panel);
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
}

.integration-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.integration-details summary::-webkit-details-marker {
  display: none;
}

.integration-details summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--muted);
  transition: transform 0.2s ease;
}

.integration-details[open] summary {
  color: var(--fg);
  margin-bottom: 0.9rem;
}

.integration-details[open] summary::after {
  content: "–";
}

.integration-details pre {
  margin: 0;
  padding: 1rem;
  background: #0b0b0b;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

/* ----- result page ----- */

.signed-as {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--muted);
  margin: 0 0 3rem;
}

.signed-as strong {
  color: var(--fg);
  font-weight: 500;
}

.signed-as code {
  color: var(--neon);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.assessment-box {
  border: 1px solid var(--border-strong);
  padding: 1.25rem;
  background: #0b0b0b;
  border-radius: 4px;
  max-height: 360px;
  overflow: auto;
}

.assessment-box pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-all;
}

.error-box {
  border: 1px solid rgba(255, 1, 1, 0.35);
  border-left: 3px solid var(--danger);
  background: rgba(255, 1, 1, 0.05);
  padding: 1rem 1.25rem;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  border-radius: 4px;
}

.warning-banner {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 1, 1, 0.35);
  border-left: 3px solid var(--danger);
  background: rgba(255, 1, 1, 0.05);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  border-radius: 4px;
}

.missing {
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--fg);
}

/* ----- footer ----- */

.site-footer {
  padding: 1.5rem 2rem 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ----- responsive ----- */

@media (max-width: 540px) {
  main {
    padding: 2.5rem 1.25rem 2rem;
  }

  h1 {
    font-size: 3rem;
  }

  h1.is-large {
    font-size: 3.5rem;
  }

  .signed-as {
    font-size: 1.05rem;
  }

  .site-header-inner {
    padding: 1rem 1.25rem;
  }
}
