@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,700;0,900;1,700;1,900&family=Space+Mono:wght@400;700&display=swap");

:root {
  --paper: #f4ead6;
  --paper-2: #fff9ed;
  --paper-dim: #e9dec5;
  --cream-line: #d8c69d;
  --ink: #2b1b10;
  --ink-2: #3a2718;
  --muted: #7d705c;
  --chrome: #221509;
  --chrome-hi: #2d1d10;
  --chrome-raised: #342214;
  --chrome-border: #48311e;
  --brass: #bd8f47;
  --brass-dark: #98713a;
  --silver: #c5c0b6;
  --vfd: #55c8ba;
  --orange: #e85e12;
  --orange-dark: #b9480f;
  --olive: #83933a;
  --rust: #c94a1e;
  --teal: #2e7892;
  --danger: #ad3026;
  --shadow: 0 12px 35px rgba(34, 21, 12, 0.16);
  --radius: 8px;
  --font-catalog: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

button,
input,
textarea,
select {
  font: inherit;
  min-width: 0;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  background: #fffaf0;
  color: var(--ink);
  padding: 0.72rem 0.82rem;
  outline-color: var(--brass);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  min-width: 0;
}

code,
pre,
.eyebrow,
.fineprint,
.pill,
.chip,
.small-button {
  font-family: var(--font-mono);
}

pre {
  white-space: pre-wrap;
  margin: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: var(--font-catalog);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

h2 {
  font-family: var(--font-catalog);
  font-size: 1.65rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.eyebrow {
  color: var(--brass-dark);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.muted,
.fineprint {
  color: var(--muted);
}

.fineprint {
  font-size: 0.86rem;
}

.button,
.small-button,
.icon-button {
  border: 1px solid currentColor;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
  min-height: 2.6rem;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button {
  min-width: 9rem;
  padding: 0.82rem 1.35rem;
  font-weight: 800;
}

.small-button {
  min-height: 2rem;
  min-width: 4.25rem;
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--ink);
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  color: var(--paper);
}

.button:hover,
.small-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--orange);
  border-color: var(--orange-dark);
  color: white;
  box-shadow: 0 4px 0 var(--orange-dark);
}

.button.secondary {
  background: var(--paper-2);
  border-color: var(--brass);
  color: var(--ink);
}

.button.danger {
  background: var(--danger);
  border-color: #731b16;
  color: white;
}

.danger-text {
  color: var(--danger);
}

.button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.signin-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(33, 21, 13, 0.82), rgba(33, 21, 13, 0.35)),
    var(--paper);
}

