:root {
  color-scheme: light;
  --background: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --text: #172033;
  --muted: #6c7489;
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #eef2ff;
  --success: #047857;
  --danger: #c2414b;
  --border: rgba(23, 32, 51, 0.11);
  --shadow: 0 24px 70px rgba(59, 69, 105, 0.15);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgba(99, 102, 241, 0.17), transparent 28rem),
    radial-gradient(circle at 92% 75%, rgba(14, 165, 233, 0.12), transparent 25rem),
    var(--background);
  font-family:
    Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.container {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #0284c7);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
  width: min(1060px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0;
  align-items: center;
  gap: 70px;
}

.auth-intro {
  max-width: 570px;
}

.auth-intro h1 {
  margin: 30px 0 20px;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(100deg, #4f46e5 10%, #0284c7 85%);
  background-clip: text;
}

.auth-intro p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #3f485d;
  font-size: 0.93rem;
  font-weight: 650;
}

.check-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 0.76rem;
}

.auth-card {
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.035em;
}

.card-description {
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-group + .form-group {
  margin-top: 18px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.86rem;
  font-weight: 750;
}

.form-input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-input::placeholder {
  color: #a0a7b8;
}

.form-input:focus {
  border-color: rgba(79, 70, 229, 0.65);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.11);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 24px;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #5b54eb, #4338ca);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.25);
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-solid);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(61, 71, 105, 0.13);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.form-status {
  min-height: 25px;
  margin: 18px 0 0;
  font-size: 0.88rem;
  text-align: center;
}

.form-status[data-state="error"] {
  color: var(--danger);
}

.form-status[data-state="success"] {
  color: var(--success);
}

.learning-note {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(245, 247, 251, 0.78);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-main {
  padding: 82px 0 110px;
}

.dashboard-main[hidden] {
  display: none;
}

.welcome-panel {
  position: relative;
  overflow: hidden;
  padding: 54px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.welcome-panel::after {
  position: absolute;
  top: -90px;
  right: -60px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.3), rgba(56, 189, 248, 0.18));
  content: "";
}

.welcome-panel h1 {
  position: relative;
  z-index: 1;
  margin: 8px 0 10px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.welcome-panel p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.dashboard-card {
  min-height: 160px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 800;
}

.dashboard-card h2 {
  margin: 18px 0 5px;
  font-size: 1rem;
}

.dashboard-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  padding: 30px;
  place-items: center;
  text-align: center;
}

.loading-content {
  display: grid;
  justify-items: center;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(79, 70, 229, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-title {
  margin: 20px 0 4px;
  font-size: 1.05rem;
}

.loading-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 750;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 840px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(520px, calc(100% - 32px));
    gap: 36px;
    padding: 34px 0 54px;
  }

  .auth-intro h1 {
    margin-top: 24px;
    font-size: clamp(2.5rem, 11vw, 3.8rem);
  }

  .feature-list {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 28px, 1080px);
  }

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

  .auth-intro h1 {
    font-size: 2.55rem;
  }

  .welcome-panel {
    padding: 34px 24px;
  }

  .dashboard-main {
    padding: 46px 0 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
