* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: none;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #dbdada;
  color: #222;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: 100%;
}

.contract-card {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 20px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1);
}

.form-banner {
  width: 100%;
  margin-bottom: 20px;
  border-radius: 10px;
  display: block;
}

.form-header h1 {
  margin: 10px 0 14px;
  font-size: 20px;
  line-height: 1.4;
}

.black-line {
  width: 100%;
  height: 2px;
  background: #000;
}

.margin-line {
  margin: 24px 0 8px;
}

.form-section h2 {
  margin: 18px 0 4px;
  font-size: 16px;
  line-height: 1.6;
}

.question-block {
  width: 100%;
  margin: 20px 0 0;
}

.question-block p {
  width: 100%;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.question-block p span {
  color: red;
  font-size: 18px;
}

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

.option-grid label,
.checkbox-list label {
  display: flex;
  align-items: center;
  min-height: 24px;
  font-size: 14px;
  line-height: 1.5;
  user-select: none;
}

.option-grid input,
.checkbox-list input {
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  flex: 0 0 auto;
}

.checkbox-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  padding: 10px 12px;
  color: #222;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input[type="text"],
input[type="date"] {
  min-height: 42px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #4c4c4c;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
}

.signature-wrap {
  position: relative;
}

.signature-canvas {
  width: 100%;
  height: 160px;
  display: block;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  background: #fff;
  touch-action: none;
}

.clear-signature {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 0;
  background: rgba(255, 255, 255, .85);
  color: #333;
  font-size: 14px;
}

.submit-button {
  display: block;
  width: 60%;
  height: 50px;
  margin: 24px auto 0;
  border: 1px solid #4c4c4c;
  border-radius: 3px;
  background: #fff;
  color: #4c4c4c;
  font-size: 14px;
  line-height: 50px;
  text-align: center;
  transition: all .3s;
}

.submit-button:hover,
.submit-button:disabled {
  background: #4c4c4c;
  color: #fff;
}

.submit-button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.form-message {
  display: none;
  margin-top: 20px;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.form-message.show {
  display: block;
}

.form-message.error {
  border: 1px solid #ffd6d6;
  background: #fff2f2;
  color: #b00020;
}

.form-message.success {
  border: 1px solid #d6f0d6;
  background: #f2fff2;
  color: #176c25;
}

.field-error {
  outline: 2px solid rgba(176, 0, 32, .25);
  outline-offset: 4px;
}

.thanks-page {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  background: #fff;
  overflow: hidden;
}

.thanks-toast {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  background: #fff7e8;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  color: #5b4a2e;
  font-weight: 700;
  text-align: center;
}

.thanks-img {
  width: 100%;
  display: block;
}

.download-row {
  width: 100%;
  height: 70px;
  margin: -12px 0 -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5b4a2e;
}

.store-btn {
  width: 40%;
  max-width: 250px;
  margin: 0 10px;
  cursor: pointer;
}

.thanks-second-wrap {
  position: relative;
}

.white-banner {
  position: absolute;
  left: 0;
  bottom: 280px;
  width: 60%;
  cursor: pointer;
}


.guide-qr-row {
  width: 100%;
  min-height: 172px;
  margin: -12px 0 -8px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5b4a2e;
}

.guide-qr-card {
  width: min(78%, 360px);
  min-height: 138px;
  padding: 14px 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.guide-qr-title {
  margin-bottom: 8px;
  color: #f7f2d2;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.guide-qr-image {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.guide-qr-message {
  padding: 18px 8px;
  color: #7a6742;
  font-size: 15px;
  font-weight: 700;
}

@media screen and (max-width: 480px) {
  .guide-qr-row {
    min-height: 156px;
    padding: 16px 12px;
  }

  .guide-qr-card {
    width: 78%;
    min-height: 126px;
    padding: 12px 14px;
  }

  .guide-qr-title {
    font-size: 16px;
  }

  .guide-qr-image {
    width: 116px;
    height: 116px;
  }

  .contract-card {
    padding: 24px 16px;
  }

  .option-grid {
    gap: 10px 4px;
  }

  .submit-button {
    width: 70%;
  }

  .white-banner {
    bottom: 220px;
  }
}

.invalid-scan-body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
}

.invalid-scan-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #111827;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .03em;
}

.invalid-scan-text {
  text-align: center;
}
