/* 入力欄は外側の新しい枠を使わず、背景と既存borderの色で状態を示す。 */
body :is(input, textarea)::placeholder {
  color: #b8c0c9;
  opacity: 1;
}

.form-confirm-modal {
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: 90dvh;
  margin: auto;
  padding: clamp(16px, 4vw, 32px);
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
}

.form-confirm-modal::backdrop {
  background: rgb(0 76 158 / 80%);
}

.form-confirm-modal #form-confirm {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.form-confirm-modal .form-modal-close {
  display: block;
  width: auto;
  min-width: 0;
  margin: 0 0 16px auto;
  padding: 8px 16px;
}

.form-confirm-modal dt {
  font-weight: 700;
}

.form-confirm-modal dd {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body form :is(input, select, textarea):focus,
body #estimate .checks label:focus-within {
  outline: none;
  box-shadow: none;
}

body :is(#contact, #estimate) :is(input, select, textarea):focus {
  border-color: var(--primary);
  background-color: #e8f2ff;
  color: var(--ink);
}

body :is(#contact, #estimate) .field label:has(input:is([type='checkbox'], [type='radio']):focus-visible) {
  background-color: #dcecff;
  color: var(--primary);
  border-color: var(--primary);
}

body :is(#contact, #estimate) .field.has-error:not(:has([name='privacy'])) :is(input, select, textarea) {
  border-color: #c62828;
  background-color: #fff0f0;
  color: var(--ink);
}

body :is(#contact, #estimate) .field.has-error:not(:has([name='privacy'])) label:has(input:is([type='checkbox'], [type='radio'])) {
  background-color: #fff0f0;
  border-color: #c62828;
  color: #a51f1f;
}

.email-suggestions {
  grid-column: 1 / -1;
  max-height: 180px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--line);
}

body #contact .email-suggestions button {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: white;
  color: var(--primary);
  font-size: 16px;
  text-align: left;
  overflow-wrap: anywhere;
}

body #contact .email-suggestions button:hover,
body #contact .email-suggestions button:focus-visible {
  background: #e8f2ff;
}

body :is(#contact, #estimate) .field .field-error {
  grid-column: 1 / -1;
  width: 100%;
  margin: 8px 0 0;
  color: #b42323;
  font-size: 0.85rem;
  font-weight: 600;
}
