/* ===================================
   Global Reset & Variables
   =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Premium 3D Color Palette */
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);

  --accent: #0891b2;
  --accent-light: #06b6d4;
  --accent-gold: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);

  /* Background Colors - Rich & Layered */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-dark: #0f172a;
  --bg-dark-secondary: #1e293b;
  --bg-accent: #dbeafe;

  /* Surface Colors for 3D Effect */
  --surface-raised: #ffffff;
  --surface-base: #f8fafc;
  --surface-sunken: #e2e8f0;

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-on-dark: #f1f5f9;
  --text-on-primary: #ffffff;

  /* 3D Shadows - Multi-layer for depth */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* Colored Shadows for Premium Feel */
  --shadow-primary:
    0 10px 25px -5px rgba(30, 64, 175, 0.3),
    0 5px 10px -5px rgba(30, 64, 175, 0.2);
  --shadow-accent:
    0 10px 25px -5px rgba(8, 145, 178, 0.3),
    0 5px 10px -5px rgba(8, 145, 178, 0.2);
  --shadow-gold:
    0 10px 25px -5px rgba(245, 158, 11, 0.3),
    0 5px 10px -5px rgba(245, 158, 11, 0.2);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===================================
   Base Styles
   =================================== */

body {
  font-family:
    "Cairo",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 50%, #e0f2fe 100%);
  color: var(--text-primary);
  overflow: hidden;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.1) 0%,
    transparent 70%
  );
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(8, 145, 178, 0.08) 0%,
    transparent 70%
  );
  animation: float 25s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(5deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(-5deg);
  }
}

/* ===================================
   Background Elements
   =================================== */

.background-gradient {
  display: none;
}

.background-pattern {
  display: none;
}

.floating-shapes {
  display: none;
}

.shape {
  display: none;
}

/* ===================================
   Container
   =================================== */

.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: stretch;
  gap: var(--spacing-2xl);
  padding: var(--spacing-xl);
  min-height: 100vh;
  animation: fadeInUp 0.8s ease;
}

.left-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  position: relative;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Header Section
   =================================== */

.header-section {
  text-align: center;
  animation: fadeIn 1s ease;
  width: 100%;
}

.logo-container {
  display: inline-block;
  margin-bottom: var(--spacing-lg);
}

.logo-circle {
  width: 140px;
  height: 140px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 40px rgba(59, 130, 246, 0.2);
  position: relative;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 3px solid rgba(59, 130, 246, 0.3);
}

.logo-circle::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 3px;
  background: var(--primary-gradient);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  animation:
    pulse 3s ease-in-out infinite,
    rotate 10s linear infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.logo-circle:hover {
  box-shadow:
    var(--shadow-2xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 60px rgba(59, 130, 246, 0.4);
  transform: translateY(-8px) scale(1.05);
}

.logo-circle svg {
  width: 40px;
  height: 40px;
  color: var(--text-primary);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}
.gov-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.main-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  letter-spacing: -0.5px;
  position: relative;
  display: inline-block;
}

.main-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.sub-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-gold),
    transparent
  );
  margin: var(--spacing-lg) auto;
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  }
  to {
    box-shadow:
      0 0 30px rgba(245, 158, 11, 0.8),
      0 0 40px rgba(245, 158, 11, 0.4);
  }
}

.system-name {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

/* ===================================
   Login Card
   =================================== */

.login-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 250, 252, 0.9) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow:
    var(--shadow-2xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 60px rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: visible;
  animation: slideIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
  width: 100%;
  max-width: 500px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 2px;
  background: linear-gradient(
    145deg,
    rgba(59, 130, 246, 0.5),
    rgba(147, 197, 253, 0.2),
    rgba(59, 130, 246, 0.5)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.05) 0%,
    transparent 70%
  );
  animation: cardGlow 4s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes cardGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(0, 0);
  }
  50% {
    opacity: 1;
    transform: translate(10%, 10%);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.card-glow {
  display: none;
}

.card-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.card-header::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.card-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: var(--spacing-md);
}

.card-header p {
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

/* ===================================
   Form Styles
   =================================== */

.login-form {
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: var(--spacing-xl);
}

.form-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  transition: all 0.3s ease;
}