.signin-card,
.centered-panel {
  width: min(100%, 520px);
  background: var(--paper-2);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.signin-card h1,
.film-header .wordmark {
  font-family: var(--font-catalog);
  font-style: italic;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 1rem;
}

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

.form-span {
  grid-column: 1 / -1;
}

.film-header {
  height: 4.3rem;
  background: var(--chrome);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid #4b2b12;
}

.wordmark {
  font-size: 1.55rem;
  text-decoration: none;
}

.top-kicker {
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.stripe,
.client-accent {
  height: 0.65rem;
  background: linear-gradient(180deg, #cf3230 0 22%, #de721f 22% 44%, #d6b13e 44% 63%, #3d9b75 63% 82%, #2490a0 82% 100%);
}

.admin-frame {
  min-height: calc(100vh - 4.95rem);
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  background: var(--paper);
}

.sidebar {
  background: var(--chrome);
  color: #d5c7a9;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #4b3820;
}

.sidebar nav {
  display: grid;
  gap: 0.45rem;
}

.nav-item {
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: var(--brass);
  color: var(--ink);
}

.sidebar-foot {
  display: grid;
  gap: 0.55rem;
  font-size: 0.85rem;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--olive);
  display: inline-block;
  margin-right: 0.35rem;
}

.admin-main {
  padding: clamp(1rem, 2.5vw, 2rem);
  overflow-x: hidden;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.button-row,
.chip-row,
.actions-cell,
.danger-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.panel,
.template-card,
.client-section,
.client-hero {
  background: rgba(255, 248, 234, 0.82);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(34, 21, 12, 0.05);
  padding: clamp(1rem, 2vw, 1.35rem);
  margin-bottom: 1rem;
  min-width: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.split > *,
.form-grid > *,
.stack > * {
  min-width: 0;
}

.table-scroll {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--cream-line);
  padding: 0.72rem;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.inline-form {
  display: inline-flex;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  background: #f8efd9;
  color: var(--brass-dark);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill.submitted,
.pill.delivered {
  border-color: var(--olive);
  color: #4f671f;
}

.pill.archived {
  border-color: var(--muted);
  color: var(--muted);
}

.pill.viewed,
.pill.preparing {
  border-color: var(--teal);
  color: #236560;
}

.notice {
  border: 1px solid var(--brass);
  background: #fff2c8;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
}

.notice.danger {
  border-color: var(--danger);
  background: #f9ded8;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.template-card {
  display: grid;
  gap: 1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.control-fieldset {
  display: grid;
  gap: 0.65rem;
  border: 1px dashed var(--cream-line);
  border-radius: var(--radius);
  padding: 1rem;
}

.control-fieldset legend {
  font-weight: 900;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.copy-box {
  border: 1px dashed var(--brass);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff6e2;
  overflow: hidden;
}

.copy-box pre {
  max-width: 100%;
  max-height: 13rem;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.photo-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 320px));
  gap: 1rem;
  justify-content: start;
  align-items: start;
}

.photo-admin-card,
.question-card,
.client-question {
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  background: #fffaf0;
  padding: 0.8rem;
  min-width: 0;
}

.photo-admin-card {
  max-width: 320px;
}

.photo-admin-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 11rem;
  max-height: 15rem;
  overflow: hidden;
  background: var(--paper-dim);
  border-radius: calc(var(--radius) - 2px);
  margin-bottom: 0.75rem;
  border: 1px solid var(--cream-line);
}

.photo-admin-card img {
  width: 100%;
  height: auto;
  max-height: 15rem;
  object-fit: contain;
}

.photo-carousel {
  display: grid;
  gap: 0.85rem;
}

.photo-carousel-toolbar {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
  gap: 0.75rem;
  align-items: center;
  border: 1px dashed var(--cream-line);
  border-radius: var(--radius);
  background: #fff6e2;
  padding: 0.65rem;
}

.photo-carousel-toolbar > div {
  text-align: center;
  min-width: 0;
}

.photo-carousel-toolbar strong {
  font-family: var(--font-mono);
  color: var(--brass-dark);
}

.carousel-arrow {
  min-width: 2.75rem;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-color: var(--vfd);
  background: var(--chrome);
  color: var(--vfd);
  font-size: 1.15rem;
  box-shadow: 0 0 0 2px rgba(85, 200, 186, 0.1), 0 0 16px rgba(85, 200, 186, 0.26);
  text-shadow: 0 0 8px rgba(85, 200, 186, 0.75);
}

.photo-carousel-track {
  min-height: 30rem;
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  background: #fffaf0;
  overflow: hidden;
}

.photo-carousel-slide {
  display: grid;
  gap: 1rem;
  padding: 0.85rem;
}

.photo-carousel-slide[hidden] {
  display: none;
}

.photo-carousel-image {
  display: grid;
  place-items: center;
  min-height: 16rem;
  max-height: 24rem;
  overflow: hidden;
  border: 1px solid var(--cream-line);
  border-radius: calc(var(--radius) - 2px);
  background: var(--paper-dim);
}

.photo-carousel-image img {
  width: 100%;
  height: 100%;
  max-height: 24rem;
  object-fit: contain;
}

.photo-carousel-form {
  min-width: 0;
}

.photo-carousel-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.photo-carousel-hint {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

@media (min-width: 1280px) {
  .photo-carousel-slide {
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1fr);
    align-items: start;
  }
}

.response-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.response-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.client-shell {
  background: var(--paper);
}

.client-header {
  min-height: 4.6rem;
  background: #030303;
  color: white;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.8rem clamp(1rem, 4vw, 4rem);
  border-top: 3px solid #4b2107;
}

.client-brand {
  justify-self: center;
  font-size: 1.65rem;
  text-decoration: none;
}

.client-header span {
  color: #d6c5aa;
}

.client-main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) 0 5rem;
}

.client-hero {
  min-height: 14rem;
  display: grid;
  align-content: end;
  background:
    linear-gradient(0deg, rgba(33, 21, 13, 0.66), rgba(33, 21, 13, 0.14)),
    var(--chrome-raised);
  color: #fff8e7;
}

.client-hero h1 {
  max-width: 900px;
}

.client-hero p {
  max-width: 720px;
  font-size: 1.06rem;
}

.client-hero.submitted {
  background: var(--olive);
  color: white;
}

.password-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1rem;
  align-items: end;
}

.password-mini {
  display: grid;
  gap: 0.75rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.client-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 380px));
  gap: 1rem;
  justify-content: start;
  align-items: start;
}

