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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #3862a5 0%, #5a7fc7 100%);
  color: #2c3e50;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: normal;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.geometric-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}
.geometric-shape.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  background: linear-gradient(45deg, rgba(90, 127, 199, 0.2), rgba(255, 255, 255, 0.1));
}
.geometric-shape.shape-2 {
  width: 120px;
  height: 120px;
  top: 60%;
  left: 85%;
  animation-delay: 2s;
  background: linear-gradient(135deg, rgba(56, 98, 165, 0.15), rgba(234, 241, 251, 0.3));
}
.geometric-shape.shape-3 {
  width: 60px;
  height: 60px;
  top: 80%;
  left: 15%;
  animation-delay: 4s;
  background: rgba(90, 127, 199, 0.2);
}
.geometric-shape.shape-4 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 75%;
  animation-delay: 1s;
  background: linear-gradient(225deg, rgba(255, 255, 255, 0.2), rgba(56, 98, 165, 0.1));
}
.geometric-shape.shape-5 {
  width: 140px;
  height: 140px;
  top: 40%;
  left: 5%;
  animation-delay: 3s;
  background: radial-gradient(circle, rgba(234, 241, 251, 0.4), transparent);
}

.floating-lines {
  position: absolute;
  width: 100%;
  height: 100%;
}
.floating-lines .line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: drift 8s linear infinite;
}
.floating-lines .line.line-1 {
  width: 200px;
  height: 2px;
  top: 25%;
  left: -200px;
  animation-delay: 0s;
}
.floating-lines .line.line-2 {
  width: 300px;
  height: 1px;
  top: 55%;
  left: -300px;
  animation-delay: 2s;
}
.floating-lines .line.line-3 {
  width: 150px;
  height: 2px;
  top: 75%;
  left: -150px;
  animation-delay: 4s;
}
.floating-lines .line.line-4 {
  width: 250px;
  height: 1px;
  top: 45%;
  left: -250px;
  animation-delay: 6s;
}

.modern-login-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 1.5rem;
}

.login-card-wrapper {
  width: 100%;
  max-width: 1400px;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  width: 100%;
  min-height: 600px;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: cardSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-form-section {
  flex: 2;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  position: relative;
}

.form-header {
  margin-bottom: 2rem;
  text-align: center;
}
.form-header .logo-section {
  margin-bottom: 1.5rem;
}
.form-header .logo-section .logo {
  background: url("/icon/logo.png") no-repeat center;
  background-size: contain;
  height: 60px;
  width: 200px;
  margin: 0 auto;
  transition: transform 0.25s ease-out;
}
.form-header .logo-section .logo:hover {
  transform: scale(1.02);
}
.form-header .signin-title {
  font-size: 2rem;
  font-weight: normal;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.form-header .signin-subtitle {
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 0;
  font-weight: normal;
}

.form-container {
  width: 100%;
}

.modern-form {
  width: 100%;
}
.modern-form .input-group {
  margin-bottom: 1.5rem;
}
.modern-form .input-group .input-label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: normal;
  color: #2c3e50;
  transition: color 0.15s ease-out;
}
.modern-form .input-group .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.modern-form .input-group .input-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  z-index: 3;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  transition: color 0.15s ease-out;
}
.modern-form .input-group .input-wrapper .input-icon svg {
  width: 100%;
  height: 100%;
}
.modern-form .input-group .input-wrapper .modern-input {
  width: 100%;
  padding: 1rem 1rem 1rem calc(1rem + 32px);
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 1rem;
  font-weight: normal;
  color: #2c3e50;
  transition: all 0.25s ease-out cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-form .input-group .input-wrapper .modern-input::placeholder {
  color: #9ca3af;
  font-weight: normal;
}
.modern-form .input-group .input-wrapper .modern-input:focus {
  outline: none;
  border-color: #3862a5;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(56, 98, 165, 0.1);
}
.modern-form .input-group .input-wrapper .modern-input:focus + .input-icon {
  color: #3862a5;
}
.modern-form .input-group .input-wrapper .modern-input:hover {
  border-color: #d1d5db;
}
.modern-form .input-group .input-wrapper .password-toggle {
  position: absolute;
  right: 1rem;
  z-index: 3;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  color: #9ca3af;
  transition: color 0.15s ease-out;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modern-form .input-group .input-wrapper .password-toggle svg {
  width: 20px;
  height: 20px;
}
.modern-form .input-group .input-wrapper .password-toggle:hover {
  color: #3862a5;
}
.modern-form .error-feedback {
  min-height: 24px;
  margin-bottom: 1rem;
}
.modern-form .error-feedback .error-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ef4444;
  font-size: 0.875rem;
  font-weight: normal;
  animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.modern-form .error-feedback .error-message .error-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.modern-form .form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.modern-form .form-options .remember-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: normal;
}
.modern-form .form-options .remember-checkbox input[type=checkbox] {
  display: none;
}
.modern-form .form-options .remember-checkbox input[type=checkbox]:checked + .checkmark {
  background: #3862a5;
  border-color: #3862a5;
}
.modern-form .form-options .remember-checkbox input[type=checkbox]:checked + .checkmark svg {
  opacity: 1;
  transform: scale(1);
}
.modern-form .form-options .remember-checkbox .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-out;
}
.modern-form .form-options .remember-checkbox .checkmark svg {
  width: 12px;
  height: 12px;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease-out;
}
.modern-form .form-options .remember-checkbox:hover .checkmark {
  border-color: #3862a5;
}
.modern-form .form-options .forgot-link {
  color: #3862a5;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: normal;
  transition: color 0.15s ease-out;
}
.modern-form .form-options .forgot-link:hover {
  color: #2d4e85;
  text-decoration: underline;
}
.modern-form .signin-button {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #3862a5 0%, #5a7fc7 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.25s ease-out cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.modern-form .signin-button .button-text {
  position: relative;
  z-index: 2;
  transition: opacity 0.15s ease-out;
}
.modern-form .signin-button .button-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease-out;
}
.modern-form .signin-button .button-loader .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.modern-form .signin-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 98, 165, 0.3);
}
.modern-form .signin-button:active {
  transform: translateY(0);
}
.modern-form .signin-button.loading {
  pointer-events: none;
}
.modern-form .signin-button.loading .button-text {
  opacity: 0;
}
.modern-form .signin-button.loading .button-loader {
  opacity: 1;
}
.modern-form .signup-prompt {
  text-align: center;
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: normal;
}
.modern-form .signup-prompt .signup-link {
  color: #3862a5;
  text-decoration: none;
  font-weight: normal;
  margin-left: 4px;
  transition: color 0.15s ease-out;
}
.modern-form .signup-prompt .signup-link:hover {
  color: #2d4e85;
  text-decoration: underline;
}

