:root {
  --paper: #f7f4ee;
  --paper-deep: #ede7db;
  --surface: #ffffff;
  --ink: #1f1b16;
  --stone-800: #37312b;
  --stone-650: #6c6258;
  --stone-500: #94887b;
  --line: #ddd5c8;
  --line-strong: #c9bcae;
  --teal: #0d9488;
  --teal-deep: #0f6e56;
  --sage: #dce8dd;
  --clay: #b86f4b;
  --rose: #9f1239;
  --shadow: 0 28px 90px rgb(54 43 32 / 14%);
  --soft-shadow: 0 18px 50px rgb(54 43 32 / 9%);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  margin: 0;
  min-height: 100vh;
}

body::before {
  background:
    linear-gradient(90deg, rgb(31 27 22 / 3%) 1px, transparent 1px),
    linear-gradient(rgb(31 27 22 / 3%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(255 255 255 / 78%), transparent 34%);
  background-size: 48px 48px, 48px 48px, auto;
  content: "";
  inset: 76px 0 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

a {
  color: var(--teal-deep);
  font-weight: 650;
  text-decoration-color: rgb(15 110 86 / 28%);
  text-underline-offset: 4px;
}

.site-header {
  align-items: center;
  background: rgb(247 244 238 / 94%);
  border-bottom: 1px solid rgb(31 27 22 / 8%);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: 0;
  text-decoration: none;
}

.brand::before {
  background: var(--teal);
  border-radius: 999px;
  content: "";
  height: 9px;
  margin: 7px 9px 0 0;
  width: 9px;
}

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

.nav a,
.link-button {
  border-radius: 100px;
  color: var(--stone-650);
  font-size: 0.92rem;
  font-weight: 650;
  min-height: 38px;
  padding: 10px 14px;
  text-decoration: none;
}

.nav a:hover,
.link-button:hover {
  background: var(--surface);
  color: var(--ink);
}

.link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.page {
  padding: 40px;
}

.auth-shell {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  margin: 0 auto;
  max-width: 1180px;
  min-height: calc(100vh - 160px);
}

.auth-copy {
  background: var(--ink);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 30px;
  box-shadow: var(--shadow);
  color: white;
  overflow: hidden;
  position: relative;
}

.auth-copy {
  align-content: end;
  display: grid;
  min-height: 650px;
  padding: 56px;
}

.auth-copy::after {
  background: var(--teal);
  content: "";
  height: 7px;
  inset: 0 0 auto;
  position: absolute;
}

.auth-copy h1 {
  color: white;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6vw, 5.6rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.96;
  margin: 0;
  max-width: 720px;
}

.lead {
  color: rgb(255 255 255 / 72%);
  font-size: 1.1rem;
  font-weight: 350;
  line-height: 1.7;
  margin: 28px 0 0;
  max-width: 610px;
}

.proof-strip,
.heading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.proof-strip span,
.heading-meta span {
  align-items: center;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 100px;
  color: rgb(255 255 255 / 78%);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 650;
  min-height: 34px;
  padding: 8px 13px;
}

.auth-panel,
.content {
  background: rgb(255 255 255 / 94%);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--soft-shadow);
}

.auth-panel {
  align-self: center;
  padding: 42px;
}

.auth-panel h1 {
  font-size: 3.1rem;
  margin-bottom: 30px;
}

.content {
  margin: 0 auto;
  max-width: 1040px;
  overflow: hidden;
  padding: 42px;
  position: relative;
  width: 100%;
}

.wide {
  max-width: 1220px;
}

.form-shell {
  margin: 0 auto;
  max-width: 1120px;
}

.intake-card {
  overflow: hidden;
  position: relative;
}

.intake-card::before,
.wide::before {
  background: linear-gradient(90deg, var(--teal), #71c9bd, var(--clay));
  content: "";
  height: 6px;
  inset: 0 0 auto;
  position: absolute;
}

.section-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  padding-bottom: 24px;
}

.section-heading h1 {
  max-width: 780px;
}

.heading-meta {
  margin-top: 20px;
}

.heading-meta span {
  background: var(--paper);
  border-color: var(--line);
  color: var(--stone-650);
}

.eyebrow {
  color: var(--teal-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.auth-copy .eyebrow {
  color: #99f6e4;
}

h1 {
  color: var(--ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 0;
}

.stack,
.intake-form {
  display: grid;
  gap: 16px;
}

.intake-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-textarea,
.field-multiselect,
.form-actions,
.form-section-label {
  grid-column: 1 / -1;
}

.form-section-label {
  align-items: center;
  color: var(--clay);
  display: flex;
  font-size: 0.78rem;
  font-weight: 850;
  gap: 12px;
  letter-spacing: 0;
  margin-top: 8px;
  text-transform: uppercase;
}

.form-section-label::after {
  background: var(--line);
  content: "";
  flex: 1;
  height: 1px;
}

label,
.field {
  display: grid;
  gap: 8px;
}

.field-label,
label span {
  color: var(--stone-800);
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font: inherit;
  min-height: 50px;
  padding: 13px 15px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover,
.choice:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 4px solid rgb(13 148 136 / 14%);
}

.choice-row,
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  align-items: center;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 100px;
  display: inline-flex;
  gap: 9px;
  min-height: 42px;
  padding: 8px 13px;
}

.choice input {
  accent-color: var(--teal);
  min-height: auto;
  width: auto;
}

.primary {
  background: var(--ink);
  border: 0;
  border-radius: 100px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 54px;
  padding: 15px 34px;
}

.primary:hover {
  background: var(--teal-deep);
}

.form-actions {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
  padding: 16px;
}

.secondary-action,
.table-action {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--stone-800);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  min-height: 40px;
  padding: 9px 14px;
  text-decoration: none;
}

.secondary-action:hover,
.table-action:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
}

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

.row-actions form {
  margin: 0;
}

.table-action {
  background: #fffaf1;
  cursor: pointer;
  font: inherit;
  min-height: 34px;
  padding: 7px 11px;
}

.table-action.danger {
  color: var(--rose);
}

.error-summary,
.field-error {
  color: var(--rose);
  font-weight: 700;
  margin: 0;
}

.flash {
  background: var(--sage);
  border: 1px solid #b8d1bf;
  border-radius: 18px;
  color: var(--teal-deep);
  margin: 0 auto 24px;
  max-width: 1040px;
  padding: 14px 18px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
}

.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 20px;
}

.metric span {
  color: var(--stone-500);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  color: var(--ink);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.05;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 16px;
  text-align: left;
  vertical-align: top;
}

td:nth-child(6) {
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--paper);
  color: var(--stone-500);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

tr:hover td {
  background: #fffaf1;
}

.muted {
  color: var(--stone-500);
  font-weight: 400;
  line-height: 1.7;
}

.detail-list {
  border: 1px solid var(--line);
  border-radius: 24px;
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
}

.detail-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: 230px minmax(0, 1fr);
  padding: 18px 20px;
}

.detail-list div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--stone-650);
  font-size: 0.88rem;
  font-weight: 750;
}

dd {
  color: var(--ink);
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .auth-shell,
  .intake-form,
  .metric-grid,
  .detail-list div {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    min-height: auto;
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header,
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    gap: 14px;
    padding: 20px;
    position: static;
  }

  .page {
    padding: 18px;
  }

  .auth-copy,
  .auth-panel,
  .content {
    border-radius: 24px;
    padding: 26px 22px;
  }

  h1,
  .auth-copy h1 {
    font-size: 2.65rem;
  }
}
