:root {
  color-scheme: light;
  --ink: #153045;
  --muted: #657587;
  --paper: #f2f0e8;
  --panel: #ffffff;
  --midnight: #0e2235;
  --blue: #123f68;
  --blue-2: #154c77;
  --tan: #dbb189;
  --cyan: #38aee3;
  --line: rgba(21, 48, 69, 0.18);
  --shadow: 0 26px 70px rgba(14, 34, 53, 0.22);
  font-family: Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.page-shell {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) 0;
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1fr);
  gap: 48px;
  align-items: start;
}

.intro-panel {
  min-height: clamp(620px, calc(100vh - 150px), 760px);
  padding: clamp(30px, 3vw, 46px);
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    var(--midnight);
  background-size: 44px 44px, auto;
}

.brand-row {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(42px, 6vw, 72px);
}

.firm-logo {
  width: min(230px, 68vw);
  height: auto;
  display: block;
}

.call-link {
  color: var(--tan);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 2px solid currentColor;
  padding-bottom: 5px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 36px;
}

.language-option {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  color: #ffffff;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
}

.language-option.is-active {
  background: #ffffff;
  color: var(--ink);
}

.eyebrow,
.signature-kicker {
  margin: 0 0 12px;
  color: var(--tan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.77rem;
  font-weight: 800;
}

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

h1 {
  max-width: 430px;
  margin-bottom: 22px;
  font-family: "adobe-aldine", Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 3.5vw, 3.85rem);
  line-height: 1.04;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.capture-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 34px);
  margin-top: 0;
  width: 100%;
  max-width: 620px;
}

.request-banner {
  display: grid;
  gap: 5px;
  padding: 18px;
  margin-bottom: 28px;
  color: #ffffff;
  background: var(--blue);
  border-left: 5px solid var(--tan);
}

.request-banner.is-missing {
  color: var(--ink);
  background: linear-gradient(135deg, #ffffff 0%, #f8f3ec 100%);
  border: 1px solid rgba(21, 48, 69, 0.16);
  border-left: 5px solid var(--tan);
}

.request-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.request-banner strong {
  font-size: 1.24rem;
}

.request-banner span {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.request-banner.is-missing p,
.request-banner.is-missing span {
  color: var(--muted);
}

.signature-warning {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(219, 177, 137, 0.2), transparent 58%),
    #fffaf2;
  border: 1px solid rgba(219, 177, 137, 0.68);
}

.modal-signature-warning {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
  padding: 14px;
  color: #ffffff;
  background: rgba(219, 177, 137, 0.13);
  border: 1px solid rgba(219, 177, 137, 0.42);
}

.warning-mark,
.rotate-phone {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
}

.warning-mark svg,
.rotate-phone svg {
  width: 24px;
  height: 24px;
}

.signature-warning strong,
.modal-signature-warning strong {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--blue);
}

.modal-signature-warning strong {
  color: var(--tan);
}

.signature-warning p,
.modal-signature-warning span {
  margin: 0;
  line-height: 1.45;
}

.rotate-callout {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.rotate-callout strong {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
  font-size: 1rem;
}

.rotate-callout p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.42;
}

.rotate-callout .rotate-phone {
  color: var(--blue);
  background: #ffffff;
}

.form-section {
  padding: 0 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.step-count {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #ffffff;
  font-family: "adobe-aldine", Georgia, "Times New Roman", serif;
}

h2 {
  margin-bottom: 4px;
  font-family: "adobe-aldine", Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 400;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.wide {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(21, 48, 69, 0.28);
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  border-radius: 0;
}

input:focus,
button:focus-visible {
  outline: 3px solid rgba(56, 174, 227, 0.48);
  outline-offset: 3px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.upload-tile {
  min-height: 286px;
  position: relative;
  overflow: hidden;
  border: 1.5px dashed rgba(18, 63, 104, 0.46);
  background:
    linear-gradient(135deg, rgba(18, 63, 104, 0.09), transparent 46%),
    #ffffff;
  padding: 22px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
}

.upload-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
  min-height: 100%;
  cursor: pointer;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--blue);
}

.upload-copy {
  display: grid;
  gap: 6px;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.upload-copy strong {
  font-size: 1.18rem;
}

.upload-copy small {
  color: var(--muted);
  line-height: 1.35;
}

.preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-tile.has-image {
  border-style: solid;
}

.upload-tile.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 34, 53, 0.08), rgba(14, 34, 53, 0.74));
}

.upload-tile.has-image .upload-icon,
.upload-tile.has-image .upload-copy {
  color: #ffffff;
  z-index: 2;
  align-self: end;
}

.upload-tile.has-image .upload-copy small {
  color: rgba(255, 255, 255, 0.78);
}

.legal-box {
  padding: 18px;
  background: var(--paper);
  border-left: 5px solid var(--tan);
  margin-bottom: 16px;
}

.legal-box p {
  margin-bottom: 0;
  color: #3d3a32;
  line-height: 1.55;
}

.signature-launch {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(21, 48, 69, 0.24);
  padding: 18px;
  text-align: left;
}

.signature-launch span {
  width: 34px;
  height: 34px;
  color: var(--blue);
  flex: 0 0 auto;
}

.signature-launch.is-complete {
  border-color: rgba(18, 63, 104, 0.8);
  background: rgba(18, 63, 104, 0.08);
}

.signature-preview-card {
  margin-top: 14px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(18, 63, 104, 0.06), transparent 52%),
    #ffffff;
  border: 1px solid rgba(21, 48, 69, 0.18);
}

