body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  overflow: hidden;
}

/* Background Video Styles */
#background-video {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  height: 100%;
  z-index: -10;
  object-fit: cover;
  pointer-events: auto;
}

/* Interactive Effects Container */
#interactive-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -8;
  pointer-events: none;
}

/* Ripple Effect Animation */
.ripple-effect {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(78, 205, 196, 0.8);
  border-radius: 50%;
  animation: ripple-animation 1s ease-out forwards;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(78, 205, 196, 0.3);
}

@keyframes ripple-animation {
  0% {
    transform: scale(0);
    opacity: 1;
    border-width: 3px;
  }
  50% {
    opacity: 0.7;
    border-width: 2px;
  }
  100% {
    transform: scale(8);
    opacity: 0;
    border-width: 1px;
  }
}

/* Particle Effect Animation */
.particle-effect {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, rgba(78, 205, 196, 1) 0%, rgba(255, 107, 107, 0.8) 50%, transparent 100%);
  border-radius: 50%;
  animation: particle-animation 1.5s ease-out forwards;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

@keyframes particle-animation {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  70% {
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(0.2);
    opacity: 0;
  }
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: -5;
  pointer-events: none;
}

/* Removed body::after as we're using video background */

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -30px); }
  66% { transform: translate(-20px, 20px); }
}

@keyframes floatReverse {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-30px, 30px); }
  66% { transform: translate(20px, -20px); }
}

.form-signin {
  width: 100%;
  max-width: 480px;
  padding: 40px 30px;
  border-radius: 25px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(15px) saturate(1.5);
  border: 1px solid rgba(78, 205, 196, 0.3);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(78, 205, 196, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  min-height: 500px;
  box-sizing: border-box;
  overflow: hidden;
}

.form-signin:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(78, 205, 196, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-color: rgba(78, 205, 196, 0.5);
}

.form-signin:hover {
  transform: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); /* คงที่ ไม่เด้ง */
}


.logo {
  display: block;
  margin: 0 auto 25px auto;
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 50%;
  border: 3px solid #4ecdc4;
  box-shadow: 
    0 0 20px rgba(78, 205, 196, 0.5),
    0 0 40px rgba(78, 205, 196, 0.3),
    inset 0 0 20px rgba(78, 205, 196, 0.1);
  background: #fff !important;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  filter: brightness(1.2) saturate(1.3) hue-rotate(-10deg);
}

.logo::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #4ecdc4, #45b7d1, #4ecdc4, #45b7d1, #4ecdc4);
  z-index: -1;
  animation: rotate-glow 3s linear infinite;
}

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

.logo:hover {
  transform: scale(1.1);
  box-shadow: 
    0 0 30px rgba(78, 205, 196, 0.8),
    0 0 60px rgba(78, 205, 196, 0.5),
    inset 0 0 30px rgba(78, 205, 196, 0.2);
  border-color: rgba(78, 205, 196, 0.9);
}

.title {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(45deg, #4ecdc4, #45b7d1, #a8e6cf, #ffd3a5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: 25px;
  text-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.form-floating {
  position: relative;
  margin-bottom: 20px;

}

.form-floating label {
  color: #555;
}

.input-group-custom {
  position: relative;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 15px;
  padding: 3px;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  border: 2px solid rgba(78, 205, 196, 0.2);
  backdrop-filter: blur(10px);
}

.input-group-custom:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(78, 205, 196, 0.2);
  border-color: rgba(78, 205, 196, 0.5);
}

.input-icon-box {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
}

.input-group-custom:nth-child(2) .input-icon-box {
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.input-icon-box:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.input-group-custom:nth-child(2) .input-icon-box:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.form-control-custom {
  flex: 1;
  border: none;
  background: transparent;
  padding: 15px 20px 15px 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  outline: none;
  position: relative;
}

.form-control-custom::placeholder {
  color: rgba(224, 216, 216, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.floating-label {
  position: absolute;
  left: 65px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.3s ease;
  background: transparent;
  padding: 0 5px;
}

.form-control-custom:focus + .floating-label,
.form-control-custom:not(:placeholder-shown) + .floating-label {
  top: -10px;
  left: 65px;
  font-size: 0.85rem;
  color: #4ecdc4;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 10px;
  padding: 2px 8px;
  box-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
}

.input-group-custom:nth-child(2) .form-control-custom:focus + .floating-label,
.input-group-custom:nth-child(2) .form-control-custom:not(:placeholder-shown) + .floating-label {
  color: #667eea;
}

.form-control-custom:focus {
  color: #e7e4e4;
}

.tick-mark {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #4CAF50;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-control-custom:valid ~ .tick-mark {
  opacity: 1;
}

.toggle-password {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: #333;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.3s ease;
  box-shadow: 
    0 6px 20px rgba(78, 205, 196, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5fd3ca, #4ecdc4);
  transform: translateY(-2px);
  box-shadow: 
    0 10px 25px rgba(78, 205, 196, 0.4),
    0 0 20px rgba(78, 205, 196, 0.2);
}

/* Keep button width stable when swapping text with spinner */
.btn-primary, .btn-primary .spinner-border{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary[disabled] { opacity: 0.85; cursor: default; }
.spinner-border{ margin-right: .5rem; }

.toggle-password {
  cursor: pointer;
  z-index: 5;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #888;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.tick-mark {
  display: none;
  color: green;
  font-size: 20px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.error-message {
  color: red;
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.color {
  color: #4ecdc4;
  text-transform: uppercase;
}

/* Link styling */
a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #4ecdc4;
  text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}
