/* Preloader Animation */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  }
  
  .preloader.hidden {
    opacity: 0;
    visibility: hidden;
  }
  
  .loader {
    position: relative;
    width: 100px;
    height: 100px;
  }
  
  .blood-drop {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #ff5722;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: drop 2s infinite ease-in-out;
  }
  
  .test-tube {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 60px;
    background: transparent;
    border: 3px solid #1e88e5;
    border-top: 0;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
  }
  
  .filling {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #ff5722;
    animation: fill 2s infinite ease-in-out;
  }
  
  @keyframes drop {
    0% {
      transform: translateX(-50%) translateY(0) scale(1);
    }
    40% {
      transform: translateX(-50%) translateY(20px) scale(0.5);
    }
    50% {
      transform: translateX(-50%) translateY(30px) scale(0.2);
      opacity: 0;
    }
    100% {
      transform: translateX(-50%) translateY(0) scale(1);
      opacity: 1;
    }
  }
  
  @keyframes fill {
    0% {
      height: 0%;
    }
    50% {
      height: 80%;
    }
    100% {
      height: 80%;
    }
  }
  
  /* Button Hover Animation */
  .btn-primary {
    position: relative;
    overflow: hidden;
  }
  
  .btn-primary::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 40%;
    transform: translate3d(-50%, -50%, 0) scale(0);
    transition: transform 0.5s;
    z-index: 0;
  }
  
  .btn-primary:hover::after {
    transform: translate3d(-50%, -50%, 0) scale(1.5);
  }
  
  .btn-primary span,
  .btn-primary i {
    position: relative;
    z-index: 1;
  }
  
  /* Input Focus Animation */
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    animation: pulse 1.5s infinite;
  }
  
  @keyframes pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.4);
    }
    70% {
      box-shadow: 0 0 0 5px rgba(30, 136, 229, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(30, 136, 229, 0);
    }
  }
  
  /* Form Shake Animation for Errors */
  .form-error {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }
  
  @keyframes shake {
    10%,
    90% {
      transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
      transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
      transform: translate3d(-2px, 0, 0);
    }
    40%,
    60% {
      transform: translate3d(2px, 0, 0);
    }
  }
  
  /* Floating Label Animation */
  .form-group label {
    transition: all 0.3s ease;
  }
  
  .form-group input:focus + label,
  .form-group select:focus + label,
  .form-group textarea:focus + label {
    color: #1e88e5;
    font-weight: 500;
  }
  
  /* Icon Pulse Animation */
  .input-icon {
    transition: all 0.3s ease;
  }
  
  .form-group input:focus ~ .input-icon,
  .form-group select:focus ~ .input-icon,
  .form-group textarea:focus ~ .input-icon {
    color: #1e88e5;
    animation: iconPulse 1.5s infinite;
  }
  
  @keyframes iconPulse {
    0% {
      transform: translateY(-50%) scale(1);
    }
    50% {
      transform: translateY(-50%) scale(1.1);
    }
    100% {
      transform: translateY(-50%) scale(1);
    }
  }
  
  /* Background Shapes Animation */
  .bg-shape-1,
  .bg-shape-2 {
    animation: morph 15s linear infinite alternate;
  }
  
  @keyframes morph {
    0% {
      border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
      border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
      border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
  }
  
  /* Add responsive styles for mobile */
  @media (max-width: 640px) {
    .auth-container {
      padding: 1rem 0.5rem;
    }
  
    .auth-card {
      margin: 0.5rem;
    }
  
    .btn-primary::after {
      width: 200px;
      height: 200px;
    }
  
    .blood-drop {
      width: 30px;
      height: 30px;
    }
  
    .test-tube {
      width: 25px;
      height: 50px;
    }
  }
  
  /* Fix form elements on small screens */
  @media (max-width: 480px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
      font-size: 16px; /* Prevents iOS zoom on focus */
    }
  
    .checkbox-wrapper label {
      font-size: 14px;
    }
  
    .auth-link {
      display: inline-block;
      padding: 0.5rem 0;
    }
  }
  
  /* Ensure buttons are properly sized on mobile */
  @media (max-width: 640px) {
    .btn {
      width: 100%;
      justify-content: center;
    }
  
    .flex.items-center.justify-between {
      flex-direction: column;
      align-items: stretch;
      gap: 1rem;
    }
  
    .flex.items-center.justify-between .auth-link {
      text-align: center;
      display: block;
    }
  }
  