:root {
  color-scheme: light;
  --auth-bg: #fffaf6;
  --auth-surface: #fffefd;
  --auth-surface-soft: #f5f0eb;
  --auth-surface-rose: #fff0f3;
  --auth-surface-green: #edf7f0;
  --auth-surface-amber: #fff4dc;
  --auth-ink: #211f1c;
  --auth-muted: #716b65;
  --auth-outline: #e8dfd7;
  --auth-primary: #c7355d;
  --auth-primary-strong: #aa264c;
  --auth-primary-soft: #fde4eb;
  --auth-green: #2d7a56;
  --auth-danger: #9e2947;
  --auth-shadow: 0 18px 48px rgba(66, 47, 37, .08);
  --auth-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-family: var(--auth-font);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--auth-bg);
}

body.auth-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 198, 210, .28), transparent 18rem),
    radial-gradient(circle at -5% 38%, rgba(202, 229, 210, .26), transparent 17rem),
    var(--auth-bg);
}

a { color: inherit; }

button,
input {
  font: inherit;
}

button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(199, 53, 93, .22);
  outline-offset: 2px;
}

.auth-shell {
  width: min(calc(100% - 24px), 720px);
  margin: 0 auto;
  padding:
    max(14px, env(safe-area-inset-top))
    0
    max(28px, env(safe-area-inset-bottom));
}

.auth-brandbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 14px;
}

.auth-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--auth-ink);
  text-decoration: none;
}

.auth-brand img {
  width: 38px;
  height: 38px;
  padding: 4px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 6px 18px rgba(56, 42, 33, .08);
}

.auth-brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.auth-brand-copy small {
  color: #9d6677;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-brand-copy strong {
  overflow: hidden;
  font-size: .9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-secure-chip,
.auth-state-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--auth-surface-green);
  color: var(--auth-green);
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-state-chip.is-muted {
  background: #f0ece8;
  color: #7e7770;
}

.auth-secure-chip::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.auth-main {
  display: grid;
  gap: 14px;
}

.auth-hero {
  padding: 24px 4px 12px;
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: #a15e72;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-hero h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(2.25rem, 10vw, 4rem);
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: 1.04;
}

.auth-hero p:last-child {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--auth-muted);
  font-size: .94rem;
  line-height: 1.7;
}

.auth-card {
  padding: 20px;
  border: 1px solid var(--auth-outline);
  border-radius: 28px;
  background: rgba(255, 254, 253, .95);
  box-shadow: 0 10px 32px rgba(62, 45, 35, .045);
}

.auth-card-primary {
  border-color: #efccd5;
  background:
    linear-gradient(145deg, #fffefd 0%, #fff5f7 100%);
  box-shadow: var(--auth-shadow);
}

.auth-card-soft {
  background: rgba(248, 244, 239, .92);
  box-shadow: none;
}

.auth-card-amber {
  border-color: #ecd7aa;
  background: var(--auth-surface-amber);
  box-shadow: none;
}

.auth-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-section-head > div {
  min-width: 0;
}

.auth-section-head h2,
.auth-card h2 {
  margin: 0 0 5px;
  font-size: 1.22rem;
  line-height: 1.25;
}

.auth-section-head p,
.auth-card > p,
.auth-card li p,
.auth-card [id$="-panel"] > p {
  margin: 0;
  color: var(--auth-muted);
  font-size: .82rem;
  line-height: 1.65;
}

.auth-step-chip {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: var(--auth-primary-soft);
  color: var(--auth-primary-strong);
  font-size: .78rem;
  font-weight: 900;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.auth-field > span {
  color: #655f59;
  font-size: .75rem;
  font-weight: 800;
}

.auth-field input,
.passkey-label {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #ddd4cc;
  border-radius: 16px;
  outline: 0;
  background: #fff;
  color: var(--auth-ink);
  font-size: 1rem;
  transition:
    border-color 160ms cubic-bezier(.2,0,0,1),
    box-shadow 160ms cubic-bezier(.2,0,0,1),
    background-color 160ms cubic-bezier(.2,0,0,1);
}

.auth-field input:focus,
.passkey-label:focus {
  border-color: #d76583;
  box-shadow: 0 0 0 4px rgba(199, 53, 93, .09);
}

.auth-field input::placeholder,
.passkey-label::placeholder {
  color: #aca49d;
}

.auth-button,
.auth-link-button,
button.auth-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--auth-primary), #dc5574);
  color: #fff;
  box-shadow: 0 8px 22px rgba(199, 53, 93, .18);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 140ms cubic-bezier(.2,0,0,1),
    box-shadow 180ms cubic-bezier(.2,0,0,1),
    background-color 180ms cubic-bezier(.2,0,0,1);
}

