/**
 * Login Styles - BeatByte Authentication
 *
 * Includes both modal login and standalone login page styles
 *
 * Sources:
 * - CSS Flexbox: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout
 * - CSS Box Model: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model
 * - CSS object-fit: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
 * - CSS Positioning: https://developer.mozilla.org/en-US/docs/Web/CSS/position
 * - CSS Gradients: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient
 */

/* Standalone Login Page Styles */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a0033 0%, #0a0a0a 100%);
  margin: 0;
  padding: 20px;
}

.login-container {
  width: 420px;
  max-width: 100%;
  background: var(--panel);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--glow);
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 100%;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
}

.brand-container {
  text-align: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 18px;
}

.brand-link img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
}

.login-header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.login-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.login-form .label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 14px;
  border-radius: 8px;
  color: #eee;
  font-size: 14px;
  transition: all 0.2s;
  width: 100%;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent1);
  background: rgba(255,255,255,0.05);
}

.actions {
  margin-top: 20px;
}

.btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn.primary {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: white;
  box-shadow: 0 4px 16px rgba(168, 51, 231, 0.3);
}

.btn.primary:hover {
  box-shadow: 0 6px 24px rgba(168, 51, 231, 0.5);
  transform: translateY(-1px);
}

.helper {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
}

.helper p {
  margin: 0;
}

.helper a {
  color: var(--accent1);
  text-decoration: none;
}

.helper a:hover {
  text-decoration: underline;
}

/* Login Modal Styles */
#login-modal .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10100;
}

#login-modal .modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: calc(100% - 40px);
  background: #0a0a0a;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--glow), 0 8px 32px rgba(0,0,0,0.5);
  z-index: 10110;
  border: 1px solid rgba(255,255,255,0.08);
}

/* decorative accent strip */
#login-modal .modal-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 100%;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
}

#login-modal .modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  color: #ddd;
  font-size: 18px;
  cursor: pointer;
}

#login-modal .modal-header h2 { margin-bottom: 4px; font-size: 20px; }
#login-modal .modal-header .muted { color: var(--muted); font-size: 13px; }

.login-form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.login-form .label { font-size: 13px; color: var(--muted); }
.login-form input[type="email"], .login-form input[type="password"], .login-form input[type="text"] {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 12px;
  border-radius: 8px;
  color: #eee;
  width: 100%;
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent1);
  background: rgba(255,255,255,0.03);
}

.login-form input::placeholder {
  color: rgba(255,255,255,0.3);
}

/* Password toggle wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password .eye-icon {
  color: var(--muted, #9a9a9a);
  transition: color 0.2s;
}

.toggle-password:hover .eye-icon {
  color: var(--accent1, #7b2ff7);
}

.actions { display:flex; gap:10px; margin-top: 12px; }
.btn { padding: 10px 14px; border-radius: 8px; cursor: pointer; border: none; }
.btn.primary { background: linear-gradient(90deg,var(--accent1),var(--accent2)); color: white; box-shadow: var(--glow); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,0.04); }

.helper { margin-top: 10px; font-size: 13px; }
.helper a { color: var(--accent1); text-decoration: none; }

@media (max-width:480px){
  #login-modal .modal-panel { width: 95%; padding: 16px; }
}
