@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

:root {
  --chg-bg: #0b0b0a;
  --chg-panel: #131310;
  --chg-panel-soft: #171713;
  --chg-text: #f0eee8;
  --chg-muted: rgba(240, 238, 232, 0.68);
  --chg-faint: rgba(240, 238, 232, 0.48);
  --chg-line: rgba(240, 238, 232, 0.16);
  --chg-line-strong: rgba(240, 238, 232, 0.28);
  --chg-gold: #c2ae83;
  --chg-gold-dark: #96815b;
  --chg-error: #ffb4a8;
  --chg-success: #c2ae83;
  --chg-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  --chg-radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--chg-bg);
  color: var(--chg-text);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(115deg, rgba(194, 174, 131, 0.08), transparent 34%),
    linear-gradient(245deg, rgba(150, 129, 91, 0.06), transparent 30%),
    linear-gradient(180deg, #0b0b0a 0%, #090908 100%);
  color: var(--chg-text);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  z-index: 0;
  background-image:
    linear-gradient(rgba(240,238,232,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240,238,232,0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.82), rgba(0,0,0,0.18));
}

a {
  color: var(--chg-text);
}

.chg-page {
  position: relative;
  z-index: 1;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 20px 22px 56px;
}

.chg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 24px;
  border-bottom: 1px solid rgba(240, 238, 232, 0.1);
}

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

.chg-brand img {
  width: 44px;
  height: auto;
  display: block;
  opacity: 0.92;
}

.chg-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chg-brand-name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.chg-brand-sub {
  color: var(--chg-muted);
  font-size: 12px;
}

.chg-home-link {
  color: var(--chg-muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.chg-home-link:hover,
.chg-home-link:focus {
  color: var(--chg-text);
  border-color: var(--chg-gold);
}

.chg-hero {
  max-width: 820px;
  padding: clamp(24px, 4.5vw, 46px) 0 18px;
  animation: chgFadeUp 680ms ease both;
}

.chg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--chg-gold);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}

.chg-eyebrow::before {
  content: "";
  display: inline-block;
  width: 38px;
  height: 1px;
  background: var(--chg-gold);
}

.chg-hero h1,
.success-card h1,
.closed-card h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
}

.chg-hero h1 {
  font-size: clamp(40px, 6.4vw, 70px);
}

.chg-hero-line {
  width: min(220px, 54vw);
  height: 1px;
  background: linear-gradient(90deg, var(--chg-gold), transparent);
  margin: 18px 0 16px;
  transform-origin: left;
  animation: chgLineIn 900ms ease both;
}

.chg-hero-lead {
  max-width: 640px;
  font-size: clamp(16px, 1.9vw, 20px);
  line-height: 1.38;
  color: var(--chg-text);
  margin: 0 0 8px;
}

.chg-hero-support {
  max-width: 720px;
  color: var(--chg-muted);
  font-size: 16px;
  margin: 0;
}

.guidance-card,
.form-section,
.success-card,
.closed-card,
.subtle-card {
  background:
    linear-gradient(180deg, rgba(240,238,232,0.035), rgba(240,238,232,0.012)),
    var(--chg-panel);
  border: 1px solid var(--chg-line);
  box-shadow: var(--chg-shadow);
}

.guidance-card {
  padding: clamp(22px, 3.4vw, 32px);
  margin: 10px 0 30px;
  border-radius: var(--chg-radius);
  animation: chgFadeUp 720ms 80ms ease both;
}

.guidance-card h2,
.form-section h2,
.signature-title,
.agreement-title {
  margin: 0 0 10px;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.guidance-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--chg-muted);
}

.guidance-card li {
  margin: 0;
}

.chg-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.offer-banner {
  border-radius: var(--chg-radius);
  padding: 13px 15px;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  animation: chgFadeUp 620ms ease both;
}

.offer-banner-valid {
  border: 1px solid rgba(194, 174, 131, 0.58);
  background: rgba(194, 174, 131, 0.13);
  color: var(--chg-text);
}

.offer-banner-warning {
  border: 1px solid rgba(255, 180, 168, 0.55);
  background: rgba(255, 180, 168, 0.09);
  color: var(--chg-error);
}

.form-section {
  border-radius: var(--chg-radius);
  padding: clamp(18px, 2.8vw, 28px);
  animation: chgFadeUp 620ms ease both;
}

