:root {
  --black: #080909;
  --charcoal: #191c1f;
  --charcoal-2: #23272b;
  --cream: #eee7da;
  --paper: #f6f0e4;
  --gold: #cf9f41;
  --red: #91302f;
  --red-bright: #b13c38;
  --muted: #aeb2b4;
  --line: rgba(238, 231, 218, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

/* Fluid root size: stays 16px up to ~1200px wide, then keeps growing with the
   window. Sizes below are in rem so the whole layout scales with it. */
html {
  font-size: max(1rem, 0.4vw + 0.7rem);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    linear-gradient(160deg, rgba(145, 48, 47, 0.18), transparent 42%),
    var(--black);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase;
  line-height: 0.95;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 14px;
  border: 0;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.button-primary {
  color: white;
  background: var(--red);
}

.button-secondary {
  color: var(--black);
  background: var(--gold);
}

.button-muted {
  color: var(--cream);
  background: rgba(238, 231, 218, 0.1);
  border: 1px solid rgba(238, 231, 218, 0.18);
}

.button-danger {
  color: white;
  background: #6f2323;
}

.auth-card {
  width: min(100% - 32px, 36.25rem);
  margin: 8vh auto;
  padding: clamp(24px, 5vw, 2.625rem);
  background: var(--charcoal);
  border: 1px solid rgba(207, 159, 65, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card img {
  width: 11.25rem;
  height: 6.875rem;
  object-fit: contain;
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: clamp(2.5rem, 8vw, 4.9rem);
}

.auth-card p:not(.eyebrow) {
  color: var(--muted);
}

.auth-card form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

label {
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  color: var(--cream);
  background: #101214;
  border: 1px solid rgba(238, 231, 218, 0.2);
  border-radius: 4px;
  outline: 0;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(207, 159, 65, 0.17);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 0.75rem clamp(16px, 3vw, 2rem);
  background: rgba(8, 9, 9, 0.92);
  border-bottom: 1px solid rgba(207, 159, 65, 0.24);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  text-transform: uppercase;
}

.brand img {
  width: 7rem;
  height: 3.75rem;
  object-fit: cover;
  object-position: center 41%;
  background: var(--cream);
  border-radius: 6px;
}

.header-actions {
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: 8px;
}

.import-button {
  position: relative;
  overflow: hidden;
}

.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-grid {
  display: grid;
  grid-template-columns: 16.25rem minmax(0, 1fr);
  min-height: calc(100vh - 4.3rem);
}

.admin-sidebar {
  padding: 1.625rem 1.125rem;
  background: #101214;
  border-right: 1px solid var(--line);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.tab {
  min-height: 44px;
  padding: 11px 12px;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  font-weight: 900;
  background: transparent;
  border: 1px solid rgba(238, 231, 218, 0.12);
  border-radius: 4px;
}

.tab.is-active {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

.summary {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.summary div {
  padding: 12px;
  background: var(--charcoal);
  border-left: 5px solid var(--gold);
}

.summary strong,
.summary span {
  display: block;
}

.summary span,
.helper {
  color: var(--muted);
  font-size: 0.86rem;
}

.helper {
  margin: 22px 0 0;
}

.admin-main {
  min-width: 0;
  padding: clamp(18px, 3vw, 2.125rem);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

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

.editor-card {
  padding: 18px;
  background: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

.editor-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.editor-card-header h3 {
  font-size: 1.75rem;
}

.editor-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.editor-fields .wide {
  grid-column: 1 / -1;
}

.panel-helper {
  margin: -6px 0 16px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: start;
}

.button:disabled {
  opacity: 0.35;
  cursor: default;
}

.track-classes {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.track-classes > .button {
  justify-self: start;
}

.class-editor {
  padding: 16px;
  background: #101214;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
}

.class-editor h4 {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.class-editor h4 span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  color: var(--black);
  background: var(--gold);
  border-radius: 4px;
  font-size: 1rem;
}

.session-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.session-list .text-button {
  justify-self: start;
}

.session-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.session-row input {
  color-scheme: dark;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold);
}

.status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--gold);
  font-weight: 800;
}

.status.is-error {
  color: #ffb0aa;
}

.student-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 14px;
}

.student-search input {
  margin-top: 0;
}

#student-results {
  overflow-x: auto;
}

#student-results:empty {
  display: none;
}

.work-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.work-row small {
  display: block;
  color: var(--muted);
}

.work-row a {
  color: var(--gold);
  word-break: break-all;
}

.work-row-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.text-button {
  padding: 0;
  color: var(--gold);
  font-weight: 800;
  background: none;
  border: 0;
  text-decoration: underline;
}

.data-table small {
  display: block;
}

/* Enrollment agreement popup (signing on the account page, viewing on account and admin). */
.contract-dialog {
  width: min(100% - 32px, 52rem);
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--cream);
  background: var(--charcoal);
  border: 1px solid rgba(207, 159, 65, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.contract-dialog::backdrop {
  background: rgba(8, 9, 9, 0.78);
  backdrop-filter: blur(4px);
}

.contract-dialog-inner {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
}

.contract-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.contract-dialog-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.contract-text {
  max-height: min(50vh, 32rem);
  overflow-y: auto;
  padding: 16px 18px;
  color: #d7d0c4;
  background: #101214;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.contract-text:focus-visible {
  outline: 2px solid var(--gold);
}

.contract-sign-fields {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.contract-dialog .helper,
.contract-dialog .status,
.contract-dialog .consent-row {
  margin: 0;
}

.contract-actions {
  display: flex;
  justify-content: end;
}

.contract-dialog [hidden] {
  display: none;
}

.contract-online-signature {
  display: grid;
  gap: 14px;
}

.in-person-notice {
  padding: 14px 16px;
  background: rgba(207, 159, 65, 0.1);
  border: 1px solid rgba(207, 159, 65, 0.4);
  border-left: 5px solid var(--gold);
  border-radius: 6px;
}

.in-person-notice strong {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.82rem;
}

.in-person-notice p {
  margin: 4px 0 0;
}

.minor-toggle input:disabled {
  opacity: 0.7;
}

.minor-toggle:has(input:disabled) {
  cursor: default;
}

.contract-signature {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 10px;
  margin: 0;
}

.contract-signature div {
  padding: 10px 12px;
  background: #101214;
  border-left: 4px solid var(--gold);
}

.contract-signature dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contract-signature dd {
  margin: 2px 0 0;
}

@media (max-width: 980px) {
  .admin-header,
  .admin-grid,
  .editor-fields,
  .session-row,
  .contract-sign-fields {
    grid-template-columns: 1fr;
  }

  .header-actions {
    justify-content: start;
  }

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .admin-sidebar nav,
  .panel-heading,
  .editor-card-header {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .card-actions .button {
    width: auto;
  }
}
