/* ===========================================================================
   contact.css — お問い合わせフォーム専用スタイル
   brand.css + corp.css の上に重ねて読み込む
   =========================================================================== */

:root {
  --error: #D32F2F;
}

/* ===== Form Card ===== */
.form-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 22px; }
.field-label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  margin-bottom: 8px;
}
.required {
  color: var(--error);
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
}
.optional {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 4px;
  font-weight: 400;
}
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 149, 217, 0.18);
}
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid:not(:focus) {
  border-color: var(--error);
}
textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.7;
}
.field-help {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 6px;
}

/* select の右側カスタム矢印 */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2314296B' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
  cursor: pointer;
}

/* ===== Consent ===== */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-body);
  margin: 8px 0 24px;
  line-height: 1.7;
}
.consent input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}
.consent a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}
.consent a:hover { text-decoration: underline; }

/* ===== Submit Button ===== */
/* btn-submit は brand.css の .btn-primary 系統に統合。
   フォーム文脈用に幅と上余白だけ調整する */
.btn-submit {
  display: block;
  width: 100%;
}
.submit-note {
  font-size: 12px;
  color: var(--text-gray);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ===== Fallback (mailto 起動失敗時の手動コピー UI) ===== */
.mailto-fallback {
  display: none;
  margin-top: 24px;
  padding: 20px 22px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-body);
}
.mailto-fallback strong {
  color: var(--navy);
  display: block;
  margin-bottom: 8px;
}
.mailto-fallback pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "Menlo", monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow-y: auto;
}
.mailto-fallback .copy-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background .2s;
}
.mailto-fallback .copy-btn:hover { background: var(--navy-darker); }
.mailto-fallback .copy-btn[data-copied="1"] { background: var(--brand-green-dark); }

/* ===== Direct contact note ===== */
.note-direct {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 18px 22px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-gray);
  line-height: 1.85;
}
.note-direct strong { color: var(--navy); }
.note-direct a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}
.note-direct a:hover { text-decoration: underline; }

/* ===== Confirmation state ===== */
.confirmation {
  display: none;
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}
.confirmation .icon {
  font-size: 56px;
  margin-bottom: 20px;
}
.confirmation .icon svg { stroke: var(--brand-green-dark); }
.confirmation h2 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 16px;
}
.confirmation p {
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 28px;
  line-height: 1.85;
}
.confirmation a {
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
}
.confirmation .back-to-top {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
.confirmation .back-to-top:hover {
  background: var(--navy-darker);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .form-card { padding: 24px 20px; }
  .confirmation { padding: 40px 20px; }
}
