* {
  box-sizing: border-box;
}

:root {
  --ink: #142033;
  --muted: #66758a;
  --line: rgba(72, 91, 116, 0.16);
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --paper: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 70px rgba(26, 43, 72, 0.14);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(219, 234, 254, 0.7), transparent 30%),
    radial-gradient(circle at 82% 20%, rgba(239, 246, 255, 0.86), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 54%, #f3f8ff 100%);
  font-family: "Kiwi Maru", "Noto Serif JP", serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 170ms ease, transform 170ms ease;
}

body.page-ready .login-page {
  opacity: 1;
  transform: translateY(0);
}

.landing-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  align-items: center;
  gap: clamp(34px, 7vw, 88px);
}

.brand-panel {
  position: relative;
  min-height: 560px;
  padding: clamp(22px, 3vw, 34px) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-logo {
  position: absolute;
  top: 0;
  left: 0;
  color: #18345b;
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-kicker {
  margin: 0 0 18px;
  color: #2c5aa0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-panel h1 {
  max-width: 620px;
  margin: 0;
  color: #111827;
  font-size: clamp(2.55rem, 5.4vw, 5rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 540px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 2;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary-action,
.secondary-action,
.google-login-button,
.email-submit-button,
.back-button {
  border: 0;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 24px;
}

.primary-action {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.24);
}

.secondary-action {
  color: #22344c;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(31, 47, 74, 0.08);
}

.primary-action:hover,
.secondary-action:hover,
.google-login-button:hover,
.email-submit-button:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.primary-action:hover,
.email-submit-button:hover {
  background: var(--blue-dark);
}

.visual-panel {
  position: relative;
  min-height: 620px;
  isolation: isolate;
}

.visual-panel::before {
  content: "";
  position: absolute;
  inset: 48px 36px 24px 22px;
  z-index: -1;
  border-radius: 34px;
  background: rgba(219, 234, 254, 0.6);
  filter: blur(28px);
}

.work-card {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 70px rgba(31, 47, 74, 0.18);
}

.card-label {
  color: #52709b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-card h2 {
  margin: 10px 0 0;
  font-size: 1.08rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.card-novel {
  top: 50px;
  left: 12px;
  width: 260px;
  padding: 26px;
}

.card-novel p {
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.9;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.tag-cloud span {
  padding: 7px 11px;
  border-radius: 999px;
  color: #2d4e7a;
  background: rgba(219, 234, 254, 0.82);
  font-size: 0.78rem;
}

.card-illust {
  top: 0;
  right: 28px;
  width: 290px;
  padding: 14px 14px 22px;
}

.image-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-bottom: 16px;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(59, 130, 246, 0.78), rgba(180, 210, 255, 0.28)),
    linear-gradient(35deg, #f9fbff 0%, #dde9ff 48%, #fff 100%);
}

.image-preview span {
  position: absolute;
  left: 22%;
  top: 18%;
  width: 56%;
  height: 66%;
  border-radius: 48% 52% 42% 58%;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(191, 219, 254, 0.66));
  box-shadow: 0 18px 42px rgba(29, 78, 216, 0.22);
}

.card-manga {
  right: 90px;
  bottom: 32px;
  width: 300px;
  padding: 16px 16px 22px;
}

.manga-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.manga-grid span {
  min-height: 118px;
  border-radius: 16px;
  background: linear-gradient(160deg, #fff, #eaf2ff);
  border: 1px solid rgba(46, 70, 104, 0.08);
}

.manga-grid span:nth-child(2),
.manga-grid span:nth-child(3) {
  background: linear-gradient(160deg, #dbeafe, #fff);
}

.card-tags {
  left: 46px;
  bottom: 84px;
  width: 240px;
  padding: 24px;
}

.tag-cloud {
  margin-top: 16px;
}

.auth-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(244, 248, 255, 0.66);
  backdrop-filter: blur(18px);
}

.auth-panel.hidden {
  display: none;
}

.auth-card {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.back-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #31435b;
  background: #eef5ff;
}

.auth-card h2 {
  margin: 22px 0 8px;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.auth-panel-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.google-login-button,
.email-submit-button {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
}

.google-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #1f2a37;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(31, 47, 74, 0.06);
}

.google-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4285f4;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #7a8798;
  font-size: 0.86rem;
}

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

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

.field {
  display: grid;
  gap: 8px;
  color: #28384e;
  font-size: 0.92rem;
}

.field.hidden {
  display: none;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input:focus {
  border-color: rgba(37, 99, 235, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.email-submit-button {
  margin-top: 4px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

#agreement-text.agreement-text {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 12px 4px 0 !important;
  color: #6b7280 !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
  text-align: center !important;
}

#agreement-text.agreement-text a {
  color: #1f2937 !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.primary-action:disabled,
.secondary-action:disabled,
.google-login-button:disabled,
.email-submit-button:disabled,
.back-button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.login-message {
  min-height: 1.55em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.login-message.error {
  color: #b3261e;
}

.login-contact-panel {
  width: 100%;
  margin: 10px auto 0;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.login-contact-toggle {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #1f2937;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 150ms ease;
}

.login-contact-toggle:hover {
  color: #2563eb;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.login-contact-form-wrap {
  width: 100%;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 30px rgba(26, 43, 72, 0.08);
  backdrop-filter: blur(14px);
}

.login-contact-form-wrap.hidden {
  display: none;
}

.login-contact-form-wrap h2 {
  margin: 0 0 14px;
  color: #18345b;
  font-size: 1rem;
  line-height: 1.45;
}

.login-contact-form {
  display: grid;
  gap: 12px;
}

.contact-field {
  display: grid;
  gap: 7px;
  color: #28384e;
  font-size: 0.88rem;
}

.contact-field input,
.contact-field select,
.contact-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.contact-field input,
.contact-field select {
  min-height: 42px;
  padding: 0 12px;
}

.contact-field textarea {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  border-color: rgba(37, 99, 235, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-contact-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.login-contact-message[data-type="error"] {
  color: #b3261e;
}

.login-contact-message[data-type="success"] {
  color: #1f6b54;
}

.login-contact-actions {
  display: flex;
  justify-content: flex-end;
}

.login-contact-submit-btn {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.login-contact-submit-btn:hover:not(:disabled) {
  background: var(--blue-dark);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
  transform: translateY(-1px);
}

.login-contact-submit-btn:disabled,
.login-contact-form input:disabled,
.login-contact-form select:disabled,
.login-contact-form textarea:disabled {
  cursor: wait;
  opacity: 0.66;
}

@media (prefers-reduced-motion: reduce) {
  .login-page,
  .primary-action,
  .secondary-action,
  .google-login-button,
  .email-submit-button,
  .back-button,
  .login-contact-toggle,
  .login-contact-submit-btn,
  .work-card,
  .field input {
    transition: none;
    transform: none;
  }
}

@media (max-width: 900px) {
  .landing-shell {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .brand-panel {
    min-height: auto;
    padding-top: 64px;
  }

  .visual-panel {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 26px 18px 44px;
    place-items: start center;
  }

  .brand-panel {
    padding-top: 58px;
  }

  .landing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .visual-panel {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .visual-panel::before {
    inset: 40px 18px;
  }

  .work-card {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
  }

  .card-illust {
    max-width: 360px;
    justify-self: end;
  }

  .card-novel,
  .card-manga,
  .card-tags {
    max-width: 360px;
  }

  .card-manga,
  .card-tags {
    justify-self: start;
  }

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

  .login-contact-panel {
    width: 100%;
    margin-top: 10px;
  }

  .login-contact-form-wrap {
    padding: 14px;
    border-radius: 16px;
  }

  .contact-field input,
  .contact-field select,
  .contact-field textarea {
    font-size: 16px;
  }

  .login-contact-actions {
    justify-content: stretch;
  }

  .login-contact-submit-btn {
    width: 100%;
    min-height: 46px;
  }
}