.label-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-light);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.form-group:hover .label-icon {
  transform: scale(1.2) rotate(5deg);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.form-group:focus-within .form-label {
  color: var(--primary);
}

.form-group:focus-within .label-icon {
  transform: scale(1.3) rotate(10deg);
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.7));
}

.input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-shadow:
    var(--shadow-inner),
    0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
  background: #ffffff;
  border-color: var(--primary-light);
  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.15),
    0 0 30px rgba(59, 130, 246, 0.2),
    var(--shadow-md);
  transform: translateY(-2px);
}

.input-wrapper.focused .input-border {
  display: none;
}

.input-border {
  display: none;
}

/* Toggle Password Button */
.toggle-password {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.toggle-password:hover {
  color: var(--accent);
}

.toggle-password.active {
  color: var(--accent);
}

.eye-icon {
  width: 20px;
  height: 20px;
}

/* ===================================
   Form Options (Remember & Forgot)
   =================================== */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  gap: var(--spacing-md);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.checkbox-custom::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--primary-gradient);
  border-radius: 3px;
  opacity: 0;
  transform: scale(0) rotate(-45deg);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.checkbox-input:checked + .checkbox-custom {
  background: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: var(--primary-light);
  box-shadow:
    0 0 20px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.checkbox-input:checked + .checkbox-custom::after {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.checkbox-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.forgot-link {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.forgot-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.forgot-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ===================================
   Submit Button
   =================================== */

.submit-btn {
  width: 100%;
  padding: 1.2rem 2rem;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow:
    var(--shadow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 40px rgba(30, 64, 175, 0.2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submit-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
  opacity: 0;
  transition: all 0.4s ease;
  transform: translateX(-100%);
}

.submit-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
  opacity: 0;
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.submit-btn:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.submit-btn:hover {
  box-shadow:
    var(--shadow-2xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 60px rgba(30, 64, 175, 0.4);
  transform: translateY(-3px) scale(1.02);
}

.submit-btn:active {
  transform: translateY(-1px) scale(1);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 30px rgba(30, 64, 175, 0.3);
}

.btn-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submit-btn:hover .btn-icon {
  transform: translateX(-3px);
}

.btn-glow {
  display: none;
}

.submit-btn:hover .btn-glow {
  display: none;
}

/* Loading State */
.submit-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.submit-btn.loading .btn-text::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

/* ===================================
   Support Section
   =================================== */

.support-section {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.support-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.5;
}

.support-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===================================
   Footer
   =================================== */

.footer {
  text-align: center;
  margin-top: auto;
  padding-top: var(--spacing-2xl);
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: var(--spacing-xs);
}

.footer-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

table.dataTable thead th,
table.dataTable thead td,
table.dataTable tfoot th,
table.dataTable tfoot td,
table.dataTable tbody td {
  text-align: center !important;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    max-width: 600px;
  }

  .left-section,
  .right-section {
    padding: var(--spacing-lg);
  }

  .logo-circle {
    width: 100px;
    height: 100px;
  }

  .gov-logo {
    width: 80px;
    height: 80px;
  }

  .main-title {
    font-size: 2rem;
  }

  .sub-title {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
  }

  .container {
    padding: var(--spacing-md);
  }

  .main-title {
    font-size: 1.5rem;
  }

  .sub-title {
    font-size: 1rem;
  }

  .login-card {
    padding: var(--spacing-xl);
  }

  .card-header h3 {
    font-size: 1.5rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .shape-1,
  .shape-2,
  .shape-3,
  .shape-4 {
    display: none;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.25rem;
  }

  .sub-title {
    font-size: 0.9rem;
  }

  .system-name {
    font-size: 0.95rem;
  }

  .logo-circle {
    width: 70px;
    height: 70px;
  }

  .logo-circle svg {
    width: 35px;
    height: 35px;
  }
}

/* ===================================
   Accessibility Enhancements
   =================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles for Keyboard Navigation */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .form-input,
  .login-card {
    border-width: 2px;
  }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  body {
    background: white;
    color: black;
  }

  .background-gradient,
  .background-pattern,
  .floating-shapes,
  .submit-btn,
  .support-section {
    display: none;
  }
}