.auth-button:hover,
.auth-link-button:hover {
  box-shadow: 0 11px 26px rgba(199, 53, 93, .23);
}

.auth-button:active,
.auth-link-button:active {
  transform: scale(.98);
}

.auth-button:disabled,
button:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-button-secondary {
  border: 1px solid var(--auth-outline);
  background: #fff;
  color: var(--auth-ink);
  box-shadow: none;
}

.auth-button-secondary:hover {
  border-color: #e1bac5;
  box-shadow: 0 7px 18px rgba(62, 45, 35, .06);
}

.auth-button-danger {
  border: 1px solid #edc2cd;
  background: #fff7f9;
  color: var(--auth-danger);
  box-shadow: none;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.auth-actions > .auth-button,
.auth-actions > .auth-link-button {
  flex: 1 1 180px;
}

.auth-method-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: .8rem;
  font-weight: 900;
}

.auth-button-secondary .auth-method-icon {
  background: #f2ede9;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
  color: #9b938c;
  font-size: .68rem;
  font-weight: 700;
}

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

.auth-details {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--auth-outline);
  border-radius: 24px;
  background: rgba(255,254,253,.9);
}

.auth-details summary {
  position: relative;
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 820;
  list-style: none;
}

.auth-details summary::-webkit-details-marker {
  display: none;
}

.auth-details summary::after {
  color: #8c847d;
  content: "⌄";
  font-size: 1.1rem;
  transition: transform 180ms cubic-bezier(.2,0,0,1);
}

.auth-details[open] summary::after {
  transform: rotate(180deg);
}

.auth-details-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.auth-details-body > p {
  margin: 0;
  color: var(--auth-muted);
  font-size: .78rem;
  line-height: 1.55;
}

.auth-status {
  min-height: 0;
  margin: 0;
  padding: 0;
  color: var(--auth-green);
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.55;
}

.auth-status:not(:empty) {
  padding: 12px 14px;
  border: 1px solid #cfe7d6;
  border-radius: 16px;
  background: #f0f8f2;
}

.auth-status[data-error="1"]:not(:empty) {
  border-color: #f0c6d0;
  background: #fff1f4;
  color: var(--auth-danger);
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px 4px 2px;
  color: var(--auth-muted);
  font-size: .76rem;
}

.auth-footer a {
  font-weight: 750;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 7px;
  border-radius: 8px;
  background: #f2ede8;
  color: #5b554f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
}

.auth-profile-row {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: var(--auth-surface-soft);
}

.auth-avatar {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  background: var(--auth-primary-soft);
  color: var(--auth-primary-strong);
  font-weight: 900;
}

.auth-profile-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.auth-profile-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-profile-copy small {
  color: var(--auth-muted);
  font-size: .72rem;
}

.auth-passkey-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.auth-passkey-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--auth-outline);
  border-radius: 20px;
  background: #fff;
}

.auth-passkey-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-passkey-meta strong {
  font-size: .86rem;
}

.auth-passkey-meta small {
  color: var(--auth-muted);
  font-size: .7rem;
}

.auth-passkey-actions {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.auth-passkey-actions label {
  display: grid;
  gap: 6px;
  color: #655f59;
  font-size: .72rem;
  font-weight: 800;
}

.auth-passkey-actions .auth-button {
  min-height: 46px;
  padding-inline: 14px;
}

.auth-qr {
  width: min(100%, 244px);
  margin: 12px auto;
  padding: 12px;
  border: 1px solid var(--auth-outline);
  border-radius: 22px;
  background: #fff;
}

.auth-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .auth-shell {
    padding-inline: 18px;
  }

  .auth-card {
    padding: 24px;
  }

  .auth-hero {
    padding-top: 36px;
  }
}

@media (max-width: 520px) {
  .auth-shell {
    width: calc(100% - 20px);
  }

  .auth-secure-chip {
    padding-inline: 8px;
    font-size: .62rem;
  }

  .auth-hero {
    padding-top: 20px;
  }

  .auth-card {
    padding: 17px;
    border-radius: 24px;
  }

  .auth-passkey-actions {
    grid-template-columns: 1fr 1fr;
  }

  .auth-passkey-actions label {
    grid-column: 1 / -1;
  }

  .auth-actions > .auth-button,
  .auth-actions > .auth-link-button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-button,
  .auth-link-button,
  .auth-details summary::after,
  .auth-field input,
  .passkey-label {
    transition: none !important;
  }
}


.auth-google-method {
  display: grid;
  gap: 10px;
}

.auth-google-method h2 {
  margin: 0;
  color: var(--auth-muted);
  font-size: .78rem;
  font-weight: 800;
}
