/* =========================================================
   HR Pro — Modern SaaS Authentication & Onboarding
   Supports Smooth Dark & Light Themes
========================================================= */

:root,
[data-theme="dark"] {
  --auth-bg: #090D1A;
  --auth-bg-ambient-1: rgba(37, 99, 235, 0.16);
  --auth-bg-ambient-2: rgba(16, 185, 129, 0.08);
  --auth-card-bg: rgba(17, 24, 48, 0.85);
  --auth-card-border: rgba(255, 255, 255, 0.09);
  --auth-text: #F8FAFC;
  --auth-text-muted: #94A3B8;
  --auth-input-bg: rgba(10, 15, 30, 0.7);
  --auth-input-border: rgba(255, 255, 255, 0.12);
  --auth-input-text: #F8FAFC;
  --auth-input-focus-border: #3B82F6;
  --auth-primary: #3B82F6;
  --auth-primary-hover: #2563EB;
  --auth-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --auth-box-bg: rgba(255, 255, 255, 0.035);
  --auth-box-border: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] {
  --auth-bg: #F3F6FC;
  --auth-bg-ambient-1: rgba(37, 99, 235, 0.1);
  --auth-bg-ambient-2: rgba(99, 102, 241, 0.08);
  --auth-card-bg: rgba(255, 255, 255, 0.95);
  --auth-card-border: rgba(226, 232, 240, 0.9);
  --auth-text: #0F172A;
  --auth-text-muted: #64748B;
  --auth-input-bg: #FFFFFF;
  --auth-input-border: #CBD5E1;
  --auth-input-text: #0F172A;
  --auth-input-focus-border: #2563EB;
  --auth-primary: #2563EB;
  --auth-primary-hover: #1D4ED8;
  --auth-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --auth-box-bg: #F8FAFC;
  --auth-box-border: #E2E8F0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--auth-bg);
  background-image: 
    radial-gradient(at 15% 15%, var(--auth-bg-ambient-1) 0px, transparent 50%),
    radial-gradient(at 85% 85%, var(--auth-bg-ambient-2) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--auth-text);
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

.auth-topbar {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-card-invite ~ .auth-topbar,
.auth-wrapper:has(.auth-card-invite) .auth-topbar {
  max-width: 620px;
}

.auth-company-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-muted);
}

.auth-company-label i {
  color: var(--auth-primary);
  font-size: 14px;
}

.auth-theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--auth-input-border);
  background: var(--auth-box-bg);
  color: var(--auth-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-theme-toggle:hover {
  background: var(--auth-input-bg);
  border-color: var(--auth-primary);
  transform: translateY(-1px);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-card-border);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.25s ease;
}

.auth-card-invite {
  max-width: 620px;
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--auth-primary), #6366F1);
  color: #ffffff;
  border-radius: 14px;
  font-size: 24px;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.4);
}

.auth-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--auth-text);
}

.auth-org-name {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-muted);
  letter-spacing: 0.2px;
}

.auth-welcome {
  text-align: center;
  margin-bottom: 24px;
}

.auth-welcome h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--auth-text);
}

.auth-welcome p {
  margin: 0;
  font-size: 14px;
  color: var(--auth-text-muted);
}

.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #EF4444;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon > i:first-child {
  position: absolute;
  left: 14px;
  color: var(--auth-text-muted);
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
}

.input-with-icon .form-control {
  padding-left: 42px;
}

.form-control {
  min-height: 46px;
  border-radius: 11px;
  border: 1px solid var(--auth-input-border);
  background: var(--auth-input-bg);
  color: var(--auth-input-text);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  background: var(--auth-input-bg);
  color: var(--auth-input-text);
  border-color: var(--auth-input-focus-border);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.form-control::placeholder {
  color: var(--auth-text-muted);
  opacity: 0.7;
}

.password-box {
  position: relative;
  width: 100%;
}

.toggle-eye-btn {
  position: absolute;
  right: 14px;
  color: var(--auth-text-muted);
  cursor: pointer;
  font-size: 16px;
  z-index: 3;
  padding: 4px;
  transition: color 0.15s ease;
}

.toggle-eye-btn:hover {
  color: var(--auth-text);
}

.auth-submit-btn {
  min-height: 46px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  background: var(--auth-primary);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-btn:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
}

.auth-footer small {
  font-size: 12px;
  color: var(--auth-text-muted);
}

/* Onboarding Employee Info Box */
.employee-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--auth-box-bg);
  border: 1px solid var(--auth-box-border);
  border-radius: 14px;
  padding: 16px;
  margin: 18px 0 24px;
}

.employee-box strong {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--auth-text-muted);
  font-weight: 700;
}

.employee-box p {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--auth-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Password Strength Indicator */
.strength-wrapper {
  background: var(--auth-box-bg);
  border: 1px solid var(--auth-box-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.strength {
  width: 100%;
  height: 6px;
  background: var(--auth-box-border);
  border-radius: 999px;
  overflow: hidden;
}

#strengthBar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

@media (max-width: 576px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .employee-box {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}