:root {
  --gold: #dca54a;
  --gold-dark: #d09a40;
  --navy: #0f172a;
  --ink: #4a4a4a;
  --cream: #faf5e5;
  --sand: #f0e6c5;
  --white: #ffffff;
  --dark: #141004;
  --line: rgba(15, 23, 42, 0.14);
  --muted: rgba(74, 74, 74, 0.72);
  --danger: #a92d2d;
  --shadow: 0 20px 70px rgba(20, 16, 4, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(250, 245, 229, 0.98), rgba(255, 255, 255, 0.96) 42%),
    var(--cream);
  font-family: "PT Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(250, 245, 229, 0.96), rgba(255, 255, 255, 0.92)),
    var(--cream);
}

.auth-card {
  display: grid;
  width: min(100%, 420px);
  gap: 14px;
  padding: clamp(26px, 5vw, 42px);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

.auth-brand {
  width: max-content;
  padding: 8px 11px;
  color: var(--white);
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  font-family: "Sarala", Arial, sans-serif;
  font-weight: 700;
}

.auth-card h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.auth-card p {
  margin: 0;
}

.auth-card label {
  color: var(--navy);
  font-weight: 700;
}

.auth-card input {
  min-height: 50px;
  color: var(--navy);
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 3px;
  padding: 12px 13px;
}

.auth-card input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 165, 74, 0.18);
}

.auth-card button {
  min-height: 52px;
  color: var(--dark);
  background: var(--gold);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.auth-error {
  min-height: 22px;
  color: var(--danger);
  font-weight: 700;
  visibility: hidden;
}

.auth-error.is-visible {
  visibility: visible;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  min-width: 78px;
  min-height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  font-family: "Sarala", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-text {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.topnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topnav a,
.lock-button {
  padding: 10px 14px;
  color: var(--navy);
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.topnav a:hover,
.topnav a:focus-visible,
.lock-button:hover,
.lock-button:focus-visible {
  border-color: rgba(220, 165, 74, 0.46);
  outline: none;
}

.lock-button {
  background: transparent;
  cursor: pointer;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 28px 0 34px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.section-heading {
  color: var(--navy);
  font-family: "Sarala", Arial, sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 600;
  line-height: 1.05;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.status-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

.status-panel div {
  display: grid;
  gap: 2px;
}

.status-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-panel strong {
  color: var(--navy);
}

.chooser {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 22px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.chooser-button {
  min-height: 48px;
  color: var(--navy);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.chooser-button.is-active {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.forms-root {
  min-height: 420px;
}

.form-shell {
  display: none;
}

.form-shell.is-active {
  display: block;
}

.form-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: clamp(22px, 4vw, 34px);
  color: var(--white);
  background: var(--navy);
}

.form-header h2 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.12;
}

.form-header p {
  max-width: 760px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.form-badge {
  padding: 8px 11px;
  color: var(--dark);
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.form-header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.reset-button {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--dark);
  background: #ff4d4d;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

.reset-button:hover,
.reset-button:focus-visible {
  background: #ff6666;
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.notice {
  margin: 0;
  padding: 14px clamp(22px, 4vw, 34px);
  color: var(--dark);
  background: rgba(220, 165, 74, 0.18);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  font-size: 0.95rem;
}

.audit-form {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-section {
  padding: clamp(22px, 4vw, 34px);
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  border-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
}

.section-note {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-grid.one {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.score-title {
  color: var(--navy);
  font-weight: 700;
}

.required-mark {
  color: var(--gold-dark);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  color: var(--navy);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 3px;
  outline: none;
  padding: 12px 13px;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(220, 165, 74, 0.18);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.score-list {
  display: grid;
  gap: 14px;
}

.score-item {
  display: grid;
  gap: 11px;
  padding: 16px;
  background: rgba(250, 245, 229, 0.5);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 7px;
}

.score-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-row label {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: var(--navy);
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.score-row input:checked + label {
  color: var(--dark);
  background: var(--gold);
  border-color: var(--gold);
}

.score-row input:focus-visible + label {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.submit-bar {
  display: grid;
  gap: 10px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--navy);
}

.submit-button {
  min-height: 54px;
  color: var(--dark);
  background: var(--gold);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--gold-dark);
  outline: none;
}

.submit-hint {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.submit-status {
  display: none;
  margin: 0;
  padding: 16px clamp(22px, 4vw, 34px);
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.submit-status.is-visible {
  display: block;
}

.submit-status.is-pending {
  color: #6d4a00;
  background: rgba(220, 165, 74, 0.18);
}

.submit-status.is-success {
  color: #14532d;
  background: rgba(34, 197, 94, 0.14);
}

.submit-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.submit-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: rgba(255, 255, 255, 0.78);
  background: var(--dark);
  font-size: 0.9rem;
}

.hidden-field {
  display: none;
}

.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;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .form-header,
  .footer {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .topnav {
    width: 100%;
    justify-content: stretch;
  }

  .topnav a {
    flex: 1;
    text-align: center;
  }

  .hero {
    gap: 22px;
  }

  .field-grid,
  .chooser {
    grid-template-columns: 1fr;
  }

  .form-badge {
    width: max-content;
  }

  .form-header-actions {
    justify-items: start;
  }

  .footer {
    display: grid;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .topbar {
    position: static;
  }

  .score-row {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
  }

  .section-head {
    display: grid;
  }
}
