/* Consultation form modal. The form lives here instead of taking half of the hero;
   every consult button on the page opens it (contact-modal.js). */

.cm {
  /* index.css zeroes every margin, which would pin the dialog to the top-left. */
  margin: auto;
  /* the form's colours live on .fv in hero-fv.css; repeat them here */
  --ink: #1b1f4b;
  --muted: #5b6282;
  --primary: #4f46e5;
  --primary-2: #5b54f0;
  --field: #f3f4fb;
  --u: 1px;
  --t: 1px;
  color: var(--ink);
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  overflow: visible;
}

.cm svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cm a { text-decoration: none; }
.cm .fv-form__privacy a { text-decoration: underline; }

.cm::backdrop { background: rgba(10, 18, 60, 0.55); backdrop-filter: blur(4px); }
.cm[open] { animation: cm-in 0.2s ease-out; }

/* index.css sets `* { font-size: 16px; line-height: 1 }`; restore inheritance inside the modal. */
:where(.cm) *, :where(.cm) *::before, :where(.cm) *::after {
  box-sizing: border-box;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
}

.cm__panel {
  position: relative;
  max-height: min(88vh, 900px);
  overflow-y: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(15, 26, 77, 0.35);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.5;
}

.cm__close {
  position: absolute;
  top: 12px;
  right: 12px;
  /* the form carries z-index 3 from hero-fv.css */
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f1f3fb;
  color: #3a4468;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cm__close:hover { background: #e6e9f6; }

/* The form keeps its hero styling; the modal only adjusts box-level properties. */
.cm .fv-form {
  position: static;
  z-index: auto;
  --u: 1px;
  --t: 1px;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 38px 28px 26px;
  border-radius: 18px;
  box-shadow: none;
}

.cm .fv-form__kicker { font-size: 13px; }
.cm .fv-form__title { font-size: 22px; }
.cm .fv-form__lead { margin: 10px 0 18px; font-size: 13.5px; }
.cm .fv-field { grid-template-columns: 132px 1fr; height: 46px; margin-bottom: 10px; }
.cm .fv-field__label { font-size: 13px; white-space: nowrap; }
.cm .fv-field input { height: 44px; font-size: 16px; }
.cm .fv-form__privacy { font-size: 12px; }
.cm .fv-form__privacy br { display: none; }
.cm .fv-form__submit { height: 56px; margin-top: 16px; font-size: 17px; }
.cm .fv-form__download { margin-top: 14px; font-size: 14px; }
.cm .fv-form__status { margin-top: 8px; font-size: 13px; }

@media (max-width: 767px) {
  .cm { width: 100%; max-height: 92vh; margin: 0; }
  .cm__panel { max-height: 92vh; border-radius: 18px 18px 0 0; }
  .cm .fv-form { padding: 34px 18px 22px; border-radius: 18px 18px 0 0; }
  .cm .fv-field { grid-template-columns: 1fr; height: auto; }
  .cm .fv-field__label { padding: 0 0 4px 2px; }
  .cm[open] { animation: cm-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .cm { top: auto; bottom: 0; }
}

html.is-modal-open { overflow: hidden; }

@keyframes cm-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes cm-up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .cm[open] { animation: none; }
}
