/* Apitzsch Planer – Login Design (HR Suite v2 Style) */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

body.login-body {
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 60px 20px 20px;
  margin: 0;
}

.login-wrap {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 36px 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  width: 60px;
  height: 60px;
  background: #3b82f6;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: white;
  font-size: 32px;
}

.login-icon svg {
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-title span {
  color: #6b7280;
}

.login-sub {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
  margin-top: 2px;
}

.login-box {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-tabs {
  display: flex;
  gap: 32px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
  padding-bottom: 0;
}

.login-tab {
  flex: 0;
  padding: 0 0 14px 0;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.login-tab.active {
  color: #1f2937;
  border-bottom-color: #3b82f6;
}

.login-tab:hover:not(.active) {
  color: #6b7280;
}

.msg-box {
  display: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid;
}

.msg-box.show {
  display: flex;
}

.msg-box.err {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.msg-box.ok {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fg label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.fg input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.fg input::placeholder {
  color: #d1d5db;
}

.fg input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pw-wrap {
  position: relative;
  display: flex;
}

.pw-wrap input {
  flex: 1;
  padding-right: 40px;
}

.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.pw-eye:hover {
  color: #6b7280;
}

.pw-eye svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.pw-bar {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.pw-bar > div {
  height: 100%;
  width: 0%;
  transition: all 0.2s;
}

.btn-primary {
  padding: 11px 16px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Demo Accounts Section */
.demo-accounts {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.demo-accounts-title {
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.demo-accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.demo-account-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.demo-account-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.demo-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.demo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.demo-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

.demo-email {
  font-size: 11px;
  color: #9ca3af;
  word-break: break-all;
  line-height: 1.3;
}

.demo-role {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 3px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.demo-pw {
  font-size: 10px;
  color: #6b7280;
  background: #f9fafb;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  user-select: all;
  margin-top: 2px;
}

.theme-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  color: #6b7280;
  padding: 0;
  z-index: 1000;
}

.theme-btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #4b5563;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Dark Mode */
body.login-body.light {
  background: #0f172a;
}

body.login-body.light .login-card,
body.login-body.light .demo-accounts {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.login-body.light .login-title {
  color: #f1f5f9;
}

body.login-body.light .login-sub,
body.login-body.light .demo-accounts-title {
  color: #94a3b8;
}

body.login-body.light .login-tab {
  color: #64748b;
  border-bottom-color: #475569;
}

body.login-body.light .login-tabs {
  border-bottom-color: #334155;
}

body.login-body.light .login-tab.active {
  color: #e0e7ff;
  border-bottom-color: #60a5fa;
}

body.login-body.light .fg label {
  color: #cbd5e1;
}

body.login-body.light .fg input {
  background: #334155;
  color: #f1f5f9;
  border-color: #475569;
}

body.login-body.light .fg input::placeholder {
  color: #64748b;
}

body.login-body.light .fg input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

body.login-body.light .msg-box.err {
  background: rgba(127, 29, 29, 0.15);
  color: #f87171;
  border-color: #7f1d1d;
}

body.login-body.light .msg-box.ok {
  background: rgba(20, 83, 45, 0.15);
  color: #86efac;
  border-color: #166534;
}

body.login-body.light .demo-account-card {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

body.login-body.light .demo-account-card:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
}

body.login-body.light .demo-name {
  color: #f1f5f9;
}

body.login-body.light .demo-email {
  color: #94a3b8;
}

body.login-body.light .demo-role {
  background: #475569;
  color: #cbd5e1;
}

body.login-body.light .demo-pw {
  background: #475569;
  color: #94a3b8;
}

body.login-body.light .pw-bar {
  background: #475569;
}

body.login-body.light .btn-primary {
  background: #3b82f6;
}

body.login-body.light .btn-primary:hover:not(:disabled) {
  background: #60a5fa;
}

body.login-body.light .theme-btn {
  background: #334155;
  border-color: #475569;
  color: #cbd5e1;
}

body.login-body.light .theme-btn:hover {
  border-color: #64748b;
  background: #475569;
  color: #e0e7ff;
}

/* Responsive */
@media (max-width: 600px) {
  body.login-body {
    padding: 50px 16px 16px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .demo-accounts-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .login-wrap {
    gap: 20px;
  }

  .login-icon {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }

  .login-title {
    font-size: 22px;
  }

  .demo-accounts {
    padding: 18px;
  }
}
