:root {
  color-scheme: dark;
  --auth-bg: #0f0f0f;
  --auth-bg-soft: #171717;
  --auth-line: #ff2b2b;
  --auth-line-soft: rgba(255, 43, 43, 0.25);
  --auth-text: #f5f5f5;
  --auth-muted: #b8b8b8;
  --auth-heading-font: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding-top: 82px;
  background: radial-gradient(circle at 10% 0%, #290000 0%, var(--auth-bg) 45%);
  color: var(--auth-text);
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

a { color: inherit; }

.auth-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  width: 100%;
  background: #1b1012;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  backdrop-filter: blur(10px);
}

.auth-header__inner {
  position: relative;
  width: 100%;
  height: 60px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-logo,
.auth-header__login {
  text-decoration: none;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-logo__text {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--auth-text);
  font-family: "Yomogi", "Noto Sans JP", sans-serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-header__login {
  padding: 0 0 2px;
  border-bottom: 2px solid transparent;
  color: #d1d5db;
  font-family: var(--auth-heading-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-header__login:hover {
  color: #fff;
}

.auth-main {
  width: min(1120px, 92%);
  margin: 15px auto 70px;
}

.auth-shell {
  min-height: calc(100vh - 254px);
  display: grid;
  align-content: center;
}

.auth-card {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 28px 34px 32px;
  background: linear-gradient(180deg, #1a1a1a 0%, #131313 100%);
  border: 1px solid var(--auth-line-soft);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-title {
  margin: 0 0 22px;
  color: #ead7b3;
  font-family: var(--auth-heading-font);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-field {
  margin: 0;
}

.auth-field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-input-wrap {
  min-height: 44px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  background: rgba(13, 17, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.auth-input-wrap:focus-within {
  border-color: rgba(255, 120, 120, 0.72);
  box-shadow: 0 0 0 2px rgba(255, 43, 43, 0.18);
}

.auth-input-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d9e3ec;
  opacity: 0.78;
}

.auth-input-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.auth-input-wrap input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 6px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--auth-text);
  box-shadow: none;
  font: inherit;
}

.auth-input-wrap input::placeholder { color: #a7b0ba; }

.auth-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.auth-options {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.auth-check {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d7dde6;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.auth-check input {
  width: auto;
  margin: 0;
  accent-color: #b12b4b;
}

.auth-help-link {
  color: #ead7b3;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.auth-help-link:hover {
  color: #fff0f3;
  text-decoration: underline;
}

.auth-submit {
  width: auto;
  min-width: 164px;
  min-height: 41px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(177, 43, 75, 0.55);
  border-radius: 10px;
  background: rgba(177, 43, 75, 0.18);
  color: #fff0f3;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.auth-submit:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.auth-submit:focus-visible,
a:focus-visible {
  outline: 2px solid #ff7878;
  outline-offset: 3px;
}

.auth-message {
  max-height: 240px;
  margin-bottom: 12px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid;
  border-radius: 10px;
  opacity: 1;
  transform: translateY(0);
  white-space: pre-line;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    max-height 0.45s ease,
    margin-bottom 0.45s ease,
    padding 0.45s ease,
    border-width 0.45s ease;
}

.auth-message--error {
  background: rgba(180, 35, 35, 0.2);
  border-color: #c53f3f;
}

.auth-message--info {
  background: rgba(41, 146, 73, 0.2);
  border-color: #2f9a50;
}

.auth-message.is-dismissing {
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.auth-card input[type="email"]:-webkit-autofill,
.auth-card input[type="email"]:-webkit-autofill:hover,
.auth-card input[type="email"]:-webkit-autofill:focus,
.auth-card input[type="password"]:-webkit-autofill,
.auth-card input[type="password"]:-webkit-autofill:hover,
.auth-card input[type="password"]:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-text);
  box-shadow: 0 0 0 1000px #0d0d0d inset;
  -webkit-box-shadow: 0 0 0 1000px #0d0d0d inset;
  transition: background-color 9999s ease-in-out 0s;
  caret-color: var(--auth-text);
}

@media (max-width: 640px) {
  body { padding-top: 72px; }
  .auth-header__inner { height: 60px; padding: 0 18px; }
  .auth-logo__text { padding: 0; font-size: 28px; }
  .auth-header__login { font-size: 14px; }
  .auth-main { width: min(100% - 24px, 1120px); margin-top: 8px; }
  .auth-shell { min-height: calc(100vh - 180px); }
  .auth-card { padding: 24px 18px 26px; }
  .auth-title { font-size: 30px; }
  .auth-form-footer { align-items: stretch; flex-direction: column; }
  .auth-options { gap: 10px; }
  .auth-submit { width: 100%; }
}
