:root {
  --background: #dfe5ec;
  --surface: #ffffff;
  --chrome: #20252a;
  --text: #303958;
  --body-text: #20242b;
  --muted: #626b78;
  --border: #d4dae3;
  --primary: #506492;
  --primary-dark: #40527d;
  --primary-soft: #edf0f7;
  --danger: #b42318;
  --success: #19703e;
  --shadow: 0 2px 5px rgba(24, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--body-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: var(--primary);
}

.site-header {
  min-height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  background: var(--chrome);
  border-bottom: 1px solid #15181b;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  text-decoration: none;
}

.brand-wordmark {
  font-size: 1.75rem;
  font-weight: 350;
  letter-spacing: 0.04em;
}

.brand-section {
  padding-left: 16px;
  border-left: 1px solid #555c64;
  color: #d8dce2;
  font-size: 0.95rem;
}

.site-main {
  width: min(100% - 40px, 960px);
  margin: 26px auto 36px;
}

.page-heading {
  margin: 0 0 20px;
}

.page-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 600;
}

.intake-panel {
  padding: clamp(26px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.intake-heading {
  margin-bottom: 32px;
}

.intake-heading h2,
.success-state h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
}

.intake-heading > p:last-child,
.success-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.field,
.file-field {
  margin-bottom: 24px;
}

.field label,
.file-field legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.file-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.upload-reassurance {
  margin: -4px 0 24px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--primary);
  border-radius: 4px;
  background: #f8fafc;
  color: #3e4858;
  font-size: 0.9rem;
  line-height: 1.55;
}

.upload-reassurance strong {
  color: var(--text);
}

.file-field legend {
  float: none;
  width: auto;
  font-size: 1rem;
}

.file-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.file-picker-layout.has-files {
  grid-template-columns: minmax(240px, 0.9fr) minmax(300px, 1.1fr);
  align-items: stretch;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #b8c2d1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field textarea {
  min-height: 156px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.browse-button:focus-visible,
.remove-file:focus-visible,
.submit-button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.18);
}

.upload-zone {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #8f9bb0;
  border-radius: 4px;
  background: #f8f9fb;
  transition: background 120ms ease, border-color 120ms ease;
}

.upload-zone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upload-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.upload-zone p {
  margin: 0;
}

.upload-divider {
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.browse-button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--primary);
  border-radius: 3px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.browse-button:hover {
  background: var(--primary-soft);
}

.browse-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.upload-hint {
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.file-selection {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.file-selection-heading {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.file-selection-heading h2 {
  margin: 0;
  font-size: 0.95rem;
}

.file-selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#file-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.clear-files {
  padding: 4px 8px;
  border: 1px solid #b8c2d1;
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
}

.clear-files:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.clear-files:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.18);
}

#file-list {
  max-height: 242px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.file-item {
  min-width: 0;
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.file-item:last-child {
  border-bottom: 0;
}

.file-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 0.82rem;
}

.remove-file {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.remove-file:hover {
  background: #f3f4f6;
  color: var(--danger);
}

.submit-button {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: 3px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.submit-button:hover {
  background: var(--primary-dark);
}

.confirmation-dialog {
  width: min(100% - 32px, 480px);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body-text);
  box-shadow: 0 18px 48px rgba(24, 34, 48, 0.28);
}

.confirmation-dialog::backdrop {
  background: rgba(24, 34, 48, 0.55);
}

.confirmation-dialog h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1.25rem;
}

.confirmation-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.confirmation-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.confirmation-cancel,
.confirmation-submit {
  padding: 10px 16px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.confirmation-cancel {
  border: 1px solid #b8c2d1;
  background: #fff;
  color: var(--text);
}

.confirmation-submit {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.confirmation-cancel:hover {
  background: #f3f4f6;
}

.confirmation-submit:hover {
  background: var(--primary-dark);
}

.confirmation-cancel:focus-visible,
.confirmation-submit:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.18);
}

.privacy-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.field-validation-error,
.validation-summary {
  color: var(--danger);
  font-size: 0.86rem;
}

.field-validation-error {
  display: block;
  margin-top: 6px;
}

.validation-summary:empty,
.validation-summary-valid {
  display: none;
}

.validation-summary-errors {
  margin-bottom: 24px;
  padding: 12px 14px;
  border: 1px solid #f0b4ae;
  border-radius: 8px;
  background: #fff3f2;
}

.validation-summary ul {
  margin: 0;
  padding-left: 20px;
}

.success-state {
  padding: 48px 0;
  text-align: center;
}

.policy-content p {
  color: var(--muted);
  line-height: 1.65;
}

.success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f6ee;
  color: var(--success);
  font-size: 1.8rem;
  font-weight: 750;
}

.site-footer {
  width: min(100% - 40px, 960px);
  margin: 0 auto 32px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #525c69;
  font-size: 0.82rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 600px) {
  .site-header {
    min-height: 58px;
    padding: 0 18px;
  }

  .site-main {
    width: min(100% - 20px, 960px);
    margin: 20px auto;
  }

  .intake-panel {
    padding: 22px 18px;
  }

  .site-footer {
    width: min(100% - 20px, 960px);
  }

  .confirmation-actions {
    flex-direction: column-reverse;
  }

  .confirmation-cancel,
  .confirmation-submit {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .file-picker-layout.has-files {
    grid-template-columns: minmax(0, 1fr);
  }

  #file-list {
    max-height: 220px;
  }
}