:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #68738b;
  --line: #e3e7f0;
  --primary: #5b50e6;
  --primary-dark: #4539ce;
  --surface: #ffffff;
  --background: #f5f6fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(460px, 1.1fr);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10vw;
  color: #fff;
  background:
    radial-gradient(circle at 15% 20%, #8f87ff 0, transparent 30%),
    linear-gradient(145deg, #4034c5, #675cf2 55%, #8d85ff);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 420px;
  height: 420px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 25px;
  font-weight: 800;
  background: rgb(255 255 255 / 18%);
  border: 1px solid rgb(255 255 255 / 28%);
}

.eyebrow {
  margin: 32px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.8;
}

.brand-panel h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.brand-panel p:not(.eyebrow) {
  max-width: 520px;
  margin: 28px 0 0;
  line-height: 1.9;
  color: rgb(255 255 255 / 82%);
}

.version {
  margin-top: 36px;
  align-self: flex-start;
  padding: 7px 12px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  font-size: 12px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 48px 24px;
}

.login-card {
  width: min(100%, 440px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(41 48 78 / 10%);
}

.mobile-brand {
  display: none;
  color: var(--primary);
  font-weight: 800;
}

.login-card h2 {
  margin: 0;
  font-size: 30px;
}

.lead {
  margin: 12px 0 32px;
  color: var(--muted);
  line-height: 1.7;
}

.field { margin-bottom: 22px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgb(91 80 230 / 10%);
}

.primary-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover { background: var(--primary-dark); }

.form-alert,
.message {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #a32632;
  background: #fff1f2;
  font-size: 14px;
}

.field-error {
  margin: 7px 0 0;
  color: #c23945;
  font-size: 13px;
}

.security-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 880px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .mobile-brand {
    display: block;
    margin-bottom: 28px;
  }
}


/* v0.3.0-beta.2 account flows */
.admin-auth .brand-panel {
  background:
    radial-gradient(circle at 15% 20%, #676f91 0, transparent 30%),
    linear-gradient(145deg, #20263a, #343d5d 55%, #535f86);
}

.role-badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: #efedff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.admin-role {
  color: #354063;
  background: #edf0f8;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  font-size: 13px;
}

.auth-links a,
.security-note a {
  color: var(--primary);
  text-decoration: none;
}

.auth-links a:hover,
.security-note a:hover {
  text-decoration: underline;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.secondary-button,
.button-link {
  display: grid;
  width: 100%;
  min-height: 48px;
  place-items: center;
  border-radius: 11px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary-button:hover {
  border-color: #c8cce0;
  background: #fafafe;
}

.button-link {
  display: grid;
}

.help-text {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.password-help ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 22px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.checkbox-field label {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.status-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 18px;
  color: var(--primary);
  background: #efedff;
  font-size: 27px;
  font-weight: 800;
}

.status-icon.success {
  color: #217a4a;
  background: #eaf8ef;
}

.status-icon.warning {
  color: #a36a10;
  background: #fff5df;
}

.status-box {
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fafafe;
  font-size: 13px;
  line-height: 1.8;
}

.login-card form + .security-note,
.status-box + .secondary-button,
.lead + .secondary-button {
  margin-top: 20px;
}

.form-alert p,
.message p {
  margin: 0;
}

@media (max-width: 520px) {
  .login-panel {
    padding: 20px 14px;
  }

  .login-card {
    padding: 28px 22px;
    border-radius: 18px;
  }

  .auth-links {
    flex-direction: column;
    gap: 10px;
  }
}
