/* Contact form, validation states and confirmation dialog. */
.sending-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 9999;
}

body.page .contact-phone {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
  padding: 35px 7%;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}

body.page .contact-phone a {
  font: 30px Georgia, serif;
  letter-spacing: .06em;
}

body.page .contact-phone small {
  color: var(--muted);
}

body.page .contact-form>div {
  max-width: 850px;
  margin: auto;
}

body.page .form-group {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 15px 25px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
  align-items: start;
  position: relative;
}

body.page .form-group label {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-top: 13px;
  font-size: 14px;
}

body.page .required {
  font-size: 10px;
  padding: 2px 7px;
  background: #eaf5f5;
  color: var(--color-accent-text);
}

body.page .form-group input,
body.page .form-group textarea,
body.page .form-group select {
  width: 100%;
  border: 1px solid #bbcccd;
  border-radius: 0;
  padding: 13px 15px;
  background: #fafcfb;
  color: var(--ink);
  font-size: 16px;
}

body.page .form-group textarea {
  resize: vertical;
  min-height: 160px;
}

body.page .form-group input:focus,
body.page .form-group textarea:focus,
body.page .form-group select:focus {
  outline: 2px solid var(--color-accent-text);
  outline-offset: 2px;
}

body.page .recaptcha-notice {
  margin-top: 20px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
body.page .recaptcha-notice a { text-decoration: underline; }

@media (min-width: 769px) {
  body.page .recaptcha-notice { text-align: center; }
}

body.page .form-submit {
  text-align: center;
  padding-top: 30px;
}

body.page .form-submit .btn,
body.page .modal-buttons .btn {
  padding: 17px 40px;
  background: var(--color1);
  color: white;
  font-size: 15px;
}

body.page .modal-buttons .btn:hover {
  background: #b8e6eb;
}

body.page .modal-buttons #sendBtn {
  background: color-mix(in srgb, var(--color1) 85%, var(--ink));
}

body.page .form-submit .btn:hover,
body.page .modal-buttons #sendBtn:hover {
  background: var(--ink);
}

body.page .err input,
body.page .err textarea {
  border-color: #a83232;
}

body.page .error-box {
  padding: 18px 24px;
  margin-bottom: 25px;
  border-left: 3px solid #a83232;
  background: #fff3f1;
  color: #8c2929;
}

body.page .error-box p {
  margin: 0;
  font-size: 14px;
}

body.page .email-suggest {
  grid-column: 2;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
}

body.page .email-suggest div {
  padding: 10px 15px;
  cursor: pointer;
}

body.page .email-suggest div:hover {
  background: #eaf5f5;
}

body.page .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 24px;
  background: rgb(20 45 48 / 55%);
  align-items: center;
  justify-content: center;
}

body.page .modal.show {
  display: flex;
}

body.page .modal-content {
  background: #fff;
  width: min(100%, 650px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 40px;
}

body.page .modal-content h4 {
  font-family: "Noto Serif JP", serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 25px;
}

body.page #confirmFields p {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  overflow-wrap: anywhere;
}

body.page .modal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

body.page .modal-buttons .btn-secondary {
  background: #edf2f1;
}

body.page .sending-overlay {
  z-index: 10001;
}

/* Leave space above the bottom-right reCAPTCHA badge (60px + 14px inset). */
body#contact:has(#contactForm[data-recaptcha-enabled="true"]) .back-to-top {
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  body.page .form-group {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 0;
  }

  body.page .form-group label {
    padding-top: 0;
  }

  body.page .email-suggest {
    grid-column: 1;
  }

  body.page .contact-phone {
    flex-direction: column;
    gap: 12px;
  }

  body.page .modal-content {
    padding: 25px;
  }
}