.decoration-section {
  flex: 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #3862a5 0%, #5a7fc7 100%);
}

.background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.background-video::-webkit-media-controls {
  display: none !important;
}
.background-video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(56, 98, 165, 0.3) 0%, rgba(90, 127, 199, 0.2) 50%, rgba(56, 98, 165, 0.1) 100%);
  z-index: 2;
  pointer-events: none;
}

.video-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3862a5 0%, #5a7fc7 100%);
  z-index: 1;
}
.video-fallback .welcome-content {
  text-align: center;
  padding: 2.5rem;
}
.video-fallback .welcome-content .welcome-title {
  font-size: 2.5rem;
  font-weight: normal;
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.video-fallback .welcome-content .welcome-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: normal;
  line-height: 1.6;
  max-width: 300px;
  margin: 0 auto;
}

.language-switcher {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 10;
  backdrop-filter: blur(10px);
}
.language-switcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  background: #ffffff;
}
.language-switcher svg {
  width: 24px;
  height: 24px;
  fill: #3862a5;
  transition: all 0.15s ease-out;
}

.login-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  z-index: 5;
  backdrop-filter: blur(10px);
  background: rgba(56, 98, 165, 0.1);
  font-weight: normal;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}
@keyframes drift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + 200px));
  }
}
@keyframes cardSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@media (max-width: 768px) {
  .modern-login-container {
    padding: 1rem;
  }
  .login-card {
    flex-direction: column;
    min-height: auto;
    max-height: none;
    width: 100%;
    max-width: 500px;
  }
  .login-form-section {
    flex: none;
    padding: 2rem 1.5rem;
  }
  .decoration-section {
    flex: none;
    min-height: 200px;
  }
  .decoration-section .video-fallback .welcome-content .welcome-title {
    font-size: 2rem;
  }
  .decoration-section .video-fallback .welcome-content .welcome-subtitle {
    font-size: 1rem;
  }
  .video-overlay {
    background: linear-gradient(135deg, rgba(56, 98, 165, 0.4) 0%, rgba(90, 127, 199, 0.3) 50%, rgba(56, 98, 165, 0.2) 100%);
  }
}
@media (max-width: 640px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }
  .modern-login-container {
    padding: 0.75rem;
    min-height: 100vh;
  }
  .login-card {
    border-radius: 12px;
    margin: 0.75rem 0;
  }
  .login-form-section {
    padding: 1.5rem 1rem;
  }
  .login-form-section .form-header .signin-title {
    font-size: 1.75rem;
  }
  .login-form-section .form-header .signin-subtitle {
    font-size: 0.9rem;
  }
  .decoration-section {
    min-height: 150px;
  }
  .decoration-section .video-fallback .welcome-content {
    padding: 1.5rem;
  }
  .decoration-section .video-fallback .welcome-content .welcome-title {
    font-size: 1.5rem;
  }
  .decoration-section .video-fallback .welcome-content .welcome-subtitle {
    font-size: 0.9rem;
  }
  .video-overlay {
    background: linear-gradient(135deg, rgba(56, 98, 165, 0.5) 0%, rgba(90, 127, 199, 0.4) 50%, rgba(56, 98, 165, 0.3) 100%);
  }
  .form-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .language-switcher {
    bottom: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
  }
  .language-switcher svg {
    width: 20px;
    height: 20px;
  }
  .animated-background .geometric-shape {
    opacity: 0.5;
  }
  .animated-background .geometric-shape.shape-1, .animated-background .geometric-shape.shape-3 {
    width: 40px;
    height: 40px;
  }
  .animated-background .geometric-shape.shape-2, .animated-background .geometric-shape.shape-4, .animated-background .geometric-shape.shape-5 {
    width: 60px;
    height: 60px;
  }
  .animated-background .floating-lines .line {
    opacity: 0.3;
  }
}
.swal2-popup {
  border-radius: 12px !important;
  padding: 1.5rem !important;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.swal2-title {
  color: #2c3e50 !important;
  font-weight: normal !important;
  margin-bottom: 1.5rem !important;
}

.swal2-select {
  width: 100% !important;
  font-size: 1rem !important;
  padding: 1rem !important;
  border-radius: 12px !important;
  border: 2px solid #e5e7eb !important;
  margin: 1rem 0 !important;
  color: #2c3e50 !important;
  background-color: #f8fafc !important;
  transition: all 0.15s ease-out !important;
  font-weight: normal !important;
}
.swal2-select:focus {
  outline: none !important;
  border-color: #3862a5 !important;
  box-shadow: 0 0 0 3px rgba(56, 98, 165, 0.1) !important;
}

.swal2-popup .swal2-styled.swal2-confirm,
.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, #3862a5 0%, #5a7fc7 100%) !important;
  border: none !important;
  padding: 1rem 2rem !important;
  font-size: 1rem !important;
  font-weight: normal !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  min-width: 110px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease-out !important;
  margin: 0 0.75rem !important;
  box-sizing: border-box !important;
}
.swal2-popup .swal2-styled.swal2-confirm:focus,
.swal2-styled.swal2-confirm:focus {
  box-shadow: 0 0 0 3px rgba(56, 98, 165, 0.3) !important;
  outline: none !important;
}
.swal2-popup .swal2-styled.swal2-confirm:hover,
.swal2-styled.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(56, 98, 165, 0.3) !important;
  background: linear-gradient(135deg, #2d4e85 0%, #3862a5 100%) !important;
}
.swal2-popup .swal2-styled.swal2-confirm:active,
.swal2-styled.swal2-confirm:active {
  transform: translateY(0) !important;
}

