body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 20px;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font-family: Arial, sans-serif;
}

.page-shell {
  width: 100%;
}

.service-card {
  background: white;
  padding: 20px;
  max-width: 980px;
  margin: auto;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.app-header {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.app-header h1 {
  margin: 0;
  color: #1f2933;
  font-size: 30px;
}

.welcome-text {
  margin: 8px 0 0;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.user-strip {
  margin-bottom: 20px;
  color: #475569;
  font-size: 13px;
}

.form-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #d8dee4;
}

.form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-section h1,
.form-section h2 {
  margin: 0 0 16px;
  color: #1f2933;
}

.form-section h1 {
  font-size: 24px;
}

.form-section h2 {
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

.form-grid > label {
  margin: 0;
  text-align: right;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  color: #1f2933;
}

input,
select {
  min-height: 38px;
}

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

input:focus,
select:focus,
textarea:focus,
.signature-canvas:focus {
  outline: 3px solid rgba(31, 78, 121, 0.18);
  border-color: #1f4e79;
}

.date-time-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}

.required {
  color: #9b1c1c;
}

.totals {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.totals div {
  background: #eef3f8;
  padding: 12px;
  border-radius: 8px;
  min-width: 180px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 24px;
  margin-bottom: 16px;
}

.check-grid label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.check-grid input[type="checkbox"] {
  width: auto;
  height: auto;
  min-width: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  appearance: auto;
  -webkit-appearance: auto;
}

.signature-block {
  margin-top: 16px;
}

.signature-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-weight: bold;
}

.signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  background: white;
  border: 1px solid #bbb;
  border-radius: 6px;
  touch-action: none;
}

.field-help {
  margin: -2px 0 10px;
  color: #64748b;
  font-size: 12px;
}

button,
.primary-button,
.secondary-button,
.portal-button {
  margin-top: 16px;
  padding: 10px 18px;
  background: #1f4e79;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.header-actions button,
.header-actions .portal-button,
.signature-heading button,
.status-panel button {
  margin-top: 0;
}

.primary-button {
  width: 100%;
}

.secondary-button {
  background: #555;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.submit-row {
  margin-top: 20px;
}

.status-panel {
  margin-top: 20px;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
}

.status-panel p {
  margin: 0 0 12px;
}

.status-panel.info {
  color: #084298;
  background: #cfe2ff;
  border: 1px solid #b6d4fe;
}

.status-panel.success {
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #badbcc;
}

.status-panel.error {
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
}

.hidden {
  display: none !important;
}

.busy .service-card {
  cursor: wait;
}

@media (max-width: 700px) {
  body {
    padding: 10px;
  }

  .service-card {
    padding: 16px;
  }

  .app-header {
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .form-grid > label {
    margin-top: 8px;
    text-align: left;
  }

  .date-time-row,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .totals {
    flex-direction: column;
  }

  .totals div {
    width: 100%;
  }

  .signature-canvas {
    height: 170px;
  }
}
