/* ==========================================================================
   SMS認証テスト（Phase A）追加分のスタイル
   既存の色・フォント（#333 / #F66404 / rgba(255,179,34,.3) / .conversion-form__submit-button）を踏襲する。
   ========================================================================== */

/* ---- 常時表示のテスト識別バナー ---- */
.sms-test-banner {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  padding: 8px 12px;
  background: #222;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.sms-test-banner__tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #ffd700;
  color: #222;
  font-weight: bold;
  letter-spacing: .05em;
}
/* PC・タブレットでは固定ヘッダーをバナー分だけ下げる（768px 以下は static のため不要） */
@media (min-width: 769px) {
  .sms-test-mode .header { top: 64px; }
}

/* ---- 連絡先フォームへの追記 ---- */
.sms-auth__tel-note {
  margin-top: 10px;
  color: #333;
  font-size: 13px;
  line-height: 1.6;
}
.sms-auth__tel-note--direct { color: #1a6b3a; }
@media (max-width: 768px) {
  .sms-auth__tel-note { margin-top: 14px; }
  .conversion-form-cassette:has(input.is-error) + .sms-auth__tel-note { margin-top: 26px; }
}

/* コード入力中は元の入力欄を隠す（値は保持される） */
#subjects.sms-auth--hide-form .conversion-form__inner { display: none; }

/* ---- 認証パネル本体 ---- */
.sms-auth { margin-inline: auto; max-width: 476px; padding: 0 12px; color: #333; }
.sms-auth:empty { display: none; }
.sms-auth__card {
  background: rgba(255, 179, 34, 0.3);
  border-radius: 10px;
  padding: 22px 18px 20px;
}
.sms-auth__card--complete { background: #fff; border: 3px solid #8fc31f; }
.sms-auth__lead { font-size: 20px; font-weight: bold; line-height: 1.4; margin-bottom: 10px; }
.sms-auth__desc { font-size: 15px; line-height: 1.7; margin-bottom: 12px; }
.sms-auth__phone { font-weight: bold; white-space: nowrap; }
.sms-auth__mock {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 2px dashed #F66404;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}
.sms-auth__mock strong { font-size: 20px; letter-spacing: .15em; }
.sms-auth__field { margin-bottom: 16px; }
.sms-auth__label { display: block; font-size: 16px; font-weight: bold; margin-bottom: 6px; }
.sms-auth__input {
  width: 100%;
  min-height: 48px;
  border: 2px solid #F66404;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 3px #ccc inset;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: .2em;
  padding: 9px 0.7em;
  box-sizing: border-box;
}
.sms-auth__input[aria-invalid="true"] { border-color: #d44343; }
.sms-auth__input:disabled { background: #f3f3f3; color: #777; }
.sms-auth__help-text { margin-top: 6px; font-size: 13px; color: #555; }
.sms-auth__error {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 4px solid #d44343;
  background: #fff;
  color: #d44343;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.5;
}
.sms-auth__error[hidden] { display: none; }
.sms-auth__notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 4px solid #F66404;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}
.sms-auth__progress { padding: 14px 0; text-align: center; font-size: 15px; font-weight: bold; }
.sms-auth__verify { display: block; margin-top: 4px; min-height: 52px; }
.sms-auth__verify:disabled { background: #eee; border-color: #bfbfbf; box-shadow: none; color: #777; text-shadow: none; }
.sms-auth__timers { margin-top: 14px; font-size: 14px; line-height: 1.8; text-align: center; }
.sms-auth__num { font-weight: bold; font-variant-numeric: tabular-nums; }
.sms-auth__muted { color: #666; font-size: 13px; }
.sms-auth__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 10px; }
.sms-auth__link {
  appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 10px 2px;
  min-height: 44px;
  color: #333; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.sms-auth__link:disabled { color: #999; text-decoration: none; cursor: default; }
.sms-auth__help { margin-top: 8px; padding: 10px 12px; background: #fff; border-radius: 6px; font-size: 13px; line-height: 1.7; }
.sms-auth__help p { margin: 0 0 4px; }
.sms-auth__testid { margin: 10px 0; font-size: 15px; }
.sms-auth__testid span { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 4px; background: #333; color: #fff; font-weight: bold; letter-spacing: .08em; }

@media (max-width: 768px) {
  .sms-auth { padding: 0 12px; }
  .sms-auth__lead { font-size: 19px; }
  .sms-auth__input { font-size: 20px; }
}
@media (max-width: 360px) {
  .sms-auth__card { padding: 18px 12px 16px; }
  .sms-auth__mock strong { font-size: 18px; }
}

/* ---- テスト操作パネル（Phase A 専用） ---- */
.sms-debug { position: fixed; right: 12px; bottom: 12px; z-index: 10001; font-family: inherit; }
.sms-debug__toggle {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; padding: 8px 14px;
  border: 2px solid #ffd700; border-radius: 22px;
  background: #222; color: #fff; font-size: 14px; font-weight: bold; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.sms-debug__body {
  position: absolute; right: 0; bottom: 52px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 12px;
  border: 2px solid #ffd700; border-radius: 10px;
  background: #fff; color: #222;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
  text-align: left;
}
.sms-debug__body[hidden] { display: none; }
.sms-debug__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sms-debug__close { appearance: none; -webkit-appearance: none; border: 0; background: none; font-size: 22px; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; }
.sms-debug__status { margin: 0 0 10px; padding: 8px; background: #f6f6f6; border-radius: 6px; font-size: 12px; }
.sms-debug__status div { display: flex; gap: 8px; }
.sms-debug__status dt { flex: 0 0 46%; color: #555; }
.sms-debug__status dd { margin: 0; word-break: break-all; font-variant-numeric: tabular-nums; }
.sms-debug__group { margin-bottom: 10px; }
.sms-debug__title { margin: 0 0 4px; font-weight: bold; }
.sms-debug__group button {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; margin: 4px 0; min-height: 40px; padding: 6px 10px;
  border: 1px solid #999; border-radius: 6px; background: #fff; color: #222; font-size: 13px; text-align: left; cursor: pointer;
}
.sms-debug__group button:hover { background: #fff6d5; }
.sms-debug__log { margin: 0; padding-left: 18px; font-size: 12px; max-height: 160px; overflow: auto; }
.sms-debug__log span { color: #777; margin-right: 4px; }
.sms-debug__log small { color: #555; }
.sms-debug__muted { color: #777; list-style: none; }
.sms-debug__note { margin: 8px 0 0; padding: 6px 8px; background: #fff6d5; border-radius: 6px; min-height: 1.5em; }

/* ==========================================================================
   リッチ版（進行ステップ・吹き出し・送信先チップ・期限バー・完了演出）
   ========================================================================== */
.sms-auth__card--rich {
  position: relative;
  background: #fff;
  border: 3px solid #f7bf79;
  border-radius: 14px;
  padding: 20px 20px 22px;
  box-shadow: 0 6px 20px rgba(246, 100, 4, .12);
  animation: sms-auth-rise .35s ease-out both;
}
@keyframes sms-auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 進行ステップ */
.sms-auth__steps {
  display: flex; justify-content: center; align-items: flex-start; gap: 0;
  margin: 0 0 18px; padding: 0; list-style: none; counter-reset: none;
}
.sms-auth__steps li { position: relative; flex: 1 1 0; max-width: 120px; text-align: center; color: #999; font-size: 12px; }
.sms-auth__steps li + li::before {
  content: ""; position: absolute; left: -50%; right: 50%; top: 14px; height: 3px; background: #eadfc6; z-index: 0;
}
.sms-auth__steps li.is-done + li::before { background: #f7bf79; }
.sms-auth__step-num {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; border: 3px solid #eadfc6; color: #999; font-weight: bold; font-size: 14px;
}
.sms-auth__steps li.is-done .sms-auth__step-num { background: #8fc31f; border-color: #8fc31f; color: #fff; }
.sms-auth__steps li.is-current .sms-auth__step-num { background: #F66404; border-color: #F66404; color: #fff; box-shadow: 0 0 0 4px rgba(246, 100, 4, .18); }
.sms-auth__steps li.is-current { color: #F66404; font-weight: bold; }
.sms-auth__steps li.is-done { color: #6a9a10; }
.sms-auth__step-label { display: block; margin-top: 4px; }

/* アドバイザーの吹き出し（チャットと同じ雰囲気） */
.sms-auth__intro { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sms-auth__avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; border: 2px solid #F29900; background: #fff; object-fit: cover; }
.sms-auth__bubble {
  position: relative; flex: 1 1 auto; min-width: 0;
  background: #fff; border: 2px solid #F29900; border-radius: 14px; padding: 12px 14px;
}
.sms-auth__bubble::before, .sms-auth__bubble::after {
  content: ""; position: absolute; left: -12px; top: 18px; border: 6px solid transparent; border-right-color: #F29900; border-left: 0;
}
.sms-auth__bubble::after { left: -9px; border-right-color: #fff; }
.sms-auth__card--rich .sms-auth__lead { font-size: 18px; margin-bottom: 4px; }
.sms-auth__card--rich .sms-auth__desc { font-size: 14px; margin-bottom: 0; }
.sms-auth__desc--center { text-align: center; }

/* 送信先チップ */
.sms-auth__chip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
  margin: 0 0 14px; padding: 8px 12px;
  background: rgba(255, 179, 34, 0.22); border-radius: 100vmax; font-size: 13px; color: #333;
}
.sms-auth__chip .sms-auth__icon { color: #F66404; }
.sms-auth__chip .sms-auth__phone { font-size: 16px; }
.sms-auth__chip-sub { color: #555; }

/* テスト用コードのチケット */
.sms-auth__card--rich .sms-auth__mock {
  position: relative; display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px; padding: 12px 14px 12px 14px;
  border: 2px dashed #F66404; border-radius: 10px; background: #fff8ec; font-size: 13px; line-height: 1.6;
}
.sms-auth__mock p { margin: 0; }
.sms-auth__mock-tag { flex: 0 0 auto; padding: 3px 8px; border-radius: 4px; background: #F66404; color: #fff; font-size: 11px; font-weight: bold; letter-spacing: .05em; }
.sms-auth__card--rich .sms-auth__mock strong { font-size: 22px; letter-spacing: .18em; color: #d1480b; font-variant-numeric: tabular-nums; }

/* 入力欄 */
.sms-auth__card--rich .sms-auth__label { text-align: center; }
.sms-auth__input-wrap { position: relative; }
.sms-auth__input-wrap > .sms-auth__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #F66404; pointer-events: none; }
.sms-auth__card--rich .sms-auth__input {
  min-height: 56px; padding: 9px 12px 9px 44px;
  font-size: 26px; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums;
  border-radius: 8px;
  transition: box-shadow .15s, border-color .15s;
}
.sms-auth__card--rich .sms-auth__input::placeholder { color: #d9d2c0; letter-spacing: .32em; }
.sms-auth__card--rich .sms-auth__input:focus { outline: none; border-color: #F66404; box-shadow: 0 0 0 4px rgba(246, 100, 4, .18), 0 1px 3px #ccc inset; }
.sms-auth__input-wrap.is-shake { animation: sms-auth-shake .4s ease-in-out; }
@keyframes sms-auth-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sms-auth__card--rich .sms-auth__help-text { text-align: center; }

/* 認証ボタン */
.sms-auth__card--rich .sms-auth__verify { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .1s, filter .15s; }
.sms-auth__card--rich .sms-auth__verify:not(:disabled):hover { filter: brightness(1.05); }
.sms-auth__card--rich .sms-auth__verify:not(:disabled):active { transform: translateY(1px); }
.sms-auth__spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: sms-auth-spin .8s linear infinite;
}
.sms-auth__spinner--dark { border-color: rgba(246, 100, 4, .25); border-top-color: #F66404; vertical-align: -3px; margin-right: 8px; }
@keyframes sms-auth-spin { to { transform: rotate(360deg); } }
.sms-auth__verify:disabled .sms-auth__spinner { border-color: rgba(120, 120, 120, .3); border-top-color: #777; }

/* 期限バー・再送 */
.sms-auth__card--rich .sms-auth__timers { margin-top: 16px; text-align: left; }
.sms-auth__expiry { margin-bottom: 10px; }
.sms-auth__expiry-head { display: flex; justify-content: space-between; font-size: 13px; color: #555; margin-bottom: 4px; }
.sms-auth__expiry-head .sms-auth__num { color: #333; font-size: 15px; }
.sms-auth__bar { height: 8px; border-radius: 100vmax; background: #f1ebdc; overflow: hidden; }
.sms-auth__bar-fill { height: 100%; width: 100%; border-radius: 100vmax; background: linear-gradient(90deg, #ffb322, #F66404); transition: width 1s linear; }
.sms-auth__bar-fill.is-low { background: #d44343; }
.sms-auth__resend-row { text-align: center; margin: 6px 0 4px; }
.sms-auth__card--rich .sms-auth__muted { text-align: center; }
.sms-auth__link--pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 2px solid #F66404; border-radius: 100vmax; background: #fff; color: #F66404; text-decoration: none; font-weight: bold;
}
.sms-auth__link--pill:hover { background: #fff3e6; }
.sms-auth__pill-sub { font-size: 11px; font-weight: normal; color: #777; }
.sms-auth__card--rich .sms-auth__links { margin-top: 12px; gap: 4px 16px; }
.sms-auth__card--rich .sms-auth__link { display: inline-flex; align-items: center; gap: 4px; color: #555; }
.sms-auth__card--rich .sms-auth__link .sms-auth__icon { color: #999; }
.sms-auth__card--rich .sms-auth__help { background: #fff8ec; }

/* 完了画面 */
.sms-auth__card--rich.sms-auth__card--complete { border-color: #8fc31f; box-shadow: 0 6px 20px rgba(143, 195, 31, .18); }
.sms-auth__complete-hero { text-align: center; margin-bottom: 8px; }
.sms-auth__check { display: block; margin: 4px auto 10px; }
.sms-auth__check-circle { stroke: #8fc31f; stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: sms-auth-draw .6s ease-out forwards; }
.sms-auth__check-mark { stroke: #8fc31f; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: sms-auth-draw .4s ease-out .5s forwards; }
@keyframes sms-auth-draw { to { stroke-dashoffset: 0; } }
.sms-auth__card--complete .sms-auth__lead { font-size: 21px; color: #4f7a06; margin-bottom: 0; }
.sms-auth__caution { margin: 10px 0 14px; padding: 10px 12px; border-radius: 8px; background: #fff3e6; border-left: 4px solid #F66404; font-size: 14px; line-height: 1.6; }
.sms-auth__ticket {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin: 0 auto 10px; padding: 12px 16px; max-width: 320px;
  border: 2px dashed #bfbfbf; border-radius: 10px; background: #fafafa;
}
.sms-auth__ticket-label { font-size: 12px; color: #777; letter-spacing: .1em; }
.sms-auth__ticket .sms-auth__testid { margin: 0; }
.sms-auth__ticket .sms-auth__testid span { margin: 0; font-size: 20px; padding: 4px 14px; }
.sms-auth__ticket-note { font-size: 11px; color: #999; }

@media (prefers-reduced-motion: reduce) {
  .sms-auth__card--rich, .sms-auth__input-wrap.is-shake, .sms-auth__spinner, .sms-auth__check-circle, .sms-auth__check-mark { animation: none; }
  .sms-auth__check-circle, .sms-auth__check-mark { stroke-dashoffset: 0; }
}
@media (max-width: 768px) {
  .sms-auth__card--rich { padding: 18px 14px 20px; }
  .sms-auth__card--rich .sms-auth__input { font-size: 24px; letter-spacing: .26em; }
}
@media (max-width: 360px) {
  .sms-auth__avatar { display: none; }
  .sms-auth__bubble::before, .sms-auth__bubble::after { display: none; }
  .sms-auth__card--rich .sms-auth__input { font-size: 22px; letter-spacing: .2em; padding-left: 40px; }
  .sms-auth__card--rich .sms-auth__mock strong { font-size: 20px; }
}

/* style.css の :where(svg){max-inline-size:100%; block-size:auto} に負けないよう、アイコンの寸法を明示 */
.sms-auth .sms-auth__icon { width: 18px; height: 18px; inline-size: 18px; block-size: 18px; flex: 0 0 auto; }
.sms-auth .sms-auth__input-wrap > .sms-auth__icon { width: 20px; height: 20px; inline-size: 20px; block-size: 20px; }
.sms-auth .sms-auth__link .sms-auth__icon, .sms-auth .sms-auth__link--pill .sms-auth__icon { width: 16px; height: 16px; inline-size: 16px; block-size: 16px; }
.sms-auth .sms-auth__check { width: 72px; height: 72px; inline-size: 72px; block-size: 72px; }
.sms-auth .sms-auth__avatar { inline-size: 56px; block-size: 56px; }

/* コード入力中（キーボード表示中）はテスト操作ボタンが入力欄に重ならないよう退避する */
body:has(#sms-auth-code:focus) .sms-debug__toggle { opacity: .35; transform: scale(.8); transform-origin: bottom right; pointer-events: none; }
.sms-debug__toggle { transition: opacity .2s, transform .2s; }
@media (max-width: 768px) {
  .sms-auth__card--rich .sms-auth__links { flex-direction: column; align-items: center; gap: 0; }
}