.swal2-popup .swal2-styled.swal2-cancel,
.swal2-styled.swal2-cancel {
  background: #6c757d !important;
  border: none !important;
  padding: 1rem 2rem !important;
  font-size: 1rem !important;
  font-weight: normal !important;
  border-radius: 12px !important;
  color: #ffffff !important;
  min-width: 110px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease-out !important;
  margin: 0 0.75rem !important;
  box-sizing: border-box !important;
}
.swal2-popup .swal2-styled.swal2-cancel:focus,
.swal2-styled.swal2-cancel:focus {
  box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.3) !important;
  outline: none !important;
}
.swal2-popup .swal2-styled.swal2-cancel:hover,
.swal2-styled.swal2-cancel:hover {
  transform: translateY(-2px) !important;
  background: #5a6268 !important;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}
.swal2-popup .swal2-styled.swal2-cancel:active,
.swal2-styled.swal2-cancel:active {
  transform: translateY(0) !important;
}

.swal2-popup .swal2-actions,
.swal2-actions {
  display: flex !important;
  gap: 1rem !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0 !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

@media (max-width: 640px) {
  .swal2-popup .swal2-styled.swal2-confirm,
  .swal2-popup .swal2-styled.swal2-cancel,
  .swal2-styled.swal2-confirm,
  .swal2-styled.swal2-cancel {
    min-width: 90px !important;
    font-size: 0.9rem !important;
    padding: 0.75rem 1.5rem !important;
    height: 40px !important;
  }
}
.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.signin-button,
.language-switcher,
.login-card {
  will-change: transform;
}

.geometric-shape,
.floating-lines .line {
  will-change: transform, opacity;
}

.background-video {
  will-change: auto;
}

.login-card,
.signin-button,
.modern-input,
.background-video,
.video-overlay {
  transform: translateZ(0);
}
