/* ============================================================================
 * auth.css — login / signup / reset page layout (Stage 1)
 * Mirrors iOS Features/Account/{EmailLoginView,SignUpView,SSOAuthButtons}.
 * Uses mp-design.css tokens only — no hardcoded colors.
 * ========================================================================== */

.auth-screen {
  min-height: 100dvh;
  background: var(--mp-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--mp-space-lg) var(--mp-space-base) var(--mp-space-xxl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  margin-top: var(--mp-space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--mp-space-lg);
}

.auth-brand {
  text-align: center;
  margin-bottom: var(--mp-space-sm);
}
.auth-brand .mark {
  /* LP / legal のワードマークと統一: generic 明朝 (--mp-font-display) ではなく Marcellus。
     Marcellus は単一ウェイトのため font-weight:700 は faux-bold 化する → 400 で揃える。 */
  font-family: 'Marcellus', 'Playfair Display', 'Noto Serif JP', serif;
  font-size: var(--mp-fs-display);
  font-weight: 400;
  color: var(--mp-primary);
  letter-spacing: .14em;
}
.auth-brand .eyebrow {
  font-family: var(--mp-font-eyebrow);
  font-size: var(--mp-fs-eyebrow);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mp-text-soft);
}

.auth-head { display: flex; flex-direction: column; gap: var(--mp-space-xs); }
.auth-head h1 {
  font-family: var(--mp-font-display);
  font-size: var(--mp-fs-title-lg);
  font-weight: 500;
  color: var(--mp-text);
}
.auth-head p { margin: 0; font-size: var(--mp-fs-caption); color: var(--mp-text-soft); line-height: 1.6; }

/* fields */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: var(--mp-fs-caption); font-weight: 500; color: var(--mp-text-soft); }
.field .input-wrap { position: relative; display: flex; align-items: center; }
.field input {
  width: 100%;
  font: inherit;
  font-size: var(--mp-fs-body);
  color: var(--mp-text);
  background: var(--mp-surface);
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-base);
  padding: 10px 14px;
  transition: border-color var(--mp-anim-fast);
}
.field input::placeholder { color: var(--mp-text-faint); }
.field input:focus { outline: none; border-color: var(--mp-primary); }
.field .toggle-pw {
  position: absolute; right: 6px; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--mp-text-soft); font-size: 18px; line-height: 1;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; font: inherit; font-size: var(--mp-fs-body-lg); font-weight: 600;
  padding: 14px 18px; border-radius: var(--mp-radius-base); border: 1px solid transparent;
  cursor: pointer; transition: transform var(--mp-anim-fast), opacity var(--mp-anim-fast);
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-primary { background: var(--mp-cta-fill); color: #fff; }
.btn-outline { background: transparent; color: var(--mp-primary); border-color: var(--mp-primary); }
.btn-link { background: none; border: none; color: var(--mp-primary); font-size: var(--mp-fs-caption); cursor: pointer; padding: 6px; width: auto; }

/* SSO 2-column (iOS SSOAuthButtons) */
.sso-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mp-space-sm); }
.btn-sso { font-weight: 600; font-size: var(--mp-fs-caption); padding: 13px 10px; }
.btn-apple { background: #000; color: #fff; }
.btn-google { background: #fff; color: var(--mp-text); border-color: var(--mp-border); }
.btn-sso .ic { font-size: 16px; line-height: 1; }

/* divider */
.divider { display: flex; align-items: center; gap: var(--mp-space-sm); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--mp-border-subtle); }
.divider span { font-size: var(--mp-fs-eyebrow); color: var(--mp-text-faint); text-transform: uppercase; letter-spacing: .1em; }

/* feedback */
.auth-error { font-size: var(--mp-fs-caption); color: var(--mp-danger); min-height: 1em; }
/* エラーなし時は行ぶんの空白を作らない(iOS詰めparity、flex gapも不参加になる) */
.auth-error:empty { display: none; }
.auth-note {
  font-size: var(--mp-fs-caption); color: var(--mp-text-mute); line-height: 1.6;
  background: var(--mp-primary-soft); border: 1px solid var(--mp-border-subtle);
  border-radius: var(--mp-radius-base); padding: var(--mp-space-base);
}
.auth-foot { text-align: center; font-size: var(--mp-fs-caption); color: var(--mp-text-soft); }
.field-hint { margin: 6px 0 0; font-size: var(--mp-fs-caption); color: var(--mp-text-soft); line-height: 1.5; }

.spinner {
  width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: mp-spin 0.7s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }

/* ---- LoggedOutHome (iOS) login layout ---- */
.lo-top { display: flex; align-items: center; justify-content: space-between; gap: var(--mp-space-sm);
  padding: var(--mp-space-base); border-bottom: 1px solid var(--mp-border-subtle); }
/* logged-out header (RESTO-PAAN style): brand left, language + トップページ right */
.lo-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.lo-brand .lo-mark { flex: none; width: 28px; height: 28px; display: block; }
.lo-brand .lo-mark svg { width: 100%; height: 100%; display: block; }
/* 公式ワードマーク(LP .lp-logo .wm と統一): Marcellus 単一ウェイト=400、tracking .14em */
.lo-brand .lo-wm { font-family: 'Marcellus', 'Playfair Display', 'Noto Serif JP', serif; font-weight: 400;
  font-size: var(--mp-fs-title); letter-spacing: .14em; color: var(--mp-primary); white-space: nowrap; }
.lo-top-r { display: inline-flex; align-items: center; gap: var(--mp-space-sm); flex: none; }
.lo-home { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--mp-text);
  font-size: var(--mp-fs-caption); white-space: nowrap; padding: 8px 6px; }
