:root {
  --navy: #0B2545;
  --orange: #E8622C;
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --border: #DDE3EA;
  --text: #1A2332;
  --muted: #5A6578;
  --font-wordmark: 'Barlow Condensed', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;
  --font-signature: 'Dancing Script', cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--navy);
  color: #fff;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.wordmark {
  font-family: var(--font-wordmark);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.header-tag {
  font-size: 0.875rem;
  opacity: 0.85;
}

.header-stripe {
  height: 3px;
  background: var(--orange);
}

.page {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.internal-banner {
  background: #FFF4ED;
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.internal-banner code {
  background: rgba(11, 37, 69, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
}

.card-flush {
  padding: 1rem;
}

.card h1,
.card h2 {
  font-family: var(--font-wordmark);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.card h1 {
  font-size: 1.5rem;
}

.card h2 {
  font-size: 1.25rem;
}

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

.hint {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.highway-divider {
  margin: 1.5rem 0;
  height: 0;
  border: none;
  border-top: 3px dashed var(--orange);
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

.center-text {
  text-align: center;
}

/* Form elements */

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.375rem;
  margin-top: 1rem;
}

.field-label:first-child,
.card > .field-label:first-of-type {
  margin-top: 0;
}

.input,
.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--orange);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  margin-top: 0.375rem;
}

.field-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.field-row .input {
  flex: 1;
}

.field-error {
  color: #C0392B;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  margin-top: 1.25rem;
}

.btn-primary:hover:not(:disabled) {
  background: #D45626;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--navy);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-row .btn {
  margin-top: 0;
}

/* Drop zone */

.drop-zone {
  margin-top: 1.25rem;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone:focus,
.drop-zone.drag-over {
  border-color: var(--orange);
  background: #FFF9F5;
  outline: none;
}

.drop-zone-icon {
  display: inline-block;
  font-family: var(--font-wordmark);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.drop-zone-text {
  font-size: 0.9375rem;
}

.link-like {
  color: var(--orange);
  font-weight: 600;
}

.drop-zone-hint {
  font-size: 0.8125rem;
  margin-top: 0.375rem;
}

.selected-file {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

/* Link result */

.result-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.result-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.result-value {
  font-size: 1rem;
  color: var(--navy);
  word-break: break-all;
}

.result-value.link {
  color: var(--orange);
  font-weight: 600;
}

/* Status check */

.status-result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.status-pending {
  background: #FFF4ED;
  color: #B45309;
}

.status-signed {
  background: #ECFDF3;
  color: #166534;
}

.status-dl {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.status-dl dt {
  font-weight: 600;
  color: var(--muted);
}

.status-dl dd {
  color: var(--text);
}

/* Signature preview */

.signature-preview-wrap {
  margin-top: 1rem;
}

.signature-preview {
  min-height: 64px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--orange);
  border-radius: 6px;
  background: #FAFBFC;
  display: flex;
  align-items: center;
}

.signature-placeholder {
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
}

.signature-text {
  font-family: var(--font-signature);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

/* PDF viewer */

.pdf-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  overflow-x: auto;
}

.pdf-page {
  position: relative;
  box-shadow: 0 2px 12px rgba(11, 37, 69, 0.12);
  cursor: crosshair;
  flex-shrink: 0;
}

.pdf-page canvas {
  display: block;
}

.placement-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.signature-placement {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border: 1px dashed transparent;
  border-radius: 2px;
  transition: border-color 0.15s;
}

.signature-placement:hover {
  border-color: var(--orange);
}

.signature-placement img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Success */

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: #ECFDF3;
  color: #166534;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 1000;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: #C0392B;
}

.toast-success {
  background: var(--navy);
}

/* Footer */

.site-footer {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--navy);
  font-weight: 600;
}

.disclaimer {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Responsive */

@media (max-width: 600px) {
  .field-row {
    flex-direction: column;
  }

  .page {
    padding: 1.25rem 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .status-dl div {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }
}
