html {
  background: #282a2d;
}

body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/assets/images/auth/bg.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #282a2d;
  -webkit-text-size-adjust: 100%;
}

.container {
  text-align: center;
  padding: 2.5rem;
  width: 90%;
  max-width: 500px;
  margin: 1rem;
  background: rgba(40, 42, 45, 0.9);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.plex-button {
  background: #cc7b19;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.plex-button:hover {
  background: #e88b1d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(204, 123, 25, 0.3);
}

.plex-button:active {
  transform: translateY(0);
  box-shadow: none;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: #fff;
}

p {
  font-size: 1.1rem;
  color: #ccc; /* Light grey for paragraphs */
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.error-details {
  margin-top: 1.5rem;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 1.2rem;
  border-radius: 6px;
  word-break: break-word;
}

/* Loading animation for auth-popup */
.loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Style for Jellyfin login form elements */
.login-form {
  margin-top: 20px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 10px; /* Increased padding slightly */
  margin-bottom: 15px; /* Increased margin slightly */
  box-sizing: border-box;
  border-radius: 4px;
  border: 1px solid #555; /* Added subtle border */
  background-color: #fff; /* Ensure white background */
  color: #333; /* Set text color inside input */
  font-size: 1rem;
}

.separator {
  text-align: center;
  margin: 15px 0;
  color: #ccc;
}

.jellyfin-button {
  width: 100%; /* Make button full width */
  padding: 12px; /* Adjusted padding */
  background-color: #00a4dc; /* Jellyfin blue */
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.jellyfin-button:hover {
  background-color: #008bbd;
}

#loginStatus {
  margin-top: 15px;
  color: #ff6b6b; /* Use a less harsh red for errors */
  font-weight: bold;
}


/* --- NEW: Styles for Login Form Labels --- */
.login-form label {
  display: block; /* Ensure it takes its own line */
  color: #ccc; /* Use the same light grey as paragraph text */
  font-size: 0.9rem; /* Slightly smaller font size */
  margin-bottom: 5px; /* Space between label and input */
  text-align: left; /* Align text to the left */
}


/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    margin: 1rem;
    width: 85%;
  }

  h1 {
    font-size: 1.8rem;
  }

  p {
    font-size: 1rem;
  }

  .plex-button {
    padding: 12px 24px;
    font-size: 15px;
  }

  .error-details {
    font-size: 0.9rem;
    padding: 1rem;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 9px;
    margin-bottom: 12px;
  }

  .jellyfin-button {
    padding: 11px;
    font-size: 15px;
  }

  .login-form label {
     font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1.2rem;
    margin: 0.8rem;
    width: 90%;
  }

  h1 {
    font-size: 1.6rem;
  }

  .plex-button {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%; /* Ensure Plex button is full width on small screens */
    justify-content: center;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 8px;
    margin-bottom: 10px;
  }

   .jellyfin-button {
    padding: 10px;
    font-size: 14px;
  }

   .login-form label {
     font-size: 0.8rem;
  }
}

@media (max-height: 600px) {
  body {
    align-items: flex-start; /* Prevent container cutoff on short viewports */
  }
  .container {
    margin-top: 2rem;
  }
}
