:root {
  --ink: #080808;
  --muted: #5f646b;
  --line: #e3e3e3;
  --line-strong: #c9c9c9;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --page: #f7f7f7;
  --brand: #000000;
  --brand-strong: #1e1e1e;
  --accent: #fd152f;
  --accent-strong: #d80f25;
  --accent-soft: #fff1f3;
  --danger: #b42318;
  --success: #0b6b4f;
  --focus: #fd152f;
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 300px),
    var(--page);
  font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

gmp-place-autocomplete {
  display: block;
  width: 100%;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.app-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 26px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: clamp(170px, 20vw, 245px);
  height: auto;
}

.form-title {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

h2 {
  font-size: 1.18rem;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.form-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.form-layout.is-gated {
  grid-template-columns: minmax(0, 960px);
  justify-content: center;
}

.form-layout.is-gated .claim-form {
  grid-column: 1;
}

.invalid-link-panel {
  margin-bottom: 18px;
  border-top-color: var(--danger);
}

.section-sidebar {
  position: sticky;
  top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-title {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-nav {
  display: grid;
}

.section-nav a {
  display: block;
  border-left: 4px solid transparent;
  padding: 12px 16px 12px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 750;
}

.section-nav a:hover,
.section-nav a.active {
  border-left-color: var(--accent);
  color: var(--brand);
  background: var(--accent-soft);
}

.claim-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.claim-form-body {
  display: grid;
  gap: 18px;
}

.claim-intro-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(8, 8, 8, 0.58);
  padding: 24px;
}

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

.claim-intro-card {
  width: min(920px, 100%);
  max-height: min(88vh, 920px);
  overflow-y: auto;
  border-top-width: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.success-modal-card .step {
  background: var(--success);
}

.claim-declaration-copy,
.local-save-info {
  display: grid;
  gap: 12px;
}

.claim-declaration-copy {
  color: var(--ink);
  font-size: 0.96rem;
}

.claim-declaration-copy a {
  color: var(--accent);
  font-weight: 850;
}

.declaration-required {
  margin-top: 18px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 16px;
  color: var(--ink);
}

.field-validation-message {
  margin-top: -8px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.local-save-info {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
  color: var(--muted);
}

.local-save-info strong {
  color: var(--brand);
}

.intro-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.local-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 13px 16px;
}

.local-draft-notice strong {
  flex: 0 0 auto;
  color: var(--brand);
}

.local-draft-notice span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.form-section {
  scroll-margin-top: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.94rem;
}

.step {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
}

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

.upload-grid,
.option-grid {
  margin-top: 16px;
}

.inline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

label,
fieldset {
  min-width: 0;
}

label,
.signature-header label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.label-row em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.field-grid > label,
.inline-grid > label,
label.full-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[readonly] {
  color: #4d4d4d;
  background: var(--surface-soft);
}

.uppercase-field {
  text-transform: uppercase;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

input[type="file"] {
  min-height: auto;
  padding: 10px;
}

input:focus,
select:focus,
textarea:focus,
canvas:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(253, 21, 47, 0.14);
}

.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.full-field {
  margin-top: 16px;
}

fieldset {
  display: grid;
  gap: 9px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 15px;
}

legend {
  padding: 0 4px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 900;
}

fieldset label,
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-weight: 650;
}

.conditional-block {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.subsection-block {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 18px;
}

.subsection-heading {
  display: grid;
  gap: 4px;
}

.subsection-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.subsection-heading p {
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-field {
  min-height: 136px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.upload-field span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.field-note {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.place-autocomplete-shell {
  margin-top: 8px;
}

.place-autocomplete-shell.field-error {
  outline: 2px solid rgba(180, 35, 24, 0.18);
  border-radius: 8px;
}

.location-summary {
  display: grid;
  gap: 4px;
  margin-top: -2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.location-summary strong {
  color: var(--brand);
}

.location-summary.error {
  display: block;
  margin-top: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.stored-files {
  display: grid;
  gap: 8px;
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.stored-files strong {
  color: var(--brand);
}

.attachment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 8px;
}

.attachment-details {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}

.attachment-actions {
  display: inline-flex;
  gap: 6px;
}

.file-action {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--brand);
  padding: 0 10px;
  font-size: 0.76rem;
}

.file-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-action.danger {
  color: var(--danger);
}

.declaration-copy {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  color: #394653;
  background: var(--accent-soft);
  padding: 15px 16px;
  font-weight: 650;
}

.signature-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.signature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#signaturePad {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.consent-row {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 4px 0;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: var(--brand);
  background: #eeeeee;
}

.compact {
  min-height: 36px;
  padding: 0 12px;
}

.message {
  min-height: 46px;
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
}

.message.success {
  color: var(--success);
  background: #dff3ef;
}

.message.error {
  color: var(--danger);
  background: #fde8e6;
}

@media (max-width: 980px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .section-sidebar {
    position: static;
  }

  .section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 16px;
  }

  .topbar,
  .brand-lockup {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .brand-lockup {
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: min(230px, 78vw);
  }

  .status-pill,
  .section-nav a {
    width: 100%;
  }

  .section-nav,
  .field-grid,
  .upload-grid,
  .option-grid,
  .inline-grid,
  .local-draft-notice {
    grid-template-columns: 1fr;
  }

  .local-draft-notice {
    display: grid;
  }

  .form-section {
    padding: 18px;
  }

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

  .attachment-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions button,
  .intro-actions button {
    width: 100%;
  }

  #signaturePad {
    height: 190px;
  }
}
