* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f7f4ee;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f4ee;
  color: #373735;
  -webkit-font-smoothing: antialiased;
}

.client-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.client-shell {
  width: min(100%, 560px);
  background: #fff;
  border: 1px solid #e7e1d6;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(55, 55, 53, .12);
  overflow: hidden;
}

.client-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid #e7e1d6;
  background: #fff;
}

.client-head img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
}

.client-head span {
  display: block;
  color: #836c3f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.client-head h1 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.client-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.client-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-form label > span,
.client-form legend {
  color: #665844;
  font-size: 12px;
  font-weight: 800;
}

.client-form input,
.client-form select,
.client-form textarea {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  border: 1px solid #d8d3c9;
  border-radius: 6px;
  background: #fff;
  color: #373735;
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
  padding: 12px;
  outline: none;
}

.client-form input,
.client-form select {
  min-height: 48px;
}

.client-form select {
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #665844 50%),
    linear-gradient(135deg, #665844 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 21px,
    calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.client-form input::placeholder,
.client-form textarea::placeholder {
  color: #9b9286;
  opacity: 1;
}

.client-form input:focus,
.client-form select:focus,
.client-form textarea:focus {
  border-color: #1d9e75;
  box-shadow: 0 0 0 3px rgba(29, 158, 117, .16);
}

.client-form textarea {
  resize: vertical;
  min-height: 120px;
}

.client-photo-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px dashed #b9a77f;
  border-radius: 6px;
  background: #fffaf0;
  color: #665844;
  padding: 12px;
}

.client-photo-box strong {
  font-size: 14px;
}

.client-photo-box small {
  color: #8a7a5f;
  font-size: 12px;
  font-weight: 700;
}

.client-photo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.client-photo-actions button {
  min-height: 42px;
  border: 1px solid #b9a77f;
  border-radius: 6px;
  background: #fff;
  color: #665844;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.client-photo-box input {
  display: none;
}

.client-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.client-form legend {
  margin-bottom: 8px;
}

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

.client-urgency {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-choice-grid label,
.client-urgency label {
  position: relative;
  display: block;
}

.client-choice-grid input,
.client-urgency input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.client-choice-grid span,
.client-urgency span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid #d8d3c9;
  border-radius: 6px;
  background: #faf8f5;
  color: #373735;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.client-choice-grid input:checked + span,
.client-urgency input:checked + span {
  border-color: #1d9e75;
  background: #eaf8f2;
  color: #11654b;
}

#client-submit {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: #1d9e75;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  padding: 14px 16px;
  cursor: pointer;
}

#client-submit:disabled {
  opacity: .65;
  cursor: wait;
}

.client-status {
  min-height: 20px;
  margin: 0;
  color: #665844;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.client-status.ok {
  color: #11654b;
}

.client-status.err {
  color: #b42318;
}

.client-hp {
  display: none;
}

@media (max-width: 560px) {
  .client-page {
    align-items: stretch;
    padding: 0;
  }

  .client-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .client-head,
  .client-form {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .client-form {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .client-head h1 {
    font-size: 21px;
  }

  .client-choice-grid,
  .client-urgency {
    grid-template-columns: 1fr;
  }
}
