:root {
  --bg: #f4efe6;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #fffdf8;
  --text: #18322f;
  --muted: #58706d;
  --line: rgba(24, 50, 47, 0.12);
  --primary: #1b7f68;
  --primary-dark: #0f5f4d;
  --accent: #d7b56d;
  --deep: #102421;
  --shadow: 0 24px 60px rgba(16, 36, 33, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(215, 181, 109, 0.28), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(27, 127, 104, 0.18), transparent 24%),
    linear-gradient(180deg, #f8f4ec 0%, #efe6d7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(24, 50, 47, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-logo {
  display: block;
  /* width: min(220px, 100%); */
  max-width: 100%;
  max-height: 55px;
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-copy small,
.topnav a,
.hero-text,
.hero-points,
.section-heading p,
.steps p,
.mini-card p,
.lookup-result p,
.reassurance-list,
.trust-strip p {
  color: var(--muted);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  flex: 0 0 auto;
}

.topnav a {
  position: relative;
  font-size: 0.95rem;
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.topnav a:hover::after,
.topnav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.panel,
.trust-strip article {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  border-radius: 34px;
}

.hero-copy h1,
.section-heading h2,
.lookup-result strong {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 4vw, 4.6rem);
  line-height: 1;
  max-width: 14ch;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-dark);
  font-weight: 700;
}

.hero-text {
  margin: 0 0 24px;
  max-width: 58ch;
  font-size: 1.03rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button-disabled-look {
  cursor: default;
  opacity: 0.9;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 14px 30px rgba(27, 127, 104, 0.26);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--deep);
  border: 1px solid rgba(16, 36, 33, 0.14);
}

.button-dark {
  background: var(--deep);
  color: #fff;
}

.button-small {
  min-height: 40px;
  padding: 0 16px;
}

.button-submit {
  width: 100%;
  margin-top: 8px;
}

.hero-points {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-points li::before {
  content: "";
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(215, 181, 109, 0.18);
}

.hero-panel {
  padding: 24px;
  border-radius: 30px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero-card,
.hero-metrics article,
.mini-card,
.lookup-result,
.signer-card,
.file-summary,
.success-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 36, 33, 0.08);
}

.hero-card {
  padding: 22px;
}

.hero-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status-dot {
  display: inline-block;
  width: 11px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 14px;
  background: #33bb8d;
  box-shadow: 0 0 0 8px rgba(51, 187, 141, 0.16);
}

.hero-metrics {
  display: grid;
  gap: 14px;
}

.hero-metrics article {
  padding: 18px 20px;
  display: grid;
  gap: 5px;
}

.hero-metrics strong,
.lookup-result strong {
  font-size: 1.2rem;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.trust-strip article {
  padding: 22px;
  border-radius: 22px;
}

.trust-strip h2,
.section-heading h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.trust-strip p,
.section-heading p,
.steps p,
.reassurance-list li {
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.75fr);
  gap: 22px;
}

.workspace-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
}

.workspace-side {
  display: grid;
  gap: 22px;
  align-content: start;
}

.page-grid {
  display: grid;
  gap: 22px;
}

.page-grid-single {
  grid-template-columns: 1fr;
}

.page-grid-narrow {
  grid-template-columns: minmax(0, 1000px);
  justify-content: center;
}

.page-panel {
  min-width: 0;
}

.panel {
  padding: 28px;
  border-radius: 28px;
}

.signature-form,
.lookup-form,
.signers-list {
  display: grid;
  gap: 18px;
}

.limit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(16, 36, 33, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.limit-banner strong {
  display: block;
  margin-bottom: 6px;
}

.limit-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.limit-banner.is-blocked {
  border-color: rgba(141, 79, 56, 0.22);
  background: rgba(255, 248, 244, 0.92);
}

.form-locked .signers-header,
.form-locked .signers-list,
.form-locked .field-grid,
.form-locked .button-submit {
  opacity: 0.55;
}

.limit-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 36, 33, 0.52);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.limit-modal[hidden] {
  display: none;
}

.limit-modal-card {
  width: min(680px, 100%);
  padding: 32px;
  border-radius: 28px;
  border: 1px solid rgba(16, 36, 33, 0.08);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 30px 70px rgba(16, 36, 33, 0.24);
}

.limit-modal-card h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.02;
}

.limit-modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.limit-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.success-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.success-panel[hidden] {
  display: none;
}

.success-card {
  padding: 22px;
  display: grid;
  gap: 8px;
  min-width: 0;
  background:
    linear-gradient(135deg, rgba(27, 127, 104, 0.08), rgba(215, 181, 109, 0.14)),
    rgba(255, 255, 255, 0.88);
}

.success-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-dark);
  font-weight: 700;
}

.success-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2rem);
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.success-card p,
.success-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.success-actions,
.success-steps {
  display: grid;
  gap: 12px;
}

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

.upload-box {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  border: 1.5px dashed rgba(27, 127, 104, 0.36);
  border-radius: 24px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(27, 127, 104, 0.08), rgba(215, 181, 109, 0.16)),
    rgba(255, 255, 255, 0.65);
  overflow: hidden;
  cursor: pointer;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  display: inline-grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 20px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(16, 36, 33, 0.1);
}

.file-summary {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

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

.field-grid-single-row {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
}

label span,
.field-label {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(16, 36, 33, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--text);
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(27, 127, 104, 0.18);
  border-color: var(--primary);
}

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

.signers-header,
.signer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.signers-header p,
.lookup-result p {
  margin: 6px 0 0;
}

.signer-card {
  padding: 16px;
}

.signer-grid {
  margin-bottom: 12px;
}

.signer-actions {
  justify-content: space-between;
}

.signer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(27, 127, 104, 0.1);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.remove-signer {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8d4f38;
  cursor: pointer;
  font-weight: 700;
}

.steps {
  display: grid;
  gap: 16px;
  padding-left: 20px;
}

.steps li {
  padding-left: 6px;
}

.mini-card {
  padding: 18px;
  margin-top: 18px;
  min-width: 0;
}

.mini-card p {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dark);
  font-weight: 700;
}

.lookup-result {
  padding: 20px;
  display: grid;
  gap: 10px;
}

.lookup-result.empty {
  background: rgba(255, 253, 248, 0.88);
}

.lookup-meta,
.lookup-signers,
.lookup-note {
  display: grid;
  gap: 10px;
}

.lookup-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lookup-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 36, 33, 0.08);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lookup-signer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 36, 33, 0.08);
}

.lookup-signer:last-child {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pending {
  background: rgba(215, 181, 109, 0.2);
  color: #78580c;
}

.status-complete {
  background: rgba(51, 187, 141, 0.18);
  color: #176247;
}

.reassurance-list {
  display: grid;
  gap: 12px;
  padding-left: 18px;
  margin: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(16, 36, 33, 0.94);
  color: #fff;
  box-shadow: 0 18px 40px rgba(16, 36, 33, 0.28);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

@media (max-width: 1120px) {
  .hero,
  .workspace,
  .workspace-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
  }

  .topbar,
  .limit-banner,
  .signers-header,
  .signer-actions,
  .lookup-signer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav,
  .hero-actions,
  .lookup-chip-row {
    width: 100%;
  }

  .trust-strip,
  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .panel {
    padding: 22px;
    border-radius: 24px;
  }

  .limit-modal-card {
    padding: 24px;
    border-radius: 24px;
  }

  .brand-logo {
    width: min(180px, 100%);
    max-height: 34px;
  }

  .brand {
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(1.9rem, 11vw, 3rem);
    max-width: 9ch;
  }

  .upload-box {
    min-height: 190px;
  }
}
