:root {
  --q-ink: #212121;
  --q-muted: #6e6a64;
  --q-panel: #f7f1e7;
  --q-paper: #fffdf8;
  --q-line: #ddd3c4;
  --q-ember: #b52700;
  --q-pine: #526e3b;
  --q-sky: #21486f;
  --q-mate: #5a243d;
  --q-focus: #0f6f8f;
  --shadow-soft: 0 18px 50px rgba(33, 33, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--q-ink);
  background: var(--q-paper);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--q-line);
  border-radius: 6px;
  padding: 0.72rem 0.85rem;
  color: var(--q-ink);
  background: #fff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 111, 143, 0.28);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--q-line);
  background: rgba(255, 253, 248, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--q-ember);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.muted {
  color: var(--q-muted);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.nav-links a {
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  text-decoration: none;
  color: var(--q-muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--q-ink);
  background: var(--q-panel);
}

.page-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.page-shell.narrow {
  width: min(680px, calc(100% - 2rem));
}

.staging-banner {
  margin-bottom: 1rem;
  border: 1px solid rgba(181, 39, 0, 0.24);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  color: #662000;
  background: #fff2e9;
  font-weight: 700;
}

.intro-grid,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: stretch;
}

.intro-copy,
.status-panel,
.form-surface,
.profile-panel,
.links-panel {
  border: 1px solid var(--q-line);
  border-radius: 8px;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.intro-copy {
  background:
    linear-gradient(135deg, rgba(82, 110, 59, 0.12), rgba(33, 72, 111, 0.08)),
    #fff;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--q-pine);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0 0 0.8rem;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

h2 {
  font-size: 1.25rem;
}

.form-surface h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.form-surface.stacked {
  display: grid;
  gap: 1.2rem;
}

.divider {
  height: 1px;
  background: var(--q-line);
}

.field-group {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.field-group label,
.check-row {
  font-weight: 700;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin: 0 0 0.75rem;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 0.18rem;
}

.form-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.68rem 1rem;
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--q-ember);
}

.button.secondary {
  color: #fff;
  background: var(--q-sky);
}

.button.ghost {
  color: var(--q-ink);
  border-color: var(--q-line);
  background: var(--q-panel);
}

.button[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.text-link {
  color: var(--q-sky);
  font-weight: 800;
}

.message {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--q-muted);
  font-weight: 700;
}

.message.is-error {
  color: var(--q-ember);
}

.message.is-success {
  color: var(--q-pine);
}

.profile-list {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0;
}

.profile-list div {
  display: grid;
  grid-template-columns: minmax(130px, 0.4fr) minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--q-line);
  padding-bottom: 0.7rem;
}

.profile-list dt {
  color: var(--q-muted);
  font-weight: 800;
}

.profile-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.links-panel {
  align-self: start;
}

.module-link {
  display: block;
  border: 1px solid var(--q-line);
  border-radius: 6px;
  margin-top: 0.7rem;
  padding: 0.85rem;
  text-decoration: none;
  color: var(--q-muted);
  background: var(--q-panel);
}

@media (max-width: 760px) {
  .site-header,
  .intro-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
    align-items: start;
  }

  .nav-links {
    justify-content: flex-start;
  }

  h1 {
    font-size: 2rem;
  }

  .profile-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}
