/*
 * All of the site's forms (2026-11-09): /form_contact/, /form_quote/ (src/components/LeadForm.astro) and the /lp/
 * pages' forms (public/common/js/lp-form.js) share this one file, so they look and behave the same.
 * Choices are full-width rows (long answers such as "法人事業 ※…" wrap inside them, and they are easy to tap on a
 * phone); the chosen row turns orange. Inputs are 16px so iPhone Safari does not zoom in.
 */
.lead_form {
  --lf-accent: #ff4c00;
  --lf-accent-soft: #fff3ec;
  --lf-ink: #222;
  --lf-sub: #666;
  --lf-line: #d6d6d6;
  --lf-err: #c62828;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 688px;
  margin: 0 auto;
  padding: 40px 24px 48px;
  background: #fff;
  border-radius: 12px;
  color: var(--lf-ink);
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
}
.lead_form * { box-sizing: border-box; letter-spacing: normal; }
@media (max-width: 767px) { .lead_form { padding: 28px 16px 36px; gap: 22px; } }

.lead_form .lf_trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead_form .lf_title { margin: 0 0 4px; font-size: 24px; font-weight: 700; line-height: 1.4; text-align: center; }
@media (max-width: 767px) { .lead_form .lf_title { font-size: 20px; } }

/* Sections: a heading over a thin line (LeadForm's fieldset legend and the LP forms' h3 look the same). */
.lead_form .lf_section { display: flex; flex-direction: column; gap: 24px; margin: 0; padding: 0; border: 0; min-width: 0; }
.lead_form .lf_section > legend,
.lead_form .lf_head {
  width: 100%;
  margin: 8px 0 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--lf-line);
  font-size: 17px;
  font-weight: 700;
  color: var(--lf-ink);
}
.lead_form .lf_section > legend { float: left; } /* lets the gap apply below a legend */
.lead_form .lf_section > legend + * { clear: left; }
.lead_form .lf_note { margin: 0; font-size: 13px; color: var(--lf-sub); white-space: pre-line; }

