/* musu-form-valid — V4 共通フォームバリデーション */

.musu-valid-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1080;
  margin: 10px;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border-radius: 4px;
  background: #fff3cd;
  border: 1px solid #e8c87a;
  color: #1c1a17;
  box-shadow: 0 4px 16px rgba(28, 26, 23, 0.12);
  font-size: 0.95rem;
  line-height: 1.5;
}

.musu-valid-banner[hidden] {
  display: none !important;
}

.musu-valid-banner__close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #4a4440;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

/* 吹き出しの基準（input-group / 単項目ラップ） */
.musu-field-anchor {
  position: relative;
}

.musu-field-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* エラー項目：赤枠 + 桃色背景 */
.musu-field-invalid,
.musu-field-anchor.musu-field-anchor--error .form-control,
.musu-field-anchor.musu-field-anchor--error .form-select {
  border-color: #9b2e26 !important;
  background-color: #fbe7e2 !important;
}

.musu-field-valid {
  border-color: #3a6e4e !important;
}

/* 吹き出し型エラーメッセージ（フォーカス時のみ表示） */
.musu-field-msg {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 1090;
  min-width: 10rem;
  max-width: min(320px, 92vw);
  padding: 0.55rem 0.85rem;
  background: #9b2e26;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(43, 39, 35, 0.28);
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}

/* 上向き矢印（左寄せ・添付イメージ相当） */
.musu-field-msg::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent #9b2e26 transparent;
}

.musu-field-msg.musu-field-msg--show {
  display: block;
}

/* input-group 内：吹き出しはグループ全体の下に配置 */
.input-group.musu-field-anchor > .musu-field-msg {
  left: 0;
  right: auto;
}
