:root {
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17243a;
  background: #eaf0f6;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  padding: 32px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 14%, rgba(41, 114, 174, .16), transparent 30rem),
    radial-gradient(circle at 88% 84%, rgba(219, 166, 45, .13), transparent 26rem),
    #eaf0f6;
}
.auth-shell {
  width: min(960px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(23, 63, 103, .18);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(25, 50, 78, .18);
}
.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #0b2d50 0%, #174f7d 58%, #116d91 100%);
}
.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(244, 201, 93, .22);
  border-radius: 50%;
  pointer-events: none;
}
.brand-panel::before { width: 390px; height: 390px; right: -190px; top: -145px; }
.brand-panel::after { width: 280px; height: 280px; left: -150px; bottom: -150px; }
.brand-copy, .brand-footer { position: relative; z-index: 1; }
.brand-name {
  margin: 0 0 22px;
  color: #f4c95d;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .22em;
}
.brand-panel h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.brand-lead {
  max-width: 470px;
  margin: 24px 0 0;
  color: #dceaf5;
  font-size: 1rem;
  line-height: 1.85;
}
.source-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.source-tags span {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  color: #e9f3fa;
  background: rgba(255, 255, 255, .08);
  font-size: .78rem;
  font-weight: 700;
}
.brand-footer { margin: 48px 0 0; color: #bcd1e2; font-size: .78rem; }
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px;
}
.eyebrow {
  margin: 0 0 9px;
  color: #1769aa;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-panel h2 { margin: 0; color: #122033; font-size: 1.9rem; letter-spacing: -.025em; }
.intro { margin: 10px 0 28px; color: #687789; font-size: .92rem; line-height: 1.7; }
form { margin: 0; }
label {
  display: block;
  margin: 0 0 18px;
  color: #314158;
  font-size: .88rem;
  font-weight: 720;
}
input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 11px 13px;
  border: 1px solid #c6d1dd;
  border-radius: 10px;
  outline: none;
  color: #18263a;
  background: #fbfdff;
  font: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:hover { border-color: #9eb1c3; }
input:focus { border-color: #1769aa; background: #fff; box-shadow: 0 0 0 4px rgba(23, 105, 170, .13); }
button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, #1769aa, #0e578e);
  box-shadow: 0 8px 20px rgba(23, 105, 170, .2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(23, 105, 170, .27); }
button:active { transform: translateY(0); }
button:disabled { opacity: .58; cursor: wait; transform: none; }
.message {
  min-height: 22px;
  margin: 16px 0 0;
  color: #b4232d;
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.message.success { color: #18784a; }
.auth-links { display: flex; justify-content: center; gap: 16px; margin: 22px 0 0; font-size: .88rem; }
a { color: #1769aa; font-weight: 720; text-underline-offset: 3px; }
a:hover { color: #0b4e82; }

/* 既存の登録申請・再設定画面も共有CSSで崩さない。 */
body > main:not(.auth-shell) {
  width: min(480px, 100%);
  padding: 38px;
  border: 1px solid rgba(23, 63, 103, .16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(25, 50, 78, .16);
}
.register-card { width: min(560px, 100%) !important; }
.registration-note { margin: -12px 0 24px; color: #687789; line-height: 1.7; }
.registration-checks { margin: 4px 0 24px; padding: 18px; border: 1px solid #d5dee7; border-radius: 12px; background: #f7fafc; }
.check-label { display: flex; align-items: flex-start; gap: 11px; margin: 0; line-height: 1.55; cursor: pointer; }
.check-label + .check-label { margin-top: 14px; }
.check-label input { flex: 0 0 auto; width: 19px; min-height: 19px; margin: 2px 0 0; accent-color: #1769aa; }
.check-label span { font-weight: 650; }
.back-link { text-align: center; }
.terms-body { display: block; padding: 32px 18px; }
.terms-card { width: min(820px, 100%); margin: 0 auto; padding: 44px 48px; border: 1px solid rgba(23, 63, 103, .16); border-radius: 18px; background: #fff; box-shadow: 0 20px 55px rgba(25, 50, 78, .16); }
.terms-brand { margin: 0 0 10px; color: #9a6a00; font-size: .7rem; font-weight: 850; letter-spacing: .18em; }
.terms-card h1 { margin: 0; color: #122033; font-size: 2rem; }
.terms-version { margin: 6px 0 30px; color: #687789; }
.terms-card h2 { margin: 30px 0 8px; color: #173f67; font-size: 1.1rem; }
.terms-card p { line-height: 1.85; }
.terms-date { margin-top: 36px; color: #687789; text-align: right; }
@media (max-width: 600px) { .terms-card { padding: 30px 22px; } }
body > main:not(.auth-shell)::before {
  content: "TRAPEZIUM RACE SYSTEM";
  display: block;
  margin-bottom: 13px;
  color: #9a6a00;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .18em;
}
body > main:not(.auth-shell) h1 {
  margin: 0 0 26px;
  color: #122033;
  font-size: 1.8rem;
  letter-spacing: -.025em;
}
body > main:not(.auth-shell) #m {
  min-height: 22px;
  margin: 16px 0;
  color: #b4232d;
  line-height: 1.55;
  white-space: pre-wrap;
}
body > main:not(.auth-shell) > p:last-child { text-align: center; }
@media (max-width: 760px) {
  body { padding: 18px; place-items: start center; }
  .auth-shell { min-height: 0; grid-template-columns: 1fr; border-radius: 18px; }
  .brand-panel { min-height: 210px; padding: 30px; }
  .brand-panel h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .brand-lead { margin-top: 14px; font-size: .9rem; line-height: 1.65; }
  .source-tags { margin-top: 18px; }
  .brand-footer { display: none; }
  .auth-panel { padding: 34px 30px 38px; }
}
@media (max-width: 430px) {
  body { padding: 0; background: #fff; }
  .auth-shell { border: 0; border-radius: 0; box-shadow: none; }
  .brand-panel { min-height: 178px; padding: 24px 22px; }
  .brand-name { margin-bottom: 13px; font-size: .67rem; }
  .brand-panel h1 { font-size: 2rem; }
  .brand-lead { margin-top: 10px; font-size: .82rem; }
  .source-tags { display: none; }
  .auth-panel { padding: 30px 22px 40px; }
  .auth-panel h2 { font-size: 1.65rem; }
  .intro { margin-bottom: 24px; }
  body > main:not(.auth-shell) {
    min-height: 100vh;
    padding: 32px 22px 40px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
