/**
 * KCA Client Registry - Notion-style login.
 * Tokens aligned to DESIGN.md semantic variables.
 */

.login-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #000000;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: transparent;
}

.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
}

.login-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

.login-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-topbar-brand {
  display: inline-flex;
  align-items: center;
  color: #000000;
  text-decoration: none;
}

.login-topbar-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.12px;
  line-height: 1.35;
}

.login-topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.login-topbar-status {
  font-size: 15px;
  color: #000000;
  letter-spacing: 0.08px;
}

.login-topbar-action {
  font-size: 15px;
  color: #000000;
  text-decoration: none;
  letter-spacing: 0.08px;
}

.login-topbar-action:hover {
  color: #222222;
  text-decoration: underline;
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 12px;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--theme_space-12);
}

.login-brand {
  text-align: center;
  margin-bottom: var(--theme_space-16);
}

.brand-mark {
  width: 84px;
  height: 84px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
}

.brand-title {
  margin: 0;
  font-family: var(--theme_font-primary);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.08px;
  color: #000000;
}

.brand-subtitle {
  margin: 8px auto 0;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.12px;
  color: #000000;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--theme_border-default);
  border-radius: var(--theme_radius-card);
  box-shadow: var(--theme_shadow-blue);
  padding: var(--theme_space-16);
  backdrop-filter: blur(2px);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--theme_space-12);
}

.form-group {
  margin: 0;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-label {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.08px;
  color: #000000;
}

.login-link {
  font-size: 13px;
  letter-spacing: 0.08px;
  color: #000000;
  text-decoration: none;
}

.login-link:hover {
  color: #222222;
  text-decoration: underline;
}

.input-group {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

.login-form .form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--theme_border-default) !important;
  border-radius: var(--theme_radius-button);
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.08px;
  background: var(--theme_surface-primary);
  color: var(--theme_text-primary);
}

.login-form .form-control::placeholder {
  color: rgba(4, 14, 32, 0.5);
}

.login-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08px;
  color: #000000;
  cursor: pointer;
}

.login-password-toggle:hover {
  color: #222222;
}

.login-password-toggle:focus-visible {
  outline: 2px solid rgba(27, 97, 201, 0.26);
  outline-offset: 2px;
  border-radius: 6px;
}

.security-notice {
  border-radius: 12px;
  border: 1px solid var(--theme_border-default);
  background: var(--theme_surface-muted);
  color: #000000;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.08px;
  padding: 10px 12px;
}

.login-feedback {
  border: 1px solid #efc8c6;
  border-radius: 12px;
  background: #fff6f5;
  color: #8f2020;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.08px;
  padding: 10px 12px;
}

.login-form .btn.btn-primary {
  width: 100%;
  min-height: 44px;
  margin-top: var(--theme_space-12);
  border-radius: var(--theme_radius-button);
  background: var(--theme_button-bg-primary) !important;
  border-color: var(--theme_button-bg-primary) !important;
  color: var(--theme_button-text-primary) !important;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08px;
  line-height: 1.3;
}

.auth-state-card {
  text-align: center;
}

.auth-state-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.1px;
  color: var(--theme_text-primary);
}

.auth-state-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.08px;
  color: #000000;
}

.auth-state-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.login-bottom {
  padding: 12px 20px 24px;
  position: relative;
  z-index: 1;
}

.login-bottom-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.login-bottom-links {
  display: inline-flex;
  gap: 14px;
}

.login-bottom-link,
.login-bottom-copy {
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0.08px;
  color: #000000;
}

.login-bottom-link {
  text-decoration: none;
}

.login-bottom-link:hover {
  color: #222222;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .login-topbar-inner {
    padding: 10px 14px;
  }

  .login-topbar-status {
    display: none;
  }

  .login-main {
    padding: 16px 14px 8px;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
  }

  .brand-title {
    font-size: 26px;
  }

  .brand-subtitle {
    font-size: 14px;
  }

  .login-card {
    padding: 18px;
  }

  .auth-state-actions {
    flex-direction: column;
  }
}
