/* 認証画面・マイページ・プロフィール（持ち主: S2）。スマホ優先。色は原本に寄せた仮（テイストは後工程） */
:root {
  --bt-red: #c00000;
  --bt-red-dark: #7a0000;
  --bt-line: #e3e3e3;
  --bt-muted: #666;
  --bt-err-bg: #fdecec;
  --bt-err: #a40000;
}

/* ---------- 認証フォーム ---------- */
.auth { padding: 24px 16px 48px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--bt-line); border-radius: 12px; padding: 24px 20px; box-sizing: border-box; }
.auth-title { font-size: 1.5rem; margin: 0 0 16px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }
.auth-lead { margin: 0; color: var(--bt-muted); line-height: 1.6; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field__label { font-weight: 600; font-size: 0.95rem; }
.auth-field__hint { font-size: 0.8rem; color: var(--bt-muted); }
.auth-field input,
.pf-field input,
.pf-field select {
  font: inherit; font-size: 16px; /* iOS のズーム防止 */
  padding: 12px; border: 1px solid #bbb; border-radius: 8px; background: #fff; width: 100%; box-sizing: border-box;
}
.auth-field input:focus,
.pf-field input:focus,
.pf-field select:focus { outline: 2px solid var(--bt-red); outline-offset: 1px; border-color: var(--bt-red); }
[aria-invalid="true"] { border-color: var(--bt-err) !important; background: var(--bt-err-bg) !important; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; line-height: 1.5; }
.auth-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--bt-red); }
.auth-submit,
.pf-save,
.mp-logout {
  font: inherit; font-weight: 700; min-height: 48px; padding: 12px 16px; border: none; border-radius: 8px;
  background: var(--bt-red); color: #fff; cursor: pointer; width: 100%;
}
.auth-submit:hover, .pf-save:hover { background: var(--bt-red-dark); }
.auth-submit:disabled, .pf-save:disabled, .auth-google:disabled { opacity: 0.6; cursor: progress; }
.auth-submit--link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.auth-google {
  font: inherit; font-weight: 600; min-height: 48px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #bbb; border-radius: 8px; background: #fff; color: #222; cursor: pointer;
}
.auth-google:hover { background: #f6f6f6; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--bt-muted); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--bt-line); }
.auth-link-row { margin: 0; text-align: right; font-size: 0.9rem; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 0.95rem; }
.auth-note { margin: 0 0 16px; line-height: 1.6; }
.auth-note--muted { margin: 16px 0 0; font-size: 0.85rem; color: var(--bt-muted); }
.auth a, .mypage a { color: var(--bt-red-dark); }
.auth-done { text-align: center; line-height: 1.7; }
.auth-done__title { font-size: 1.15rem; margin: 0 0 8px; }

/* お知らせ枠は S1 の .alert（site.css）を使う */
.auth-card .alert { margin: 0 0 16px; }

/* ---------- マイページ（1 枚・スマホ優先） ---------- */
.mypage { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 24px; }
.mp-title { font-size: 1.5rem; margin: 0; }
.mypage h2 { font-size: 1.15rem; margin: 0 0 12px; }
.mp-band { background: #fff7f7; border: 1px solid #f0d6d6; border-radius: 12px; padding: 14px 16px; }
.mp-hello { font-weight: 700; font-size: 1.1rem; margin: 0; }
.mp-level { margin: 4px 0 0; color: var(--bt-muted); }
.mp-level[hidden], .mp-prompt[hidden] { display: none; }
.mp-prompt { margin: 8px 0 0; font-size: 0.95rem; }
.mp-study { display: flex; flex-direction: column; gap: 24px; }
.mp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mp-empty { margin: 0; color: var(--bt-muted); line-height: 1.6; }
.mp-details { border: 1px solid var(--bt-line); border-radius: 12px; background: #fff; }
.mp-details > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; min-height: 24px; }
.mp-details[open] > summary { border-bottom: 1px solid var(--bt-line); }
.mp-account { border-top: 1px solid var(--bt-line); padding-top: 16px; }
.mp-email { margin: 0 0 12px; color: var(--bt-muted); word-break: break-all; }
.mp-logout { background: #fff; color: var(--bt-red-dark); border: 1px solid var(--bt-red-dark); max-width: 320px; }
.mp-logout:hover { background: #fff3f3; }

@media (min-width: 992px) {
  .mp-study { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
  .mp-studying .mp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-player { position: sticky; top: 16px; }
}

/* ---------- プロフィール ---------- */
.pf-form { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.pf-name { border: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pf-name legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-label { font-weight: 600; font-size: 0.95rem; }
.pf-req { display: inline-block; font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--bt-red); border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.pf-save { max-width: 320px; }
@media (min-width: 600px) {
  .pf-name { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