.lo-home svg { width: 17px; height: 17px; flex: none; }
/* narrow Android phones: keep the home icon, drop the label so the header never overflows */
@media (max-width: 360px) { .lo-home span { display: none; } }
.lo-globe { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--mp-border);
  background: var(--mp-surface); color: var(--mp-text); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
/* language pill (RESTO-PAAN style: globe + current language native name) */
.mp-langpill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-pill); background: var(--mp-surface); color: var(--mp-text);
  font-family: var(--mp-font-body); font-size: var(--mp-fs-caption); cursor: pointer; padding: 7px 13px; white-space: nowrap; }
.mp-langpill svg { width: 17px; height: 17px; flex: none; }
/* 2026-06-26 社長指示「ログイン前画面が大きすぎ、 SE 等で 1 画面に収めたい」: 余白・サイズを圧縮 */
.lo-body { max-width: 480px; margin: 0 auto; padding: var(--mp-space-base) var(--mp-space-base);
  display: flex; flex-direction: column; gap: var(--mp-space-sm); }

/* signup CTA box */
.signup-box { display: flex; align-items: center; gap: var(--mp-space-base);
  background: var(--mp-cta-fill); color: #fff; border: none; border-radius: var(--mp-radius-lg);
  padding: var(--mp-space-base); text-decoration: none; cursor: pointer; text-align: left; width: 100%; font: inherit; }
.signup-box .spark { flex: none; width: 24px; height: 24px; display: flex; align-items: center; }
.signup-box .spark svg { width: 22px; height: 22px; }
.signup-box .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.signup-box .t { display: block; font-family: var(--mp-font-display); font-size: var(--mp-fs-body-lg); font-weight: 700; line-height: 1.25; }
.signup-box .s { display: block; font-size: var(--mp-fs-caption); opacity: .92; line-height: 1.4; }
.signup-box .chev { font-size: 24px; opacity: .85; flex: none; }

/* 小型 signup CTA(2026-07-08 社長指示: 最上部 signup-box の 1 行ミラー、 フォーム下に再掲) */
.signup-mini { display: flex; align-items: center; gap: var(--mp-space-sm);
  background: var(--mp-cta-fill); color: #fff; border-radius: var(--mp-radius-base);
  padding: 12px 14px; text-decoration: none; width: 100%; }
.signup-mini svg { width: 15px; height: 15px; flex: none; }
.signup-mini .t { flex: 1; font-size: var(--mp-fs-body); font-weight: 600; line-height: 1.3; }
.signup-mini .chev { font-size: 18px; opacity: .85; flex: none; line-height: 1; }

/* monochrome password eye (replaces emoji) */
.toggle-pw { color: var(--mp-text-soft); }
.toggle-pw svg { width: 21px; height: 21px; display: block; }
.lo-globe svg { display: block; }

