/* Enhanced Login Page Specific Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Share Tech Mono', monospace;
  background: linear-gradient(135deg, #0a0f1e, #1e2850);
  color: #FFFFFF;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Background effects */
.cyber-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 15, 30, 0.8);
  z-index: -2;
}

.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  transform: perspective(500px) rotateX(30deg);
  transform-origin: center center;
  animation: grid-movement 20s linear infinite;
  opacity: 0.4;
  margin: 0;
  padding: 0;
}

@keyframes grid-movement {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

.cyber-scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, 
    transparent 0%, 
    rgba(0, 240, 255, 0.05) 5%, 
    transparent 10%);
  z-index: 5;
  pointer-events: none;
  animation: scanline 8s linear infinite;
  opacity: 0.3;
}

@keyframes scanline {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

.glitch-effect {
  position: relative;
  overflow: hidden;
}

.glitch-effect:before, 
.glitch-effect:after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch-effect:before {
  left: 2px;
  text-shadow: -1px 0 #FF00A0;
  animation: glitch-1 2s infinite linear alternate-reverse;
}

.glitch-effect:after {
  left: -2px;
  text-shadow: -1px 0 #00F0FF;
  animation: glitch-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
  0%, 80%, 100% { clip-path: inset(0 0 0 0); }
  20% { clip-path: inset(0 10% 0 0); }
  40% { clip-path: inset(0 25% 0 25%); }
  60% { clip-path: inset(15% 0 15% 0); }
}

@keyframes glitch-2 {
  0%, 85%, 100% { clip-path: inset(0 0 0 0); }
  25% { clip-path: inset(0 0 0 10%); }
  50% { clip-path: inset(25% 0 25% 0); }
  75% { clip-path: inset(0 15% 0 15%); }
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  padding: 0;
  margin: 0 auto;
  text-align: center;
}

.login-card {
  width: 450px;
  max-width: 90%;
  background: rgba(15, 25, 50, 0.8);
  border: 1px solid #00F0FF;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.1);
  padding: 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  backdrop-filter: blur(5px);
  animation: card-glow 4s infinite alternate;
  margin: 0 auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
}

@keyframes card-glow {
  0% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 10px rgba(0, 240, 255, 0.1); }
  100% { box-shadow: 0 0 40px rgba(0, 240, 255, 0.4), inset 0 0 20px rgba(0, 240, 255, 0.2); }
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
  width: 100%;
  position: relative;
}

.login-logo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo {
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.8));
  animation: logo-rotation 15s linear infinite;
}

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

.logo-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.2) 10%, transparent 70%);
  animation: pulse 3s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.5; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

.login-title {
  font-size: 2.2rem;
  color: #00F0FF;
  margin: 0.5rem 0;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
  position: relative;
  display: inline-block;
}

.security-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

.security-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.security-label {
  color: rgba(255, 255, 255, 0.6);
}

.security-value {
  color: #FFFF00;
  font-weight: bold;
}

.connection-secure::before,
.status-secure::before {
  content: '•';
  display: inline-block;
  margin-right: 0.25rem;
  color: #00FF00;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.form-row {
  margin-bottom: 1.5rem;
  position: relative;
  width: 100%;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: #00F0FF;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.cyber-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(10, 20, 40, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #FFFFFF;
  font-family: 'Share Tech Mono', monospace;
  box-sizing: border-box;
  transition: all 0.3s ease;
  outline: none;
}

.cyber-input:focus {
  border-color: #00F0FF;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.input-highlight {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #00F0FF, #FF00A0);
  transition: width 0.3s ease;
}

.cyber-input:focus + .input-highlight {
  width: 100%;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  transition: all 0.3s ease;
  z-index: 2;
}

.toggle-password:hover, 
.toggle-password:focus {
  color: #00F0FF;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0 1.5rem;
}

.checkbox-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cyber-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  background: rgba(10, 20, 40, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.3);
  transition: all 0.3s ease;
}

.cyber-checkbox:checked + .checkbox-custom {
  background: rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.8);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.checkbox-custom:after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #00F0FF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  animation: checkbox-appear 0.3s ease-out;
}

