/* ── Auth page layout (login + register 共通) ── */

/* ── Layout ── */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

/*
 * Centered single-column layout（B-Z11 / UI 改善で /login と /register に適用）
 * 既存の 2-column レイアウト (.auth-page / .auth-visual / .auth-form-side) は
 * forgot_password.html などが使うため残す。新規 UI はこちらを使う。
 */
.auth-page-centered {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px calc(48px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.auth-card .auth-form-eyebrow { margin-bottom: 10px; }
.auth-card .auth-form-title    { margin-bottom: 6px; }
.auth-card .auth-form-subtitle { margin-bottom: 28px; }

/* β 期間中バナー（login の眉とサブの間に挟む） */
.auth-card .auth-form-beta {
  margin: -6px 0 22px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* フィールドのヒント文（複数行に対応） */
.auth-card .auth-field-hint {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--fg-muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* カード末尾の戻る導線 */
.auth-card .auth-card-foot {
  margin-top: 22px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.auth-card .auth-card-foot a { color: inherit; }
.auth-card .auth-card-foot a:hover { color: var(--fg); }

/* iOS Safari / Chrome の autofill で input 背景が水色になるのを防ぐ */
.auth-card .auth-field-input:-webkit-autofill,
.auth-card .auth-field-input:-webkit-autofill:hover,
.auth-card .auth-field-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  transition: background-color 9999s ease-in-out 0s;
}

@media (max-width: 480px) {
  .auth-page-centered { padding: 32px 16px; }
  .auth-card          { padding: 32px 22px 26px; max-width: 100%; }
}

/* ── Left visual ── */
.auth-visual {
  flex: 1;
  background: var(--crevasse);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 60px;
}
.auth-visual-bg {
  position: absolute;
  inset: 0;
}
.auth-visual-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}
.auth-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,58,66,0.85) 0%, rgba(44,58,66,0.3) 60%, transparent 100%);
}
.auth-visual-content {
  position: relative;
  z-index: 1;
  color: white;
}
.auth-visual-logo {
  font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
  display: block;
  color: white;
  text-decoration: none;
}
.auth-visual-tagline {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 14px;
}
.auth-visual-sub {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

/* ── Right form ── */
.auth-form-side {
  width: 480px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 60px;
  background: var(--bg);
  position: relative;
}
.auth-back {
  position: absolute;
  top: 24px;
  left: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 300ms var(--ease-snow);
}
.auth-back:hover { color: var(--fg); }

.auth-form-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.auth-form-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.2;
}
.auth-form-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--fg-muted);
  margin-bottom: 40px;
}
.auth-form-subtitle a { color: var(--neve); }
.auth-form-subtitle a:hover { text-decoration: underline; }

/* ── Fields ── */
.auth-field { margin-bottom: 20px; }
.auth-field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.auth-field-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px; /* C-8: iOS Safari 自動 zoom-in 回避のため input/textarea は 16px 以上 */
  font-weight: 300;
  color: var(--fg);
  outline: none;
  transition: border-color var(--dur-base) var(--ease-snow);
}
.auth-field-input:focus { border-color: var(--neve); }
.auth-field-input::placeholder { color: var(--fg-muted); }

/* ── Error / Success ── */
.auth-error {
  display: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fn-danger);
  margin-bottom: 20px;
  padding: 10px 14px;
  background: rgba(140,56,40,0.08);
  border-radius: var(--radius);
  line-height: 1.5;
}
.auth-error.visible { display: block; }

.auth-success {
  display: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fn-safe);
  margin-bottom: 20px;
  padding: 10px 14px;
  background: rgba(94,122,100,0.10);
  border-radius: var(--radius);
  line-height: 1.65;
}
.auth-success.visible { display: block; }

/* ── Submit ── */
.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity var(--dur-base) var(--ease-snow);
  margin-top: 8px;
}
.auth-submit:hover { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Footer ── */
.auth-foot {
  margin-top: 28px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg-muted);
}
.auth-foot a { color: var(--neve); }
.auth-foot a:hover { text-decoration: underline; }

.auth-terms {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--fg-muted);
  margin-top: 16px;
  line-height: 1.6;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .auth-visual { display: none; }
  .auth-form-side {
    width: 100%;
    min-width: 0;
    padding: 48px 28px;
  }
}
@media (max-width: 400px) {
  .auth-form-side { padding: 40px 20px; }
}

/* 同意チェックボックス (Phase 1-agreement) */
.auth-field-checkbox {
  margin-bottom: 20px;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--fg-muted);
}

.auth-checkbox {
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox-text a {
  color: var(--fg);
  text-decoration: underline;
}

.auth-checkbox-text a:hover {
  opacity: 0.7;
}