/* feature card */
.feature-card { background: var(--mp-bg-soft); border-radius: var(--mp-radius-lg); padding: 10px var(--mp-space-base); }
/* ブランド + サブタイトル(社長指示2026-06-26)。ワードマークは LP と同じ Marcellus 400(社長指示2026-07-02) */
.feature-card .fc-brand { text-align: center; font-family: 'Marcellus', 'Playfair Display', 'Noto Serif JP', serif;
  font-weight: 400; font-size: var(--mp-fs-title); letter-spacing: .14em; color: var(--mp-primary); }
.feature-card .fc-subtitle { text-align: center; font-size: var(--mp-fs-caption); color: var(--mp-text-soft);
  letter-spacing: .04em; margin: 3px 0 8px; }
/* 2026-07-02 社長指示: 見出し(fc-headline「外国での食事体験に革命を」)は iOS/PWA 双方から削除 */
.feature-row { display: flex; align-items: flex-start; gap: var(--mp-space-sm); padding: 1px 0; }
.feature-row .ic { color: var(--mp-primary); font-size: 16px; flex: none; width: 20px; text-align: center; }
.feature-row .ft { font-size: var(--mp-fs-caption); color: var(--mp-text); line-height: 1.5; }
.feature-card .fc-foot { margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--mp-border-subtle); text-align: center; }
.feature-card .fc-foot .fc-countries { display: block; font-size: var(--mp-fs-caption); font-weight: 600; color: var(--mp-text); }
.feature-card .fc-foot .fc-free { display: block; font-size: var(--mp-fs-caption); color: var(--mp-text-soft); margin-top: 3px; }

/* full-width stacked SSO (iOS SSOAuthButtons) */
.btn-sso-full { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: var(--mp-fs-body); font-weight: 700; padding: 12px; border-radius: var(--mp-radius-base);
  border: 1px solid transparent; cursor: pointer; }
.btn-sso-full.apple { background: #000; color: #fff; }
.btn-sso-full.google { background: #fff; color: var(--mp-text); border-color: var(--mp-border); }
.btn-sso-full .ic { font-size: 17px; }

/* iOS app download button (RESTO-PAAN style: outline + Apple mark + coming-soon note) */
.ios-app-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: var(--mp-space-sm); font: inherit; font-size: var(--mp-fs-body); font-weight: 700;
  padding: 12px; border-radius: var(--mp-radius-base); border: 1px solid var(--mp-border);
  background: #fff; color: var(--mp-text); text-decoration: none; cursor: pointer; }
.ios-app-btn svg { width: 18px; height: 18px; flex: none; }
.ios-app-note { text-align: center; font-size: var(--mp-fs-caption); color: var(--mp-text-soft); margin-top: var(--mp-space-sm); }

/* language menu */
.lang-menu { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; }
.lang-menu.show { display: flex; }
.lang-menu .box { background: var(--mp-surface); border-radius: var(--mp-radius-lg); max-width: 320px; width: 86%;
  max-height: 70vh; overflow: auto; padding: var(--mp-space-sm); }
.lang-menu .box button { width: 100%; text-align: left; padding: 13px var(--mp-space-base); border: none;
  background: none; font: inherit; font-size: var(--mp-fs-body); color: var(--mp-text); cursor: pointer; border-radius: var(--mp-radius-sm); }
.lang-menu .box button:hover, .lang-menu .box button.cur { background: var(--mp-primary-soft); color: var(--mp-primary-deep); }

/* MPPulseLoader (iOS parity 2026-07-08 / 1b97479): ボルドー同心円+外周パルスリング。
   ログイン処理中オーバーレイ等の全画面ローディングをアプリ共通の意匠に統一。 */
.mp-pulse { position: relative; width: 78px; height: 78px; flex: none; }
.mp-pulse i { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; }
.mp-pulse .pr { width: 52px; height: 52px; border: 1px solid color-mix(in srgb, var(--mp-primary) 45%, transparent);
  animation: mp-pulse-ring 1.6s ease-in-out infinite alternate; }
.mp-pulse .sr { width: 36px; height: 36px; border: 1.4px solid color-mix(in srgb, var(--mp-primary) 30%, transparent); }
.mp-pulse .core { width: 11px; height: 11px; background: var(--mp-primary); }
@keyframes mp-pulse-ring {
  from { transform: translate(-50%,-50%) scale(1); opacity: .8; }
  to   { transform: translate(-50%,-50%) scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .mp-pulse .pr { animation: none; opacity: .5; } }
