:root {
  color-scheme: light dark;
  --bg: #f1f5f9;
  --panel: #fff;
  --soft: #f8fafc;
  --text: #10223a;
  --muted: #4b5d73;
  --line: #d7e0ea;
  --accent: #174cb6;
  --button: #205aca;
  --button-hover: #174aae;
  --focus: #4580ed;
  --danger: #a32933;
  --shadow: 0 18px 58px #15344e10;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101722;
    --panel: #182332;
    --soft: #132031;
    --text: #edf3fc;
    --muted: #b1c1d4;
    --line: #38485e;
    --accent: #a2c4ff;
    --button: #235dc4;
    --button-hover: #194caa;
    --focus: #91b8ff;
    --danger: #ffa5ad;
    --shadow: 0 18px 60px #050a1260;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  padding: clamp(16px, 4vw, 52px);
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, "Noto Sans CJK JP", sans-serif;
}
h1, h2, p { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.login-page { display: grid; align-content: center; justify-items: center; gap: 18px; }
.login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  width: min(100%, 850px);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.login-intro, .login-content, .panel { padding: clamp(24px, 4vw, 44px); }
.login-intro { border-inline-end: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; width: fit-content; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--button); color: #fff; font-size: 1.2rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.22; letter-spacing: -.04em; }
.login-intro h1 { margin: 27px 0 12px; }
.login-intro p, .muted { color: var(--muted); }
.login-content, .stack, .panel { display: grid; gap: 15px; }
.stack label, .inline-form label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.stack label .muted { display: inline; font-weight: 400; }
input:not([type=checkbox]), textarea {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font: inherit;
  font-weight: 650;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--soft); text-decoration: none; }
.primary { background: var(--button); border-color: transparent; color: #fff; }
.primary:hover { background: var(--button-hover); }
.button:disabled { cursor: wait; opacity: .54; }
.full { width: 100%; }
.rule { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; }
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.google { display: flex; justify-content: center; min-width: 0; }
.google:empty { display: none; }
.captcha { max-width: 100%; overflow: auto; }
.text-link { font-size: .9rem; }
.notice { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px 14px; }
.auth-footer, .actions, .security-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.auth-footer { justify-content: center; font-size: .85rem; }
.auth-footer a { color: var(--muted); }
.security-page { max-width: 850px; margin: auto; display: grid; gap: 18px; }
.security-heading { justify-content: space-between; }
.security-title { margin: 8px 0; }
.security-title p { color: var(--muted); margin-top: 8px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.panel h2 { font-size: 1.2rem; }
.security-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.security-list li { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; overflow-wrap: anywhere; }
.security-list .row-text { flex: 1 1 220px; }
.row-text span { display: block; color: var(--muted); font-size: .83rem; }
.row-button { min-height: 37px; padding: 5px 10px; font-size: .84rem; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.inline-form label { flex: 1 1 180px; min-width: 0; }
.danger { color: var(--danger); }
.code-display { overflow: auto; padding: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
details summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: 12px; }
@media (max-width: 670px) {
  .login-card { grid-template-columns: minmax(0, 1fr); border-radius: 20px; }
  .login-intro { border-inline-end: 0; padding-bottom: 0; }
  .login-intro h1 { margin-top: 20px; }
}
