/* =============== MNHS look & feel =============== */
:root {
  --brand-bg: #ffffff;
  --brand-text: #162126;
  --brand-link: #283c44;
  --brand-link-hover: #adc4e2;
  --border: #d0d7de;
  --panel: #ffffff;
  --page-bg: #f6f8fa;
  /* gray page background */
  --muted: #6b7280;
  --accent: #28442b;
  --accent-hover: #689baf;
  --accent-agree: #accd9c;
  --policy-row-alt: #f6f7f9;
  /* alt row */
}

/* Base page */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--brand-text);
  margin: 0;
}

/* Header (persistent across policy + form) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #283c44;
  /* MNHS blue */
}

.site-header .inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1rem;
}

.site-header img.logo-bug {
  height: 40px;
  width: auto;
  display: block;
}

.site-header img.logo-text {
  height: 28px;
  width: auto;
  display: block;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-text);
}

/* Page container */
.container {
  max-width: 960px;
  margin: 1.25rem auto 2.5rem;
  background: var(--panel);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

/* Typography */
h1 {
  font-size: 1.6rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.25rem;
  margin: 1rem 0 .5rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
  color: var(--brand-text);
}

a {
  color: var(--brand-link);
  text-decoration: none;
}

a:hover {
  color: var(--brand-link-hover);
  text-decoration: underline;
}

/* Forms */
fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

legend {
  padding: 0 .5rem;
  font-weight: 700;
}

label {
  display: block;
  margin: .75rem 0;
  color: var(--brand-text);
}

input,
select {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-text);
}

.narrow {
  max-width: 320px;
}

.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.row label {
  flex: 1;
  min-width: 160px;
}

/* Buttons */
button,
.agree-btn {
  background: var(--accent);
  color: #b7b7b7;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

button:hover,
.agree-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button[disabled],
.agree-btn[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* Continue button */
#continueBtn {
  background: #d0d7de;
  color: var(--brand-link);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#continueBtn[disabled] {
  background: var(--muted);
  color: #040404;
  opacity: .6;
  cursor: not-allowed;
}

/* Agree toggles */
.agree-btn {
  background: #bfbfbf;
  color: var(--brand-text);
  border-color: var(--accent);
  padding: .45rem .9rem;
  border-radius: 6px;
}

.agree-btn.agreed {
  background: var(--accent-agree);
  color: #212121;
}

/* Create User button */
#createBtn {
  background: #d0d7de;
  color: var(--brand-link);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#createBtn [disabled] {
  background: var(--muted);
  color: #040404;
  opacity: .6;
  cursor: not-allowed;
}

/* Rows for policy agreement items */
.policy-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .2rem .75rem;
  border-radius: 8px;
  margin-bottom: .5rem;
}

.policy-row:nth-child(even) {
  background: var(--policy-row-alt);
}

/* Messages */
#message {
  margin-top: 1rem;
  font-weight: 600;
}

.error {
  color: #b91c1c;
}

.success {
  color: #116329;
}

/* Success screen */
.success-screen h1 {
  margin-bottom: .5rem;
}

.success-screen p {
  color: var(--brand-text);
}

.success-actions {
  display: flex;
  gap: .75rem;
  margin-top: .75rem;
}

/* Text column grows to fill; input/buttons sit on the right */
.policy-text {
  flex: 1;
}

.narrow {
  max-width: 320px;
  flex: 0 0 320px;
}

/* Mobile: stack nicely */
@media (max-width: 640px) {
  .policy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .narrow {
    max-width: 100%;
    flex: 0 0 auto;
  }
}