@keyframes checkbox-appear {
  0% { opacity: 0; transform: rotate(45deg) scale(0); }
  100% { opacity: 1; transform: rotate(45deg) scale(1); }
}

.cyber-checkbox:checked + .checkbox-custom:after {
  display: block;
}

.cyber-checkbox:focus + .checkbox-custom {
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

.checkbox-label {
  font-size: 0.9rem;
  cursor: pointer;
}

.forgot-link {
  color: rgba(255, 0, 160, 0.8);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.forgot-link:hover {
  color: #FF00A0;
  text-shadow: 0 0 5px rgba(255, 0, 160, 0.7);
}

.error-message {
  color: #FF00A0;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  text-align: center;
  min-height: 20px;
  font-size: 0.9rem;
  text-shadow: 0 0 5px rgba(255, 0, 160, 0.5);
}

.form-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

.cyber-button {
  flex: 1;
  padding: 0.8rem 1.5rem;
  background: transparent;
  color: #FFFFFF;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 1;
}

.login-button {
  border: 1px solid #00F0FF;
}

.login-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
  transition: all 0.3s ease;
  z-index: -1;
}

.login-button:hover::before {
  left: 100%;
  transition: 0.5s;
}

.login-button:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.7);
}

.back-button {
  border: 1px solid #FF00A0;
}

.back-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 160, 0.2), transparent);
  transition: all 0.3s ease;
  z-index: -1;
}

.back-button:hover::before {
  left: 100%;
  transition: 0.5s;
}

.back-button:hover {
  background: rgba(255, 0, 160, 0.1);
  box-shadow: 0 0 15px rgba(255, 0, 160, 0.5);
  text-shadow: 0 0 5px rgba(255, 0, 160, 0.7);
}

.button-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.server-status {
  text-align: center;
  margin-top: 1.5rem;
  opacity: 0.6;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #FFFF00;
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 5px #FFFF00;
  animation: blink 1.5s infinite;
}

