:root {
  --bg: #f6f4fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: #e8e1ee;
  --line-strong: #d8c7e4;
  --text: #1d1a23;
  --muted: #6f6677;
  --brand: #5b1f7a;
  --brand-soft: #f3defd;
  --brand-strong: #451361;
  --accent: #e7d2ff;
  --success: #e7f7ef;
  --shadow: 0 24px 80px rgba(69, 19, 97, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(232, 197, 255, 0.62), transparent 38%),
    radial-gradient(circle at bottom right, rgba(208, 241, 255, 0.4), transparent 34%),
    linear-gradient(180deg, #faf7ff 0%, #f6f4fb 100%);
  font-family: "Plus Jakarta Sans", "Noto Sans JP", sans-serif;
}

.auth-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-card {
  backdrop-filter: blur(20px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-inner {
  padding: 24px;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.auth-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
}

.auth-brand-stack {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
}

.auth-connection-pill,
.auth-choice-connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #17663d;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.auth-connection-pill {
  padding: 7px 10px;
  border: 1px solid rgba(25, 135, 84, 0.18);
  border-radius: 999px;
  background: rgba(231, 247, 239, 0.82);
}

.auth-connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #20c46b;
  box-shadow: 0 0 0 4px rgba(32, 196, 107, 0.15);
}

.auth-login-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  text-align: center;
}

.auth-login-brand {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2.45rem, 9vw, 3.6rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-align: center;
}

.auth-login-tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.auth-back,
.auth-ghost-link,
.auth-chip,
.auth-icon-button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.auth-back,
.auth-icon-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.auth-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.auth-stepper span {
  height: 5px;
  border-radius: 999px;
  background: #e9e3ee;
}

.auth-stepper span.is-active {
  background: linear-gradient(90deg, var(--brand) 0%, #8644a9 100%);
}

.auth-header {
  margin-bottom: 28px;
}

.auth-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.auth-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.98rem;
}

.auth-section {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field-label,
.auth-meta-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

.auth-input,
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-select,
.auth-textarea,
.auth-file-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-input:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-select:focus,
.auth-textarea:focus,
.auth-file-input:focus {
  border-color: #ba8ddd;
  box-shadow: 0 0 0 4px rgba(168, 110, 214, 0.14);
}

.auth-textarea {
  min-height: 120px;
  resize: vertical;
}

.auth-inline {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-checkbox-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

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

.auth-actions {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.auth-button {
  appearance: none;
  border: 0;
  width: 100%;
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  font: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(69, 19, 97, 0.22);
}

.auth-button.secondary {
  background: rgba(255, 255, 255, 0.74);
  color: var(--brand);
  border: 1px solid var(--line);
  box-shadow: none;
}

.auth-button.linklike {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--brand);
  text-align: left;
  width: auto;
}

.auth-link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-help {
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-inline-link {
  justify-self: end;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.auth-inline-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-errors,
.auth-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-errors li,
.auth-messages li {
  list-style: none;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
}

.auth-errors li {
  background: #fff0f0;
  color: #8a1d1d;
  border: 1px solid #f6cccc;
}

.auth-messages li {
  background: var(--success);
  color: #145a37;
  border: 1px solid #c7ead8;
}

.auth-choice-list {
  display: grid;
  gap: 12px;
}

.auth-choice-card {
  position: relative;
}

.auth-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-choice-card label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-choice-card input:checked + label {
  border-color: #b26fd8;
  box-shadow: 0 18px 34px rgba(116, 44, 157, 0.14);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 222, 253, 0.62));
}

.auth-choice-title {
  display: block;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-choice-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-choice-connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #17663d;
  white-space: nowrap;
}

.auth-choice-check {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: transparent;
  background: #fff;
}

.auth-choice-card input:checked + label .auth-choice-check {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.auth-split {
  display: grid;
  gap: 12px;
}

.auth-muted-box {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.auth-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-chip button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.auth-policy {
  line-height: 1.7;
  color: var(--muted);
}

.auth-policy h2 {
  margin: 24px 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.auth-policy p {
  margin: 0 0 14px;
}

.auth-policy ol,
.auth-policy ul {
  margin: 0 0 16px;
  padding-left: 1.35rem;
}

.auth-policy li {
  margin: 5px 0;
}

.auth-policy ul {
  list-style: disc;
}

@media (max-width: 640px) {
  .auth-shell {
    padding: 18px 14px 28px;
  }

  .auth-card-inner {
    padding: 18px;
  }
}