.client-photo-card {
  border: 1px solid var(--cream-line);
  border-radius: var(--radius);
  background: #fffaf0;
  overflow: hidden;
}

.client-photo-card figure {
  margin: 0;
  background: var(--chrome);
}

.client-photo-card img {
  width: 100%;
  height: auto;
  max-height: 25rem;
  object-fit: contain;
  background: var(--chrome);
}

.client-photo-card figcaption {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem;
  color: var(--muted);
}

.client-photo-card figcaption strong {
  color: var(--ink);
}

.feedback-controls {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem;
}

.toggle-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: var(--paper-2);
  position: relative;
}

.toggle-pill input,
.tag-cloud input,
.option-stack input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.tag-cloud,
.option-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud label,
.option-stack label {
  display: inline-flex;
  width: fit-content;
  min-width: 5.5rem;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--cream-line);
  border-radius: 999px;
  background: #fff6e2;
  padding: 0.58rem 0.9rem;
  font-weight: 700;
  position: relative;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease, box-shadow 120ms ease, text-shadow 120ms ease;
}

.option-stack label {
  min-width: 7.25rem;
}

.toggle-pill:has(input:checked),
.tag-cloud label:has(input:checked),
.option-stack label:has(input:checked) {
  background: var(--chrome);
  border-color: var(--vfd);
  color: var(--vfd);
  box-shadow: 0 0 0 2px rgba(85, 200, 186, 0.18), 0 0 18px rgba(85, 200, 186, 0.42);
  text-shadow: 0 0 8px rgba(85, 200, 186, 0.8);
}

.toggle-pill:focus-within,
.tag-cloud label:focus-within,
.option-stack label:focus-within {
  outline: 2px solid var(--vfd);
  outline-offset: 3px;
}

.question-list {
  display: grid;
  gap: 0.75rem;
}

.client-question label {
  display: grid;
  gap: 0.7rem;
}

.client-question-linked {
  padding: 0;
  border: 0;
  background: transparent;
}

.photo-linked-question {
  border-top: 1px dashed var(--cream-line);
  padding-top: 0.8rem;
}

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

.range-value {
  display: inline-flex;
  width: 2.2rem;
  justify-content: center;
  margin-left: 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--brass);
  background: var(--paper-2);
  color: var(--brass-dark);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 900;
}

.delivery-card {
  border-color: var(--olive);
}

.sticky-submit {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem;
  margin: 1rem -1rem 0;
  background: rgba(245, 236, 216, 0.94);
  border-top: 1px solid var(--cream-line);
  backdrop-filter: blur(6px);
}

@media (max-width: 880px) {
  .film-header,
  .page-heading,
  .client-header,
  .password-offer,
  .split {
    grid-template-columns: 1fr;
  }

  .film-header,
  .page-heading {
    display: grid;
  }

  .top-kicker {
    display: none;
  }

  .admin-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: block;
    padding: 0.6rem;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-item {
    text-align: center;
    padding: 0.6rem 0.35rem;
    font-size: 0.86rem;
  }

  .sidebar-foot {
    display: none;
  }

  .form-grid,
  .password-offer {
    grid-template-columns: 1fr;
  }

  .client-header {
    gap: 0.35rem;
    text-align: center;
  }

  .client-brand {
    justify-self: center;
  }

  .client-header span {
    justify-self: center;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 2.45rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .admin-main,
  .client-main {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .panel,
  .template-card,
  .client-section,
  .client-hero {
    padding: 1rem;
  }

  .client-photo-grid {
    grid-template-columns: 1fr;
  }

  .sticky-submit {
    flex-direction: column;
  }

  .sticky-submit .button {
    width: 100%;
  }
}
