.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 30px 18px; }
.auth-shell { width: min(100%, 700px); }
.auth-title-logo { width: min(100%, 620px); margin: 0 auto 24px; }
.auth-title-logo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 28px rgba(0,0,0,0.22)); }
/* ロゴの下のバージョン表記（例：－β版－）。管理画面「タイトル画面」で設定 */
.title-version-label { margin: 4px 0 0; color: #eef0ff; font: 800 clamp(1rem, 2.6vw, 1.35rem)/1.4 var(--font-serif, "Noto Serif JP", serif); letter-spacing: .3em; text-align: center; text-shadow: 0 0 12px rgba(174, 188, 255, .55), 0 2px 6px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.title-version-label[hidden] { display: none; }
.back-link { display: block; width: min(100%, 520px); margin: 0 auto 20px; color: var(--muted); font: 0.9rem/1.2 var(--font-sans); text-decoration: none; }
.auth-card { width: min(100%, 520px); margin-inline: auto; padding: clamp(26px, 7vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: rgba(19, 23, 45, 0.9); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.auth-intro h1 { margin: 0 0 16px; font-size: clamp(1.8rem, 6vw, 2.7rem); font-weight: 700; }
.auth-intro > p:last-child,
.auth-intro > .auth-description { margin: 0 0 28px; color: var(--muted); line-height: 1.8; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 24px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0, 0, 0, 0.16); }
.auth-tab { padding: 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; }
.auth-tab.is-active { color: var(--text); background: rgba(174, 188, 255, 0.13); }
.auth-form { display: grid; gap: 17px; }
.auth-form label, .editor-card label { display: grid; gap: 8px; color: #d9dcef; font: 0.88rem/1.4 var(--font-sans); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(2, 4, 14, 0.48); }
input, select { min-height: 45px; padding: 9px 12px; }
textarea { padding: 12px; line-height: 1.7; resize: vertical; }
.form-message { min-height: 1.5em; margin: 16px 0 0; color: var(--muted); font: 0.88rem/1.6 var(--font-sans); }
.form-message.is-error { color: var(--danger); }
.form-message.is-success { color: var(--success); }
.admin-guide { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font: 0.84rem/1.6 var(--font-sans); text-align: center; }
.admin-auth-page .auth-card { border-color: rgba(255, 187, 203, 0.16); }
.demo-credentials { font-family: var(--font-sans); }
.demo-credentials code { display: inline-block; padding: 2px 6px; border-radius: 5px; color: var(--text); background: rgba(255, 255, 255, 0.08); user-select: all; }
.registration-result { padding: 22px; border: 1px solid rgba(142,224,189,0.24); border-radius: 16px; background: rgba(72,160,121,0.08); text-align: center; }
.registration-result h2 { margin: 0 0 18px; font-size: 1.65rem; font-weight: 700; }
.registration-result > p { margin-block: 8px; }
.issued-eno { color: var(--accent); font: 1.15rem/1.2 var(--font-sans); }
.issued-eno strong { margin-left: 0.1em; font-size: clamp(2.7rem, 12vw, 4.5rem); }
.issued-name { font-size: 1.2rem; font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }

.title-auth-page.has-site-menu .auth-shell {
  display: grid;
  width: min(100%, 760px);
  min-height: calc(100dvh - 40px);
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: clamp(12px, 1.8vh, 20px);
  margin: 0 auto;
  padding: clamp(12px, 2vh, 22px) 18px;
}
.title-auth-page .site-header {
  position: sticky;
  inset-inline: 0;
  width: 100%;
  max-width: none;
  min-height: 40px;
  margin: 0;
  padding: 3px clamp(14px, 4vw, 46px);
}
.title-auth-page .site-header .brand { gap: 7px; font-size: 0.88rem; }
.title-auth-page .site-header .brand-mark { font-size: 1rem; }
.title-auth-page .site-header .menu-toggle-button { width: 32px; height: 32px; flex-basis: 32px; }
.title-auth-page .site-header .menu-icon,
.title-auth-page .site-header .menu-icon::before,
.title-auth-page .site-header .menu-icon::after { width: 17px; }
.title-auth-page .site-header .menu-icon::before { top: -5px; }
.title-auth-page .site-header .menu-icon::after { top: 5px; }
.title-auth-page .menu-backdrop { top: 40px; }
.title-auth-page .header-menu-panel {
  top: 40px;
  height: calc(100dvh - 40px);
  padding-top: 20px;
}
.title-auth-page.menu-is-open .auth-shell { width: min(100%, 760px); }
.title-auth-page.menu-is-open .site-header { width: 100%; }
.title-auth-page.menu-is-open .site-header .menu-icon::before { top: 0; transform: translateX(-50%) rotate(45deg); }
.title-auth-page.menu-is-open .site-header .menu-icon::after { top: 0; transform: translateX(-50%) rotate(-45deg); }
.title-auth-page .auth-title-logo { width: min(72vw, 510px); margin: 0; }
.title-auth-page .auth-title-logo img { max-height: min(27vh, 255px); object-fit: contain; }
/* バージョン表記をロゴの絵のすぐ下へ（ロゴ画像の下側は透明な余白なので、その分だけ上に重ねる） */
.title-auth-page .auth-title-logo { container-type: inline-size; }
.title-auth-page .title-version-label { position: relative; margin-top: calc(min(50cqw, 27vh, 255px) * -0.12); }
.title-auth-page .auth-card {
  width: min(100%, 470px);
  margin: 0;
  padding: clamp(18px, 2.6vh, 26px) clamp(22px, 4vw, 36px);
  border-radius: 18px;
  background: rgba(19,23,45,0.8);
  backdrop-filter: blur(8px);
}
.title-auth-page .auth-intro { text-align: center; }
.title-auth-page .auth-intro .eyebrow { margin-bottom: 5px; }
.title-auth-page .auth-intro h1 { margin-bottom: 5px; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.title-auth-page .auth-intro > p:last-child,
.title-auth-page .auth-intro > .auth-description { margin-bottom: 14px; line-height: 1.5; }
.title-auth-page .auth-form { gap: 11px; }
.title-auth-page .auth-form label { gap: 5px; }
.title-auth-page .auth-form input { min-height: 42px; }
.title-auth-page .form-message { min-height: 1.2em; margin-top: 9px; line-height: 1.35; text-align: center; }
.title-auth-page .admin-guide { margin-top: 11px; padding-top: 10px; }
.title-auth-page .registration-result { padding: 16px; }
.title-auth-page .registration-result h2 { margin-bottom: 9px; }
.title-auth-page .registration-result .issued-eno strong { font-size: clamp(2.2rem, 8vw, 3.4rem); }
.auth-return-login {
  justify-self: center;
  padding: 3px 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}
.title-page-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; font-family: var(--font-sans); }
.title-session-loading { min-height: 132px; display: grid; place-items: center; }
.title-session-loading[hidden],
.title-logged-in-card[hidden],
#title-login-card[hidden] { display: none !important; }
.title-session-loading p { margin: 0; color: var(--muted); font: 700 0.9rem/1.6 var(--font-sans); }
.title-logged-in-card { text-align: center; }
.title-logged-in-card h1 { margin: 4px 0 10px; font-size: clamp(1.45rem, 3vw, 1.9rem); }
.title-logged-in-user { margin: 0 0 18px; color: var(--muted); font: 700 0.95rem/1.7 var(--font-sans); }
.title-logged-in-actions { display: grid; gap: 9px; }
.title-page-links a,
.title-page-links button { padding: 4px 0; border: 0; color: var(--text); background: transparent; cursor: pointer; font: 700 0.96rem/1.4 var(--font-sans); text-decoration: underline; text-decoration-color: rgba(174,188,255,0.55); text-underline-offset: 0.28em; }
.title-page-links a:hover,
.title-page-links button:hover,
.title-page-links button.is-active { color: var(--accent); }
.title-rules-dialog {
  width: min(90vw, 560px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: rgba(15,18,38,0.98);
  box-shadow: var(--shadow);
}
.title-rules-dialog::backdrop { background: rgba(2,3,12,0.72); backdrop-filter: blur(4px); }
.title-rules-dialog form { padding: clamp(22px, 5vw, 34px); }
.title-rules-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.title-rules-heading-row h2 { margin: 0; font-size: 1.55rem; }
.rules-close-button { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: transparent; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.title-rules-dialog ul { display: grid; gap: 11px; margin: 24px 0; padding-left: 1.4em; color: var(--muted); line-height: 1.75; }
.title-rules-content { margin: 24px 0; color: var(--muted); line-height: 1.75; }

/* 右端にスクロールバー用の空き（色の違う細い帯）が出ていたので、場所を空けておく指定はやめる */

@media (max-width: 640px) {
  .auth-page { place-items: start center; padding: 18px 12px 28px; }
  .auth-title-logo { margin-bottom: 16px; }
  .back-link { margin-bottom: 16px; }
  .title-auth-page.has-site-menu .auth-shell { min-height: calc(100dvh - 40px); gap: 12px; padding: 14px 12px 24px; }
  .title-auth-page .auth-title-logo { width: min(92vw, 450px); margin: 0; }
  .title-auth-page .auth-title-logo img { max-height: none; }
  .title-auth-page .title-version-label { margin-top: calc(50cqw * -0.12); }
  .title-auth-page .auth-card { padding: 20px 18px; }
  .title-page-links { gap: 8px 18px; }
}

@media (min-width: 641px) and (max-height: 820px) {
  .title-auth-page.has-site-menu .auth-shell { gap: 9px; padding-block: 8px; }
  .title-auth-page .auth-title-logo { width: min(58vw, 410px); }
  .title-auth-page .auth-title-logo img { max-height: 205px; }
  .title-auth-page .title-version-label { margin-top: calc(min(50cqw, 205px) * -0.12); }
  .title-auth-page.auth-signup-mode .auth-title-logo { width: min(48vw, 330px); }
  .title-auth-page .auth-card { padding-block: 15px; }
  .title-auth-page .auth-intro .eyebrow { display: none; }
  .title-auth-page .auth-intro > p:last-child,
  .title-auth-page .auth-intro > .auth-description { margin-bottom: 9px; }
  .title-auth-page .admin-guide { margin-top: 8px; padding-top: 7px; }
}

/* 背景：左→右に色が変わり（左は青み・右は紫み）、下ほど黒くなるグラデーション。ページの長さに関係なく画面に固定する */
html:has(body.title-auth-page) { background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 55%), linear-gradient(90deg, #10142c 0%, #090b1c 50%, #120d22 100%); background-attachment: fixed; }
body.title-auth-page { background: transparent; }
/* 星の模様は今まで背景に隠れて見えていなかったので、見た目を変えないよう出さないままにする */
body.title-auth-page::before { content: none; }