/* Data encryption visual element */
.encryption-visual {
  position: absolute;
  bottom: 10px;
  font-family: monospace;
  font-size: 10px;
  opacity: 0.2;
  color: #00F0FF;
  pointer-events: none;
  animation: encryption-flow 20s linear infinite;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

@keyframes encryption-flow {
  0% { transform: translateY(0); }
  100% { transform: translateY(-500px); }
}

/* Responsive styles */
@media (max-width: 600px) {
  .login-card {
    padding: 1.5rem;
    max-width: 95%;
    width: 95%;
  }

  .form-buttons {
    flex-direction: column;
  }

  .login-title {
    font-size: 1.8rem;
  }
}

@media (min-width: 1400px) {
  .login-card {
    width: 500px;
    padding: 3rem;
  }
}

/* Loading indicators */
.loading-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(0, 240, 255, 0.3);
  border-radius: 50%;
  border-top-color: #00F0FF;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

.loading-dots:after {
  content: '.';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

/* Light mode styles */
[data-theme="light"] body.cyberpunk-login {
  /* Use a solid background color from the theme variables */
  background: var(--color-background, #f0f2f5); 
  color: var(--color-text, #181818); 
}

[data-theme="light"] .login-card {
  /* Use an opaque white background */
  background-color: var(--card-bg, #ffffff); 
  border-color: rgba(0, 120, 212, 0.3); /* Lighter border */
  box-shadow: 0 0 20px rgba(0, 120, 212, 0.15), inset 0 0 10px rgba(0, 120, 212, 0.05);
}

[data-theme="light"] .cyber-input {
  background-color: #ffffff; /* White background for inputs */
  border-color: rgba(0, 120, 212, 0.5);
  color: var(--color-text, #181818); 
}

[data-theme="light"] .cyber-input::placeholder {
  color: var(--color-text-dim, #5a5a5a); /* Dimmer placeholder text */
}

[data-theme="light"] .cyber-input:focus {
  background-color: #ffffff;
  border-color: var(--color-primary, #0078d4); /* Use primary color for focus */
  box-shadow: 0 0 10px rgba(0, 120, 212, 0.3);
}

/* Remove potentially conflicting styles */
/* [data-theme="light"] .input-icon { ... } */
/* [data-theme="light"] .input-line { ... } */

[data-theme="light"] .login-button {
  /* Use primary color for background, white text */
  background: var(--color-primary, #0078d4); 
  border-color: var(--color-primary, #0078d4);
  color: #ffffff; 
  text-shadow: none;
}

[data-theme="light"] .login-button:hover {
  /* Slightly darker/brighter primary on hover */
  background: #005a9e; /* Adjust hover color as needed */
  border-color: #005a9e;
  box-shadow: 0 0 15px rgba(0, 120, 212, 0.4);
}

/* Remove potentially conflicting styles */
/* [data-theme="light"] .button-glow { ... } */

[data-theme="light"] .login-title { /* Adjusted from .system-name */
  color: var(--color-primary, #0078d4); /* Use primary color */
  text-shadow: none;
}

/* Assuming .system-subtitle is not used or handled elsewhere */
/* [data-theme="light"] .system-subtitle { ... } */

[data-theme="light"] .security-info {
  color: var(--color-text-dim, #5a5a5a); /* Dimmer text for less important info */
}

[data-theme="light"] .security-label {
    color: var(--color-text-dim, #5a5a5a);
}

[data-theme="light"] .security-value {
    color: var(--color-text, #181818); /* Standard text color for values */
}

/* Remove potentially conflicting styles */
/* [data-theme="light"] .security-detail { ... } */
/* [data-theme="light"] .auth-status { ... } */
/* [data-theme="light"] .auth-status::before { ... } */
/* [data-theme="light"] .status-indicator { ... } */
/* [data-theme="light"] .status-indicator::before { ... } */
/* [data-theme="light"] .status-text { ... } */
/* [data-theme="light"] .auth-message { ... } */
/* [data-theme="light"] .auth-message.success { ... } */
/* [data-theme="light"] .auth-message.error { ... } */
/* [data-theme="light"] .auth-message a.highlight { ... } */


[data-theme="light"] .form-label { /* Ensure labels are readable */
    color: var(--color-primary, #0078d4); 
}

[data-theme="light"] label[for="remember"], /* Target specific label if needed */
[data-theme="light"] .checkbox-label { /* Style for checkbox label */
  color: var(--color-text, #181818);
}

[data-theme="light"] .forgot-link {
  color: var(--color-secondary, #d400aa); /* Use secondary color for links */
}

[data-theme="light"] .forgot-link:hover {
  color: #a30082; /* Darker secondary on hover */
}

/* Remove potentially conflicting styles */
/* [data-theme="light"] .forgot-link::after { ... } */
/* [data-theme="light"] .footer-links a { ... } */

/* Ensure back button also has contrast */
[data-theme="light"] .back-button {
    background: transparent;
    border: 1px solid var(--color-secondary, #d400aa);
    color: var(--color-secondary, #d400aa);
    text-shadow: none;
}

[data-theme="light"] .back-button:hover {
    background: rgba(212, 0, 170, 0.1); /* Light secondary background */
    color: #a30082; /* Darker secondary */
    box-shadow: 0 0 15px rgba(212, 0, 170, 0.4);
}

/* Ensure toggle password icon is visible */
[data-theme="light"] .toggle-password {
    color: var(--color-text-dim, #5a5a5a);
}
[data-theme="light"] .toggle-password:hover,
[data-theme="light"] .toggle-password:focus {
    color: var(--color-primary, #0078d4);
}

/* Ensure checkbox is styled correctly */
[data-theme="light"] .checkbox-custom {
    background: #ffffff;
    border: 1px solid rgba(0, 120, 212, 0.5);
}
[data-theme="light"] .cyber-checkbox:checked + .checkbox-custom {
    background: rgba(0, 120, 212, 0.1);
    border-color: var(--color-primary, #0078d4);
}
[data-theme="light"] .checkbox-custom:after {
    border-color: var(--color-primary, #0078d4);
}

/* Ensure error messages are visible */
[data-theme="light"] .error-message {
    color: var(--color-error, #e53935); /* Use error color variable */
    text-shadow: none;
}
