/* Styles for login modal and buttons */
#login-modal .login-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4,6,12,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 160ms ease;
}

#login-modal .login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(3,6,20,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  color: var(--text-color, #fff);
  border: 1px solid rgba(255,255,255,0.06);
  transform: translateY(-6px) scale(0.995);
  animation: popIn 200ms cubic-bezier(.2,.9,.2,1) forwards;
}

#login-modal h3 { margin: 0 0 10px 0; font-size: 1.05rem; color: var(--accent, #ff6b6b); }

.login-form label { display:block; font-weight:700; margin-bottom:6px; color:var(--settings-text-color); }
.login-form input[type="text"], .login-form input[type="password"] {
  width:100%; padding:10px 10px; border-radius:6px; border:1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.03); color:var(--text-color); outline: none; box-sizing: border-box;
}
.login-form input:focus { box-shadow: 0 4px 18px rgba(0,0,0,0.35); border-color: var(--accent); }

.login-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.login-actions button { padding:6px 10px; border-radius:6px; border:0; cursor:pointer; font-weight:700; }
.login-actions button[type="submit"] { background: var(--accent); color: #fff; }
.login-actions button#login-cancel { background: transparent; color: var(--settings-text-color); border:1px solid rgba(255,255,255,0.04); }

.login-error { margin-top:10px; color:#d32f2f; font-weight:700; }

@keyframes popIn { from { opacity:0; transform: translateY(-8px) scale(.98); } to { opacity:1; transform: translateY(0) scale(1); } }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

/* Make login button slightly more prominent */
.login-button { box-shadow: 0 4px 12px rgba(3,6,20,0.28); }

/* Email overdue button in settings */
.email-btn {
  background: linear-gradient(180deg, var(--accent), #4a79ff);
  color: #fff;
  border: none;
  padding: 0.45rem 0.8rem;
  border-radius: 0.6rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(74,121,255,0.18);
}
.email-btn:active { transform: scale(0.99); }
.email-result { color: var(--accent); font-weight:700; }

/* Show admin actions only when logged in */
.logged-in .settings-panel .admin-actions { display: flex !important; flex-direction: column; }
/* Also show admin actions globally when logged in (in case settings panel is closed) */
.logged-in .admin-actions { display: flex !important; flex-direction: column; }

/* Mobile responsiveness */
@media (max-width: 768px) {
  #login-modal .login-card {
    width: 90%;
    padding: 15px;
    margin: 1rem;
  }

  #login-modal h3 {
    font-size: 1rem;
  }

  .login-form label {
    font-size: 0.9rem;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    padding: 12px;
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 44px; /* Touch-friendly target */
  }

  .login-actions {
    flex-direction: column;
  }

  .login-actions button {
    width: 100%;
    padding: 12px;
    min-height: 44px;
    font-size: 16px;
  }

  .email-btn {
    width: 100%;
    padding: 0.6rem;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  #login-modal .login-card {
    width: 95%;
    padding: 12px;
    margin: 0.5rem;
  }

  .login-form input[type="text"],
  .login-form input[type="password"] {
    min-height: 48px; /* Extra space for very small screens */
  }

  .login-actions button {
    padding: 14px;
    min-height: 48px;
  }
}