.lead_form .lf_row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead_form .lf_row[hidden] { display: none; }
.lead_form .lf_label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.lead_form .lf_req,
.lead_form .lf_opt { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.5; }
.lead_form .lf_req { background: var(--lf-accent); color: #fff; }
.lead_form .lf_opt { background: #e8e8e8; color: #555; }
.lead_form .lf_hint { font-size: 12px; color: var(--lf-sub); white-space: pre-line; }
.lead_form .lf_center { margin: 0; text-align: center; }
.lead_form .lf_caution { margin: 0; padding: 12px 14px; border-left: 3px solid var(--lf-accent); border-radius: 4px; background: var(--lf-accent-soft); font-size: 14px; font-weight: 700; }
.lead_form .lf_terms { padding: 12px 14px; border: 1px solid var(--lf-line); border-radius: 8px; background: #fafafa; font-size: 13px; white-space: pre-line; }
.lead_form .lf_sub { padding-left: 14px; border-left: 3px solid #f3d3c2; }
.lead_form a { color: var(--lf-accent); text-decoration: underline; word-break: break-all; }

/* Inputs */
.lead_form input[type=text],
.lead_form input:not([type]),
.lead_form input[type=email],
.lead_form input[type=tel],
.lead_form input[type=number],
.lead_form input[type=date],
.lead_form select,
.lead_form textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--lf-line);
  border-radius: 8px;
  background: #fff;
  color: var(--lf-ink);
  font: inherit;
  font-size: 16px;
}
.lead_form textarea { min-height: 120px; line-height: 1.7; resize: vertical; }
.lead_form input:focus, .lead_form select:focus, .lead_form textarea:focus {
  outline: none; border-color: var(--lf-accent); box-shadow: 0 0 0 3px rgba(255, 76, 0, .15);
}
.lead_form ::placeholder { color: #aaa; }
.lead_form .lf_unit { display: flex; align-items: center; gap: 8px; }
.lead_form .lf_unit input { max-width: 160px; }
.lead_form .lf_address { display: grid; grid-template-columns: 1fr; gap: 12px; }
.lead_form .lf_address > .lf_label { grid-column: 1 / -1; }
@media (min-width: 768px) { .lead_form .lf_address { grid-template-columns: 1fr 1fr; } }
.lead_form .lf_part { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #444; }

/* Choices: full-width rows with a round (radio) or square (checkbox) mark. */
.lead_form .lf_choices { display: flex; flex-direction: column; gap: 8px; }
.lead_form .lf_choice { position: relative; display: block; cursor: pointer; }
.lead_form .lf_choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lead_form .lf_choice span {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--lf-line); border-radius: 8px; background: #fff; font-size: 15px; line-height: 1.5;
}
.lead_form .lf_choice span::before {
  content: ''; flex: none; width: 18px; height: 18px; margin-top: 2px;
  border: 2px solid #bbb; border-radius: 50%; background: #fff;
}
.lead_form .lf_choice input[type=checkbox] + span::before { border-radius: 4px; }
.lead_form .lf_choice input:checked + span { border-color: var(--lf-accent); background: var(--lf-accent-soft); }
.lead_form .lf_choice input:checked + span::before { border-color: var(--lf-accent); background: var(--lf-accent); box-shadow: inset 0 0 0 3px #fff; }
.lead_form .lf_choice input[type=checkbox]:checked + span::before { box-shadow: none; background: var(--lf-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center/12px no-repeat; }
.lead_form .lf_choice input:focus-visible + span { outline: 2px solid var(--lf-accent); outline-offset: 2px; }
@media (min-width: 768px) {
  /* Short answers (はい／いいえ, 1台…) sit side by side on a wide screen. */
  .lead_form .lf_choices.is-short { flex-direction: row; flex-wrap: wrap; }
  .lead_form .lf_choices.is-short .lf_choice { flex: 0 0 auto; }
}

/* Consent boxes */
.lead_form .lf_check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; }
.lead_form .lf_check input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--lf-accent); }

/* Errors */
.lead_form .is-invalid input,
.lead_form .is-invalid select,
.lead_form .is-invalid textarea,
.lead_form .is-invalid .lf_choice span { border-color: var(--lf-err); }
.lead_form .lf_field_error { color: var(--lf-err); font-size: 13px; font-weight: 700; }
.lead_form .lf_error { margin: 0; padding: 12px 14px; border-radius: 8px; background: #fdecea; color: var(--lf-err); font-weight: 700; }
.lead_form .lf_error[hidden] { display: none; }
.lead_form .lf_ts:empty { display: none; }

/* Send */
.lead_form .lf_submit {
  align-self: center; min-width: 280px; margin-top: 8px; padding: 16px 32px;
  border: 0; border-radius: 999px; background: var(--lf-accent); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
}
.lead_form .lf_submit:hover { filter: brightness(1.05); }
.lead_form .lf_submit:disabled { opacity: .6; cursor: default; }
@media (max-width: 767px) { .lead_form .lf_submit { width: 100%; min-width: 0; } }

/*
 * Chat-style input (public/common/js/chat-form.js, 2026-11-09): tabs over the form ("チャットで入力 / フォームで入力"),
 * then a chat that asks the form's items one at a time. In chat mode the form itself is folded away (.cf_off) except
 * its bot-check box, which must stay visible in case the check asks the visitor to tick it.
 */
.cf_wrap {
  --lf-accent: #ff4c00;
  --lf-accent-soft: #fff3ec;
  --lf-ink: #222;
  --lf-sub: #666;
  --lf-line: #d6d6d6;
  --lf-err: #c62828;
  max-width: 688px;
  margin: 0 auto;
  color: var(--lf-ink);
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
}
.cf_wrap * { box-sizing: border-box; letter-spacing: normal; }
.cf_wrap [hidden] { display: none !important; }
/* The switch between the plain form and the chat (2026-11-13, owner: 「ここがめちゃくちゃAIっぽさ出ちゃってる」 — the two
   cards with round icons and a line of description under each, chosen on 11/10 as 「説明つきのカード」). Now a plain
   segmented control like Apple's: a grey track, the chosen side white and raised, words only. */
.cf_tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; max-width: 440px; margin: 0 0 16px; padding: 3px; border-radius: 10px; background: #ececee; }
.cf_tab { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 8px; background: transparent; color: #555; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; text-align: center; cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; }
.cf_tab_ico, .cf_tab_sub { display: none; }
.cf_tab_lbl { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .cf_tab:not([aria-selected="true"]):hover { color: var(--lf-ink); } }
.cf_tab[aria-selected="true"] { background: #fff; color: var(--lf-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.06); }
/* The contact form (2026-11-12): one line above the form that opens the AI chat, in place of the two cards. */
.cf_guide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 16px; padding: 12px 14px 12px 16px; border: 1.5px solid #e4e4e4; border-radius: 14px; background: #fff; font-size: 14px; line-height: 1.6; }
.cf_guide_text { flex: 1 1 14em; color: var(--lf-ink, #222); }
.cf_guide_btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1.5px solid var(--lf-accent); border-radius: 999px; background: #fff; color: var(--lf-accent); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color .2s, color .2s; }
.cf_guide_btn::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12.5a7.5 7.5 0 0 1-11.2 6.5L4 20l1.1-4.3A7.5 7.5 0 1 1 20 12.5z'/%3E%3Cpath d='M9 12.5h.01M12.5 12.5h.01M16 12.5h.01' stroke-width='2.6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12.5a7.5 7.5 0 0 1-11.2 6.5L4 20l1.1-4.3A7.5 7.5 0 1 1 20 12.5z'/%3E%3Cpath d='M9 12.5h.01M12.5 12.5h.01M16 12.5h.01' stroke-width='2.6'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (hover: hover) and (pointer: fine) { .cf_guide_btn:hover { background: var(--lf-accent); color: #fff; } }
.cf_tab:focus-visible, .cf_chip:focus-visible, .cf_send:focus-visible, .cf_sendall:focus-visible, .cf_fix:focus-visible { outline: 2px solid var(--lf-accent); outline-offset: 2px; }
/* The chat window keeps its size; the conversation scrolls inside it (owner 2026-11-10). The input stays at the bottom. */
.cf_chat { display: flex; flex-direction: column; height: 620px; height: min(620px, calc(100svh - 120px)); min-height: 420px; padding: 24px 20px 16px; border-radius: 12px; background: #fff; }
@media (max-width: 767px) { .cf_chat { height: 560px; height: min(560px, calc(100svh - 96px)); min-height: 380px; padding: 18px 14px 12px; } }
.cf_log { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 2px 6px 8px 0; }
.cf_log > * { flex: none; }
.cf_sug, .cf_composer, .cf_err, .cf_foot { flex: none; }
.cf_msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 767px) { .cf_msg { max-width: 92%; } }
.cf_bot { align-self: flex-start; border-top-left-radius: 4px; background: #f3f3f3; }
.cf_bot a { color: var(--lf-accent); text-decoration: underline; }
.cf_me { align-self: flex-end; border-top-right-radius: 4px; background: var(--lf-accent); color: #fff; }
.cf_hint { align-self: flex-start; max-width: 86%; margin: -4px 0 0 4px; color: var(--lf-sub); font-size: 12px; white-space: pre-line; }
.cf_terms { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--lf-line); border-radius: 8px; background: #fff; font-size: 13px; white-space: pre-line; max-height: 240px; overflow: auto; }
.cf_divider { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; color: var(--lf-sub); font-size: 12px; font-weight: 700; }
.cf_divider::before, .cf_divider::after { content: ''; flex: 1; border-top: 1px solid var(--lf-line); }
.cf_typing { display: flex; gap: 4px; padding: 14px 16px; }
.cf_typing span { width: 6px; height: 6px; border-radius: 50%; background: #aaa; animation: cf_dot 1s infinite ease-in-out; }
.cf_typing span:nth-child(2) { animation-delay: .15s; }
.cf_typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cf_dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .cf_typing span { animation: none; } }
.cf_chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cf_sug { margin-top: 10px; max-height: 220px; overflow: auto; }
.cf_chip { min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--lf-accent); border-radius: 22px; background: #fff; color: var(--lf-accent); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.4; text-align: left; cursor: pointer; }
.cf_chip:hover { background: var(--lf-accent-soft); }
.cf_chip.is-on, .cf_chip.is-main { background: var(--lf-accent); color: #fff; }
.cf_chip.is-quiet { border-color: var(--lf-line); color: var(--lf-sub); }
.cf_composer { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; }
.cf_input { flex: 1; min-width: 0; min-height: 48px; padding: 11px 14px; border: 1px solid var(--lf-line); border-radius: 10px; background: #fff; color: var(--lf-ink); font: inherit; font-size: 16px; }
.cf_area { min-height: 96px; resize: vertical; }
.cf_input:focus { border-color: var(--lf-accent); outline: none; box-shadow: 0 0 0 3px var(--lf-accent-soft); }
.cf_send { min-height: 48px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--lf-accent); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.cf_err { margin: 6px 0 0; color: var(--lf-err); font-size: 13px; font-weight: 700; }
.cf_review { display: flex; flex-direction: column; border: 1px solid var(--lf-line); border-radius: 12px; overflow: hidden; }
.cf_rrow { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-top: 1px solid #eee; font-size: 14px; }
.cf_rrow:first-child { border-top: 0; }
.cf_rlabel { color: var(--lf-sub); font-size: 13px; }
.cf_rval { overflow-wrap: anywhere; white-space: pre-line; }
.cf_fix { min-height: 36px; padding: 4px 12px; border: 1px solid var(--lf-line); border-radius: 18px; background: #fff; color: var(--lf-ink); font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 767px) {
  .cf_rrow { grid-template-columns: minmax(0, 1fr) auto; }
  .cf_rlabel { grid-column: 1 / -1; }
}
.cf_sendbox { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cf_policy { margin: 0; color: var(--lf-sub); font-size: 13px; text-align: center; }
.cf_policy a { color: var(--lf-accent); text-decoration: underline; }
.cf_sendall { min-height: 54px; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--lf-accent); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.cf_sendall:disabled { opacity: .6; cursor: default; }
.cf_foot { margin-top: 14px; text-align: right; }
.cf_restart { padding: 6px 4px; border: 0; background: none; color: var(--lf-sub); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.lead_form.cf_off { padding: 0; background: none; gap: 0; }
.lead_form.cf_off > :not(.lf_ts) { display: none !important; }
.lead_form.cf_off > .lf_ts { margin-top: 12px; }
/* On the /lp/ pages the chat sits in the page's white form box: keep the tabs off its top edge. */
.lp-lead-form .cf_wrap { padding-top: 32px; }
@media (max-width: 767px) { .lp-lead-form .cf_wrap { padding-top: 20px; } }

/* iPhone Safari draws a date box with its own minimum width and centred text, so it ran past the right edge of the form
   (2026-11-13, owner: 「微妙にフォームズレてる」). */
.lead_form input[type=date], .cf_wrap input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
.lead_form input[type=date]::-webkit-date-and-time-value, .cf_wrap input[type=date]::-webkit-date-and-time-value { margin: 0; text-align: left; }
/* The note when an earlier date was moved to the first one allowed. */
.lf_field_note { display: block; margin-top: 6px; color: var(--lf-accent); font-size: 13px; line-height: 1.6; }
