:root {
  --auth-shell-bg: linear-gradient(180deg, #0f172a 0%, #111827 45%, #1f2937 100%);
  --auth-card-shadow: 0 20px 44px rgba(15, 23, 42, 0.28);
  --auth-border: rgba(15, 23, 42, 0.08);
  --auth-text-muted: #64748b;
  --auth-brand-accent: #00ffcc;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  background: var(--auth-shell-bg);
  font-family: "Segoe UI", "Meiryo", sans-serif;
  color: #0f172a;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-x: clip;
}

.auth-card {
  width: min(100%, 28rem);
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--auth-card-shadow);
}

.auth-card--login {
  max-width: 28rem;
}

.auth-card--profiles {
  max-width: 38rem;
}

.auth-card--password {
  max-width: 30rem;
}

.auth-card-header {
  padding: 1.5rem 1.75rem;
  color: #fff;
}

.auth-card-header--dark {
  background: linear-gradient(135deg, #05263a 0%, #0b3550 100%);
}

.auth-card-header--slate {
  background: #1e1e2d;
}

.auth-card-header--blue {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.auth-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.auth-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.auth-brand-mark {
  width: 5.5rem;
  height: 5.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0.9rem;
}

.auth-brand-copy {
  min-width: 0;
}

.auth-brand-title {
  margin: 0 0 0.15rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--auth-brand-accent);
  line-height: 1.15;
}

.auth-brand-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.auth-section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.auth-section-subtitle {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.auth-form-note {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--auth-text-muted);
}

.auth-profile-list {
  max-height: 20rem;
  overflow-y: auto;
  padding: 1rem;
}

.auth-profile-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #edf2f9;
  border-radius: 0.8rem;
  margin-bottom: 0.5rem;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.auth-profile-item:hover {
  background-color: #f8f9fc;
  border-color: var(--auth-brand-accent);
  transform: translateY(-2px);
}

.auth-profile-item-copy {
  min-width: 0;
}

.auth-profile-item-name {
  display: block;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.auth-profile-item-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--auth-text-muted);
}

.auth-section-footer {
  padding: 1.5rem;
  background: #f8f9fc;
  border-top: 1px solid #edf2f9;
}

.auth-footer-link {
  font-size: 0.875rem;
  text-decoration: none;
}

.auth-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.auth-inline-form .form-control,
.auth-inline-form .btn {
  min-height: 2.75rem;
}

@media (max-width: 767.98px) {
  .auth-shell {
    align-items: stretch;
    padding: 1rem;
  }

  .auth-card {
    width: 100%;
    margin: auto 0;
    border-radius: 0.9rem;
  }

  .auth-card-header,
  .auth-card-body,
  .auth-section-footer {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .auth-card-header {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .auth-brand-lockup {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .auth-brand-copy {
    text-align: center;
  }

  .auth-brand-title {
    font-size: 1.45rem;
  }

  .auth-brand-mark {
    width: 4.75rem;
    height: 4.75rem;
  }

  .auth-profile-list {
    padding: 0.85rem;
    max-height: none;
  }

  .auth-profile-item {
    padding: 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .auth-shell {
    padding: 0.75rem;
  }

  .auth-card-header,
  .auth-card-body,
  .auth-section-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .auth-card-body {
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
  }

  .auth-inline-form {
    grid-template-columns: 1fr;
  }

  .auth-inline-form .btn {
    width: 100%;
  }

  .auth-profile-item {
    align-items: flex-start;
  }
}
