:root {
  --login-bg: #F3F4F6;
  --login-card: #FFFFFF;
  --login-card-soft: #F9FAFB;
  --login-accent: #003DA5;
  --login-accent-light: #0052CC;
  --login-text: #1F2937;
  --login-muted: #6B7280;
  --login-radius-xl: 12px;
  --login-shadow: 0 12px 30px rgba(0, 61, 165, 0.12);
}

body.page-login {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #e0e7ff 100%);
  color: var(--login-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.page-force-password {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 50%, #eff6ff 100%);
  color: var(--login-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-shell {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 388px;
  background: var(--login-card);
  border-radius: var(--login-radius-xl);
  padding: 28px 24px;
  border: 1px solid #e0e7ff;
  box-shadow: var(--login-shadow);
  position: relative;
}

.login-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--login-accent), transparent);
  opacity: 0.08;
  top: -30px;
  right: -30px;
  pointer-events: none;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-align: center;
}

.login-mark {
  width: 144px;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}

.login-eyebrow {
  font-size: 11px;
  color: var(--login-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.login-title-inline {
  font-weight: 800;
  color: var(--login-text);
  font-size: 18px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--login-muted);
  margin-bottom: 16px;
}

.login-notice {
  margin: 0 0 16px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #4b5563;
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
}

.login-label {
  display: block;
  font-size: 12px;
  color: var(--login-text);
  margin-bottom: 6px;
  margin-top: 10px;
  font-weight: 600;
}

.login-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: var(--login-card-soft);
  color: var(--login-text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--login-accent);
  background: var(--login-card);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-input::placeholder {
  color: #cbd5e1;
}

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

.login-hint,
.login-roles {
  font-size: 12px;
  color: var(--login-muted);
}

.login-roles {
  color: var(--login-accent);
  font-weight: 600;
}

.login-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-login-submit {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #003da5;
  background: #003da5;
  color: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}

.btn-login-submit:hover {
  background: #0052cc;
  border-color: #0052cc;
}

.btn-login-submit:active {
  background: #003a99;
  border-color: #003a99;
}

.login-divider {
  position: relative;
  margin: 18px 0 14px;
  text-align: center;
}

.login-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid #dbe3f0;
}

.login-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: var(--login-card);
  color: var(--login-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-login-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-login-microsoft:hover {
  border-color: #94a3b8;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.btn-login-microsoft.is-disabled,
.btn-login-microsoft:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
  color: #64748b;
  background: #f8fafc;
}

.login-provider-hint {
  margin: 10px 0 0;
  color: var(--login-muted);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}

.btn-login-back {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  background: var(--login-card-soft);
  color: var(--login-text);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-login-back:hover {
  background: white;
  border-color: var(--login-accent);
  color: var(--login-accent);
  box-shadow: 0 4px 12px rgba(0, 61, 165, 0.15);
  transform: translateY(-1px);
}

.login-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-foot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
}

.page-login .login-welcome-title,
.page-force-password .login-welcome-title {
  font-size: 24px;
  margin-bottom: 6px;
}

.page-login .login-separator,
.page-force-password .login-separator {
  width: 52px;
  margin: 16px auto;
}

.login-foot-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.login-foot strong {
  color: var(--login-accent);
  font-weight: 700;
}

.error-box {
  background: #3b0b0b;
  color: #fee2e2;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid #7f1d1d;
}

.login-alert-panel {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #f1aeb5;
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  box-shadow: 0 12px 30px rgba(248, 113, 113, 0.2);
}

.login-alert-locked {
  border-color: #c53030;
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.2);
}

.login-alert-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #991b1b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.login-alert-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-alert-title {
  margin: 0;
  font-weight: 800;
  color: #991b1b;
  font-size: 16px;
}

.login-alert-text {
  margin: 0;
  color: #7f1d1d;
  font-size: 14px;
}

.login-card-header h1 {
  margin: 0;
}

.login-helper {
  color: var(--login-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.login-form label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--login-text);
}

.login-form input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: var(--login-card-soft);
  color: var(--login-text);
  font-size: 14px;
}

.login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--login-accent);
  background: var(--login-card);
}

.login-button {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.login-modal {
  position: relative;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.login-modal-content h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.login-modal.is-visible {
  display: block;
}