.section-kicker {
  display: block;
  color: var(--chg-gold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 7px;
}

.form-section h2,
.agreement-title,
.signature-title {
  font-size: clamp(23px, 2.4vw, 32px);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

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

label {
  display: block;
  margin: 10px 0 6px;
  color: var(--chg-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--chg-line);
  background: rgba(7, 7, 6, 0.78);
  color: var(--chg-text);
  border-radius: 5px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

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

input::placeholder,
textarea::placeholder {
  color: rgba(240, 238, 232, 0.38);
}

input:focus,
textarea:focus {
  border-color: rgba(194, 174, 131, 0.72);
  background: rgba(8, 8, 7, 0.92);
  box-shadow: 0 0 0 3px rgba(194, 174, 131, 0.11);
}

input[type="file"] {
  padding: 12px;
  border-style: dashed;
  cursor: pointer;
}

input[type="checkbox"] {
  width: auto;
  min-width: 18px;
  height: 18px;
  accent-color: var(--chg-gold);
  margin: 2px 9px 0 0;
  flex: 0 0 auto;
}

.small-note,
.helper-text {
  color: var(--chg-muted);
  font-size: 12px;
  margin: -1px 0 8px;
  line-height: 1.42;
}

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

.one-track-note,
.collaborator-box {
  border: 1px solid var(--chg-line);
  background: rgba(240,238,232,0.026);
  border-radius: 5px;
  padding: 12px 14px;
}

.one-track-note {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.42;
}

.one-track-note strong {
  color: var(--chg-gold);
  display: block;
  margin-bottom: 2px;
}

.collaborator-box {
  margin-top: 12px;
  border-left-color: rgba(194, 174, 131, 0.42);
}

.collaborator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 2px;
}

.collaborator-header h3 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
}

.checkbox-row {
  margin: 9px 0;
  padding: 10px 12px;
  border: 1px solid rgba(240, 238, 232, 0.1);
  border-radius: 5px;
  background: rgba(240, 238, 232, 0.018);
}

.checkbox-row label {
  display: flex;
  align-items: flex-start;
  margin: 0;
  color: var(--chg-muted);
  font-weight: 500;
  line-height: 1.38;
}

.checkbox-row label:hover {
  color: var(--chg-text);
}

.contract-box {
  border: 1px solid rgba(240, 238, 232, 0.13);
  border-radius: 5px;
  padding: clamp(14px, 2vw, 18px);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--chg-muted);
  font-size: 13px;
  line-height: 1.45;
  background: rgba(7, 7, 6, 0.52);
  box-shadow: none;
}

.agreement-section {
  padding-block: clamp(16px, 2.3vw, 24px);
}

.signature-panel .small-note {
  max-width: 680px;
  margin-bottom: 12px;
}

canvas {
  display: block;
  width: 100%;
  height: 188px;
  touch-action: none;
  border: 1px solid var(--chg-line-strong);
  background: #f0eee8;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(11, 11, 10, 0.05);
  margin-bottom: 16px;
}

button,
.button-link {
  appearance: none;
  border-radius: 4px;
  border: 1px solid var(--chg-line-strong);
  padding: 11px 16px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

button:hover,
.button-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.add-collaborator,
.remove-collaborator,
.clear-btn,
.button-link.secondary {
  background: transparent;
  color: var(--chg-text);
  border-color: var(--chg-line-strong);
}

.add-collaborator:hover,
.remove-collaborator:hover,
.clear-btn:hover,
.button-link.secondary:hover {
  border-color: var(--chg-gold);
  color: var(--chg-gold);
}

.submit-btn,
.button-link.primary {
  width: 100%;
  background: #f0eee8;
  color: #0b0b0a;
  border-color: #f0eee8;
  padding: 15px 20px;
  margin-top: 4px;
}

.submit-btn:hover,
.button-link.primary:hover {
  background: var(--chg-gold);
  border-color: var(--chg-gold);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

#submit-message {
  display: none;
  margin-top: 10px;
  color: var(--chg-gold);
  font-weight: 700;
}

.success-wrap,
.closed-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 880px);
  margin: 0 auto;
  padding: 34px 22px 72px;
}

.success-card,
.closed-card {
  border-radius: var(--chg-radius);
  padding: clamp(28px, 6vw, 58px);
  margin-top: 54px;
  animation: chgFadeUp 680ms ease both;
}

.success-card h1,
.closed-card h1 {
  font-size: clamp(38px, 6vw, 70px);
  margin-bottom: 22px;
}

.success-card p,
.closed-card p {
  color: var(--chg-muted);
  font-size: 17px;
}

.details {
  border: 1px solid var(--chg-line);
  background: rgba(240,238,232,0.026);
  border-radius: 5px;
  padding: 18px 20px;
  margin: 26px 0;
}

.details p {
  margin: 7px 0;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-mark {
  width: 72px;
  height: auto;
  opacity: 0.92;
  margin-bottom: 24px;
}

@keyframes chgFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chgLineIn {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .chg-page,
  .success-wrap,
  .closed-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chg-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .guidance-card ul {
    grid-template-columns: 1fr;
  }

  .form-section,
  .guidance-card,
  .success-card,
  .closed-card {
    padding: 16px;
  }

  .chg-hero {
    padding-top: 18px;
  }

  .collaborator-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .remove-collaborator {
    width: 100%;
  }

  canvas {
    height: 176px;
  }

  .success-actions {
    flex-direction: column;
  }

  .button-link {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
