@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");
:root {
  --primary-color: #2a6333;
  --secondary-color: #fcf5e6;
  --accent-light: #ecf0f1;
  --accent-dark: #14a604;
  --text-color: #3e2723;
  --shadow: #252524;
  --red: #a72719;
  --blue: #1d699b;
  --purple: #6a4c93;
  --teal: #16a085;
  --orange: #da8600;
  --green: #12773c;
  --modal-bg: #ecf0f1;

  /* Enhanced gradients using the admin color scheme */
  --gradient-primary: linear-gradient(135deg, #12773c 0%, #14a604 100%);
  --gradient-secondary: linear-gradient(135deg, #da8600 0%, #e3b031 100%);
  --gradient-accent: linear-gradient(135deg, #1d699b 0%, #4facfe 100%);
  --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-cool: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-dark: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);

  /* Glass morphism effects */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Nunito", sans-serif;
}

body {
  background-color: var(--secondary-color);
  color: var(--text-color);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Floating particles */
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      2px 2px at 20px 30px,
      rgba(255, 255, 255, 0.3),
      transparent
    ),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(
      2px 2px at 130px 80px,
      rgba(255, 255, 255, 0.3),
      transparent
    ),
    radial-gradient(
      2px 2px at 160px 30px,
      rgba(255, 255, 255, 0.2),
      transparent
    );
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: particleFloat 20s linear infinite;
  pointer-events: none;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-100px);
  }
}

@font-face {
  font-family: "magic_retro";
  src: url("../magic_retro/Magic\ Retro.ttf") format("truetype"),
    url("fonts/myFont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

h1 {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: "magic_retro", sans-serif;
  line-height: 1.2;
  text-align: center;
  font-size: 3.5rem;
  font-weight: 900;
  text-shadow: 0 0 15px rgba(104, 97, 97, 0.2);
  position: relative;
}

h2 {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  text-align: center;
  font-size: 32px;
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(104, 97, 97, 0.2);
}

.logo {
  width: 150px;
  margin: auto;
}

h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 900;
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 400px;
  width: 400px;
}

.header-title {
  background: var(--gradient-primary);
  border: 2px solid var(--shadow);
  box-shadow: var(--shadow) 3px 3px;
  padding: 24px;
  border-radius: 20px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.header-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.header-title:hover::before {
  left: 100%;
}

.header-title:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow) 6px 6px;
}

.header p {
  text-align: center;
  font-weight: 900;
  color: var(--secondary-color);
}

.logo_container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.cdsl_logo_inside {
  position: absolute;
  width: 120px;
  height: 120px;
  z-index: 100;
  background-color: var(--shadow);
  border-radius: 100%;
}

.cdsl_logo {
  width: 200px;
  height: 200px;
  border-radius: 100%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  animation: cdsl_logo_animation 12s linear infinite;
  border: 2px solid var(--shadow);
  box-shadow: var(--shadow) 4px 4px;
  position: relative;
  will-change: transform;
}

@keyframes cdsl_logo_animation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#login {
  display: flex;
}

.form-container {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.form-section {
  gap: 2rem;
  flex-direction: column;
  justify-content: center;
  background: var(--gradient-primary);
  border: 2px solid var(--shadow);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow) 4px 4px;
  height: 450px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-section:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow) 6px 6px;
}

input {
  border: 2px solid var(--shadow);
  padding: 16px 20px;
  border-radius: 15px;
  outline: none;
  width: 400px;
  margin-bottom: 1rem;
  background: var(--secondary-color);
  color: var(--text-color);
  font-size: 16px;
  font-weight: 600;
  padding-right: 50px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow) 4px 4px;
}

input::placeholder {
  color: rgba(62, 39, 35, 0.6);
  font-weight: 500;
}

input:focus {
  border-color: var(--accent-dark);
  box-shadow: var(--shadow) 5px 5px;
}

input:hover {
  border-color: var(--accent-dark);
}

form .global-btn {
  color: var(--text-color);
  font-weight: 900;
  text-transform: uppercase;
  border: 2px solid var(--shadow);
  padding: 16px 20px;
  border-radius: 15px;
  outline: none;
  cursor: pointer;
  width: 400px;
  margin-bottom: 1rem;
  font-size: 16px;
  letter-spacing: 1px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

form .form-btn {
  background: var(--gradient-secondary);
  box-shadow: var(--shadow) 4px 4px;
}

form .form-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow) 5px 5px;
  background: var(--gradient-warm);
}

form .form-btn:active {
  transform: translateY(0px);
  box-shadow: var(--shadow) 3px 3px;
}

.form-group {
  position: relative;
}

.password-toggle {
  background-color: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 43%;
  transform: translateY(-50%);
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
  color: rgba(62, 39, 35, 0.7);
}

.password-toggle:hover {
  background-color: rgba(62, 39, 35, 0.1);
  color: var(--text-color);
}

.sub {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--secondary-color);
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.5px;
}

.error {
  background-color: var(--accent-light);
  border: 2px solid var(--red) !important;
  box-shadow: var(--red) 4px 4px !important;
  animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@media (max-width: 768px) {
  body {
    padding: 0;
    height: 100vh;
  }

  .form-container {
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }

  .header {
    height: 100%;
    width: 100%;
    margin: 0;
  }

  .header-title {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .header p {
    font-size: 12px;
  }

  .form-section {
    padding: 20px;
    width: 400px;
  }

  form {
    width: 100%;
    margin: auto;
  }

  form .global-btn {
    width: 100%;
  }

  input {
    width: 100%;
    padding: 14px 18px;
  }

  .password-toggle {
    top: 10px;
    width: 30px;
  }

  .password-toggle {
    top: 45%;
    right: 15px;
  }

  .logo_container {
    display: none;
  }

  input,
  button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }

  .form-section {
    height: auto;
    width: 100%;
  }

  input,
  form .global-btn {
    width: 100%;
    max-width: 300px;
  }
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 900;
}

.modal {
  display: none;
  position: fixed;
  font-size: 18px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: var(--secondary-color);
  color: var(--text-color);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  border: 2px solid var(--shadow);
  box-shadow: var(--shadow) 4px 4px;
  width: 350px;
  font-weight: 900;
  animation: bounceIn 0.5s ease forwards;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  70% {
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-content button {
  margin-top: 20px;
  padding: 12px 24px;
  background: var(--gradient-secondary);
  color: var(--text-color);
  border: 2px solid var(--shadow);
  cursor: pointer;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow) 2px 2px;
  width: 120px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-content button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow) 3px 3px;
  background: var(--gradient-warm);
}

h4 {
  font-weight: 900;
}

.error-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.error-box h2 {
  color: var(--secondary-color);
  font-size: 2.5rem;
}

.error-box p {
  text-align: center;
}

/* Performance optimizations and accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cdsl_logo {
    animation: none;
  }
}

/* Hardware acceleration for better performance */
.form-section,
form .global-btn,
.modal-content button {
  transform: translateZ(0);
  backface-visibility: hidden;
}
