/* =====================================================================
   キャメル / Camel — camel_v2_auth.css
   認証画面 (login / signup / forgot_password / reset_password) リファイン
   ---------------------------------------------------------------------
   - 色はすべて camel_tokens.css の --c-* を参照 (インライン色直書き禁止)。
   - camel_tokens.css の後・sprint32_saas.css の後に読み込み、.auth-* を上書き。
   - 既存 DOM / .auth-* クラス名 / {{error_msg}} 差込口は維持 (テスト保護)。
   - 外部サブリソース (CDN / 外部画像 / Webフォント) は一切読み込まない
     (Basic 認証ダイアログ誘発の回避)。アイコンはインライン SVG のみ。
   - 60-30-10: 60% 砂ベージュ背景 / 30% 白カード / 10% ネイビー (CTA・リンク)。

   変更指示書 (login_changes.md) 5 点:
     1) 背景: グラデ撤去 → 砂ベージュ単色 + 上下端の地層ヘアライン
     2) カード上辺に深ネイビー 3px のアクセント 1 本 (装飾はこれだけ)
     3) CTA を唯一の有色ボタンに (full 幅 / 48px / navy)
     4) フォーカス/エラーのフィードバック整理
     5) {{error_msg}} / 注記 / リンク階層の質向上
   ===================================================================== */

/* ---------------------------------------------------------------------
   1) 背景: 砂ベージュ単色 + 上下端のみ地層ヘアライン (極小モチーフ)
   旧 sprint32_saas.css の linear-gradient(180deg, …) を打ち消す。
   --------------------------------------------------------------------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--c-sand);
  /* 上下端だけにシルト灰の地層ヘアライン (ごく低コントラスト)。
     メッシュ / オーロラ / 放射状 / ブロブは不使用 (AIスロップ回避)。 */
  background-image:
    repeating-linear-gradient(180deg, rgba(122, 140, 158, 0.08) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(180deg, rgba(122, 140, 158, 0.07) 0 1px, transparent 1px 13px);
  background-repeat: no-repeat, no-repeat;
  background-position: top center, bottom center;
  background-size: 100% 78px, 100% 78px;
  font-family: var(--font-sans);
  color: var(--c-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  margin: auto;
  width: 100%;
  max-width: 440px;
  padding: 0;
}

/* ---------------------------------------------------------------------
   ブランド (ロゴ + タグライン)
   --------------------------------------------------------------------- */
.auth-brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-logo {
  height: 40px;
  width: auto;
  display: inline-block;
}

.auth-tagline {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--c-text-sub);
  letter-spacing: 0.01em;
}

.auth-tagline strong {
  color: var(--c-navy);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   2) カード: 白・上辺に深ネイビー 3px のアクセント 1 本のみ (restraint)
   影は控えめ多層 (y > x)。装飾はこの 1 本だけ。
   --------------------------------------------------------------------- */
.auth-card {
  position: relative;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 32px 28px;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c-navy);
}

.auth-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--c-text);
}

.auth-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  text-align: center;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* title 直後に error / form が来る場合の間隔調整 (subtitle が無い画面用) */
.auth-title + .auth-error,
.auth-title + .auth-form {
  margin-top: 12px;
}

/* ---------------------------------------------------------------------
   5) {{error_msg}} 差込口
   地 #FEE2E2 (--c-error-bg) / 文字 #DC2626 (--c-error) / 左赤バー 3px。
   バックエンドは <div class="auth-error">…</div> を差し込む。
   icon 有無どちらでも崩れないよう、テキスト単体でも成立する設計。
   --------------------------------------------------------------------- */
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--c-error-bg);
  color: var(--c-error);
  border: none;
  border-left: 3px solid var(--c-error);
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 500;
}

/* 警告アイコン (差し込まれた場合のみ): 深ネイビー単色・絵文字禁止 */
.auth-error svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: var(--c-navy);
}

/* ---------------------------------------------------------------------
   フォーム
   --------------------------------------------------------------------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-sub);
}

/* 4) 入力: 高さ 48px / フォント 16px (iOS ズーム防止) / 罫線強 */
.auth-field input,
.auth-field select {
  height: 48px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  background: var(--c-white);
  font-family: inherit;
  font-size: 16px;
  color: var(--c-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field select {
  padding: 0 12px;
}

.auth-field input::placeholder {
  color: var(--c-silt);
}

/* 4) focus: border accent + 3px 薄ネイビーリング */
.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--c-navy);
  box-shadow: var(--ring-focus);
}

/* 4) エラー時 input 赤ボーダー (CSS 定義のみ・JS 追加なし) */
.auth-field.has-error input,
.auth-field.has-error select {
  border-color: var(--c-error);
}

.auth-field.has-error input:focus,
.auth-field.has-error select:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* ---------------------------------------------------------------------
   3) CTA: 色を持つボタンはこれ 1 つだけ (Von Restorff / Fitts)
   full 幅 / min-height 48px / 深ネイビー塗り / hover navy-hover / press +1px
   --------------------------------------------------------------------- */
.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: none;
  border-radius: var(--r-md);
  background: var(--c-navy);
  color: var(--c-text-on-navy);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover {
  background: var(--c-navy-hover);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

/* ---------------------------------------------------------------------
   5) リンク階層 (Serial Position)
   主 = 「招待コードで登録」をやや前面 / 副 = 「パスワードを忘れた」を控えめ。
   --------------------------------------------------------------------- */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
}

.auth-links a {
  text-decoration: none;
  color: var(--c-navy);
}

.auth-links a:hover {
  color: var(--c-navy-hover);
  text-decoration: underline;
}

.auth-links .auth-link--forgot {
  color: var(--c-text-muted);
  font-weight: 500;
}

.auth-links .auth-link--forgot:hover {
  color: var(--c-text-sub);
}

.auth-links .auth-link--signup {
  font-weight: 700;
}

.auth-sep {
  display: inline-block;
  margin: 0;
  color: var(--c-border-strong);
}

/* ---------------------------------------------------------------------
   5) 注記 (BASIC 併用案内): 薄黄地 + info SVG の情報ブロック化
   旧 sprint32_saas.css の border-top 区切りを打ち消し、独立ブロックに。
   --------------------------------------------------------------------- */
.auth-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 20px;
  padding: 12px 13px;
  border-top: none;
  background: var(--c-cream);
  border-radius: var(--r-md);
  font-size: 12px;
  line-height: 1.6;
  color: var(--c-text-sub);
}

.auth-footnote svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: var(--c-navy);
}

.auth-footnote p {
  margin: 0;
}

.auth-copy {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-muted);
}

/* ---------------------------------------------------------------------
   レスポンシブ
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
  .auth-card {
    padding: 26px 22px 24px;
  }
}

/* ---------------------------------------------------------------------
   モーション設定の尊重 (transition は transform / color のみ)
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .auth-field input,
  .auth-field select,
  .auth-submit {
    transition: none;
  }
}
