:root {
  --black: #111111;
  --near-black: #181818;
  --red: #d52b1e;
  --red-dark: #b82016;
  --white: #ffffff;
  --paper: #ffffff;
  --page: #f1f2f4;
  --line: #dedede;
  --text: #232323;
  --muted: #6d6d6d;
  --success: #208348;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--black);
  line-height: 1.55;
}

a { color: var(--red-dark); }

.page-shell {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 16px;
  display: flex;
}

.card {
  width: 100%;
  min-height: calc(100dvh - 56px);
  overflow: hidden;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 14px 45px rgba(0,0,0,.12);
  border-top: none;
  display: flex;
  flex-direction: column;
}

.brand-header {
  padding: 34px 24px 30px;
  text-align: center;
  color: var(--white);
  background: var(--black);
  border-bottom: 4px solid var(--red);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -2px;
  text-shadow: 0 3px 0 rgba(0,0,0,.6);
}

.wordmark .bolt {
  color: var(--red);
  font-style: normal;
  font-size: .9em;
  margin: 0 -4px;
}

.brand-header p {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: 1.7px;
  color: #d6d6d6;
}

.document-heading {
  padding: 34px clamp(20px, 5vw, 58px) 18px;
  text-align: center;
}

.document-heading h1 {
  margin: 6px 0 10px;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.expiry {
  margin: 16px auto 0;
  padding: 12px 14px;
  max-width: 620px;
  color: #7d241d;
  background: #fff3f2;
  border-left: 4px solid var(--red);
  border-radius: 5px;
  font-size: 14px;
}

.contract-content {
  margin: 8px clamp(18px, 5vw, 58px) 36px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow-wrap: anywhere;
}

.contract-content h1,
.contract-content h2,
.contract-content h3 {
  line-height: 1.25;
  color: #171717;
}

.contract-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.contract-content th,
.contract-content td {
  border: 1px solid #cfcfcf;
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

.contract-content img {
  max-width: 100%;
  height: auto;
}

.signature-panel {
  margin: 0 clamp(18px, 5vw, 58px) 42px;
  padding: clamp(22px, 4vw, 36px);
  background: #f8f8f8;
  border-top: 4px solid var(--red);
  border-radius: 8px;
}

.signature-panel h2 {
  margin: 0 0 6px;
  font-size: 27px;
}

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

label {
  display: block;
  margin-top: 18px;
  font-weight: 700;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  margin-top: 7px;
  padding: 14px 13px;
  border: 1px solid #bfc4ca;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(213,43,30,.16);
  border-color: var(--red);
}

.signature-input {
  font-size: 22px !important;
  font-family: "Brush Script MT", "Segoe Script", cursive !important;
}

.confirmations {
  margin: 24px 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  font-weight: 400;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--red);
  flex: 0 0 auto;
}

button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 15px 20px;
  color: white;
  background: var(--red);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

button:hover { background: var(--red-dark); }
button:disabled { opacity: .62; cursor: wait; }

.legal-note {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  color: #8c1f18;
  background: #fff0ef;
  border: 1px solid #efb9b4;
  border-radius: 6px;
}

.state-panel {
  flex: 1;
  padding: 70px 28px;
  text-align: center;
}

.state-panel h1 { margin: 18px 0 8px; }
.state-panel p { max-width: 620px; margin: 8px auto; }

.spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border: 5px solid #e5e5e5;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.status-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 34px;
  font-weight: 900;
}

.error-icon { background: var(--red); }
.success-icon { background: var(--success); }

.site-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 28px 22px;
  text-align: center;
  color: #bcbcbc;
  background: var(--black);
  border-top: 3px solid var(--red);
  font-size: 12px;
}

.site-footer strong { color: #fff; font-size: 13px; }
.site-footer a { color: #f06b61; }

.muted { color: var(--muted); }
.hidden { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 680px) {
  .page-shell { min-height: 100dvh; padding: 0; }
  .card { min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .contract-content { padding: 18px; }
  .brand-header { padding-top: 28px; }
}
