:root {
  --blue-50: #eef2ff;
  --blue-100: #e0e7ff;
  --blue-200: #c7d2fe;
  --blue-300: #a5b4fc;
  --blue-400: #818cf8;
  --blue-500: #6366f1;
  --blue-600: #4f46e5;
  --blue-700: #4338ca;
  --blue-800: #3730a3;
  --blue-900: #312e81;
  --blue-950: #1e1b4b;
  --dark-blue: #0f172a;
  --dark-blue-light: #1e293b;
  --dark-blue-accent: #334155;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

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

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

/* ===== SPLIT SCREEN LAYOUT ===== */
.split-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ===== LEFT HERO SECTION ===== */
.hero-section {
  flex: 1.1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    160deg,
    var(--dark-blue) 0%,
    #0a1628 40%,
    var(--dark-blue-light) 100%
  );
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 20% 80%,
      rgba(51, 65, 85, 0.4) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 50% at 80% 20%,
      rgba(30, 41, 59, 0.35) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Animated mesh gradient overlay */
.hero-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background:
    radial-gradient(
      circle at 30% 70%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(79, 70, 229, 0.1) 0%,
      transparent 50%
    );
  animation: meshFloat 12s ease-in-out infinite;
}

@keyframes meshFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(2%, -2%) scale(1.02);
  }
  66% {
    transform: translate(-1%, 1%) scale(0.98);
  }
}

/* Floating particles */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) scale(1.5);
    opacity: 0;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem;
  max-width: 520px;
}

.hero-logo-wrapper {
  position: relative;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-wrapper::before {
  content: "";
  position: absolute;
  inset: -30px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.12) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.hero-logo {
  width: 200px;
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-logo:hover {
  transform: scale(1.05);
}

.hero-title {
  font-family: "Playfair Display", serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  justify-content: center;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
}

/* ===== RIGHT LOGIN SECTION ===== */
.login-section {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 50% 40% at 90% 10%,
      rgba(226, 232, 240, 0.4) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 50% at 10% 90%,
      rgba(241, 245, 249, 0.35) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* Glass Card */
.glass-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  box-shadow:
    var(--glass-shadow),
    0 1px 3px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: cardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.card-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.card-header p {
  font-size: 0.9rem;
  color: var(--dark-blue-accent);
  font-weight: 400;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 1.4rem;
  position: relative;
}

.floating-label-group {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1rem 1rem 1rem 2.8rem;
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  color: var(--dark-blue);
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--blue-200);
  border-radius: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-input::placeholder {
  color: var(--blue-400);
  font-weight: 400;
}

.form-input:hover {
  border-color: var(--blue-300);
  background: rgba(255, 255, 255, 0.95);
}

.form-input:focus {
  border-color: var(--blue-600);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(79, 70, 229, 0.1),
    0 1px 3px rgba(15, 23, 42, 0.08);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
  animation: shake 0.4s ease-in-out;
}

.form-input.success {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-400);
  transition: all 0.3s ease;
  pointer-events: none;
}

.form-input:focus ~ .input-icon {
  color: var(--blue-700);
}

.form-input.error ~ .input-icon {
  color: #ef4444;
}

.form-input.success ~ .input-icon {
  color: #10b981;
}

.input-status {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-input.error ~ .input-status.error-icon,
.form-input.success ~ .input-status.success-icon {
  opacity: 1;
}

.validation-msg {
  font-size: 0.78rem;
  margin-top: 0.4rem;
  margin-left: 0.2rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.validation-msg.show {
  opacity: 1;
  transform: translateY(0);
}

.validation-msg.error {
  color: #ef4444;
}

.validation-msg.success {
  color: #10b981;
}

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue-400);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--blue-700);
}

.password-toggle:focus {
  outline: none;
  color: var(--blue-700);
}

/* Remember Me */
.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  font-size: 0.85rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  color: var(--dark-blue-accent);
  font-weight: 500;
  user-select: none;
}

.remember-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--blue-300);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remember-checkbox:checked {
  background: var(--dark-blue);
  border-color: var(--dark-blue);
}

.remember-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.forgot-link {
  color: var(--blue-700);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.forgot-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--blue-700);
  transition: width 0.3s ease;
}

.forgot-link:hover::after {
  width: 100%;
}

.forgot-link:hover {
  color: var(--dark-blue);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--dark-blue) 0%,
    var(--dark-blue-light) 100%
  );
  color: #ffffff;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.35),
    0 1px 3px rgba(15, 23, 42, 0.2);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(15, 23, 42, 0.4),
    0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-primary:hover::before {
  opacity: 1;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--dark-blue-accent);
  border: 1.5px solid var(--blue-200);
  margin-top: 0.8rem;
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--dark-blue);
}

/* Loading Spinner */
.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

.btn-primary.loading .spinner {
  display: inline-block;
}

.btn-primary.loading .btn-text {
  display: none;
}

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

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.8rem 0;
  gap: 1rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-200), transparent);
}

.divider-text {
  font-size: 0.75rem;
  color: var(--blue-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Error/Success Messages */
.alert {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  display: none;
  align-items: center;
  gap: 0.6rem;
  animation: alertSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert.show {
  display: flex;
}

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Role Badge (shown after login) */
.role-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
  animation: badgePop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-badge.show {
  display: inline-flex;
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.role-admin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fbbf24;
}

.role-director {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #60a5fa;
}

.role-staff {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
  color: #6b21a8;
  border: 1px solid #c084fc;
}

/* Footer */
.card-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(226, 232, 240, 0.4);
}

.card-footer p {
  font-size: 0.8rem;
  color: var(--blue-400);
  font-weight: 400;
}

.card-footer .company-name {
  color: var(--dark-blue);
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .split-container {
    flex-direction: column;
  }

  .hero-section {
    flex: none;
    min-height: 35vh;
    padding: 2rem 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-logo {
    width: 140px;
  }

  .hero-stats {
    gap: 1.5rem;
    margin-top: 1.5rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .login-section {
    flex: none;
    padding: 1.5rem;
  }

  .glass-card {
    padding: 2rem 1.5rem;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .card-header h2 {
    font-size: 1.3rem;
  }

  .remember-row {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }
}