.signature-preview-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.signature-preview-heading strong {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.signature-preview-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.signature-redo-button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(18, 63, 104, 0.26);
  background: #ffffff;
  color: var(--blue);
  padding: 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

.signature-preview-surface {
  min-height: 150px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(21, 48, 69, 0.16);
}

.signature-preview-surface img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.signature-preview-line {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 28%;
  border-bottom: 2px solid rgba(21, 48, 69, 0.18);
  pointer-events: none;
}

.consent-row {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 12px;
  color: var(--ink);
  line-height: 1.45;
  margin-bottom: 22px;
}

.consent-row input {
  min-height: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--blue);
}

.form-actions {
  display: grid;
  gap: 14px;
}

.status-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.status-message.is-error {
  color: #b0311d;
}

.status-message.is-success {
  color: var(--blue);
  font-weight: 800;
}

.submit-button,
.primary-button,
.secondary-button {
  min-height: 56px;
  border: 0;
  padding: 0 22px;
  font-weight: 800;
}

.submit-button,
.primary-button {
  color: #ffffff;
  background: var(--blue);
}

.secondary-button {
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.52);
}

.submit-button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

.signature-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  grid-template-rows: auto auto 1fr auto;
  background: var(--midnight);
  color: #ffffff;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.signature-modal.is-open {
  display: grid;
}

.signature-toolbar {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 16px;
  align-items: start;
}

.signature-top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signature-legal {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.38;
  max-width: 980px;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 12px;
}

.signature-info-button {
  display: none;
}

.signature-help {
  max-width: 340px;
  margin: 10px 0 0;
  padding: 12px 14px;
  color: #ffffff;
  background: rgba(21, 48, 69, 0.96);
  border: 1px solid rgba(219, 177, 137, 0.72);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.rotate-nudge {
  margin: 12px 0;
  color: var(--tan);
  font-weight: 800;
  text-align: center;
}

.signature-stage {
  min-height: 280px;
  position: relative;
  background: #ffffff;
  border: 3px solid rgba(219, 177, 137, 0.9);
  overflow: hidden;
  touch-action: none;
}

#signature-pad {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.signature-line {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 23%;
  border-bottom: 2px solid rgba(21, 48, 69, 0.22);
  pointer-events: none;
}

.signature-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.signature-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.signature-actions svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

@media (orientation: landscape) and (max-height: 700px) {
  .signature-modal {
    display: none;
    grid-template-rows: 1fr;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
  }

  .signature-modal.is-open {
    display: grid;
  }

  .signature-context,
  .rotate-nudge {
    display: none;
  }

  .signature-toolbar {
    position: absolute;
    inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) auto max(8px, env(safe-area-inset-left));
    z-index: 4;
    display: block;
    pointer-events: none;
  }

  .signature-top-controls {
    width: 100%;
    justify-content: space-between;
    pointer-events: none;
  }

  .signature-info-button,
  .icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 9px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(21, 48, 69, 0.22);
    box-shadow: 0 10px 24px rgba(21, 48, 69, 0.18);
    pointer-events: auto;
  }

  .signature-help {
    position: absolute;
    top: max(54px, calc(env(safe-area-inset-top) + 54px));
    left: max(8px, env(safe-area-inset-left));
    z-index: 5;
    width: min(310px, calc(100vw - 96px));
    margin: 0;
    color: #ffffff;
    background: rgba(14, 34, 53, 0.96);
  }

  .signature-stage {
    position: absolute;
    inset: 0;
    min-height: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
  }

  .signature-line {
    left: 9%;
    right: 9%;
    bottom: 28%;
    border-bottom-color: rgba(21, 48, 69, 0.2);
  }

  .signature-actions {
    position: absolute;
    z-index: 4;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    margin: 0;
    pointer-events: none;
  }

  .signature-actions button {
    width: 48px;
    min-height: 48px;
    padding: 0;
    pointer-events: auto;
    border: 1px solid rgba(21, 48, 69, 0.22);
    box-shadow: 0 10px 24px rgba(21, 48, 69, 0.18);
  }

  .signature-actions span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .signature-actions .secondary-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
  }

  .signature-actions .primary-button {
    color: #ffffff;
    background: var(--blue);
  }
}

@media (max-width: 840px) {
  html {
    background: var(--paper);
  }

  .page-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .intro-panel {
    min-height: 0;
    padding: 18px 20px 34px;
  }

  .brand-row {
    min-height: 72px;
    margin-bottom: 30px;
    justify-content: center;
  }

  .language-switch {
    margin-bottom: 30px;
  }

  .capture-card {
    margin-top: 0;
    box-shadow: none;
    border: 0;
  }
}

@media (max-width: 600px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: center;
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .firm-logo {
    width: min(238px, 70vw);
  }

  .call-link {
    font-size: 1.05rem;
  }

  .intro-panel {
    text-align: center;
    padding: 24px 22px 42px;
  }

  .intro-panel .eyebrow,
  .intro-panel .lead,
  .intro-panel h1 {
    margin-left: auto;
    margin-right: auto;
  }

  .language-switch {
    margin-left: auto;
    margin-right: auto;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.75rem);
  }

  .lead {
    font-size: 1.08rem;
  }

  .signature-warning,
  .rotate-callout {
    grid-template-columns: 1fr;
  }

  .warning-mark,
  .rotate-phone {
    width: 38px;
    height: 38px;
  }

  .section-heading {
    grid-template-columns: 42px 1fr;
    gap: 12px;
  }

  .step-count {
    width: 42px;
    height: 42px;
  }

  .upload-tile {
    min-height: 208px;
  }

  .signature-preview-heading {
    display: grid;
  }

  .signature-redo-button {
    width: 100%;
  }
}
