/* ============================================================
   SkillGrow – Login Modal (popup overlay)
   ============================================================ */

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: overlayFadeIn 0.2s ease;
}
.login-modal-overlay.open {
  display: flex;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.login-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.92) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Modal top accent bar */
.login-modal::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--gradient-green);
}

.modal-close-btn {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  width: 34px; height: 34px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
}
.modal-close-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.modal-inner { padding: 2rem; }

/* Logo in modal */
.modal-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.modal-logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient-green);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.modal-logo span { color: var(--green); }

/* Tabs */
.modal-tabs {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1.5rem;
}
.modal-tab-btn {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.modal-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Form panels */
.modal-panel { display: none; flex-direction: column; gap: 1rem; }
.modal-panel.active { display: flex; }

.modal-panel h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 0.15rem;
}
.modal-panel .subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* Input field with icon */
.modal-input-group { position: relative; }
.modal-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.modal-input {
  width: 100%;
  padding: 0.72rem 1rem 0.72rem 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}
.modal-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}
.modal-input::placeholder { color: var(--text-muted); }
.modal-input-pw { padding-right: 2.75rem; }

.modal-pw-toggle {
  position: absolute;
  right: 0.9rem;
  top: 50%; transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  transition: var(--transition);
}
.modal-pw-toggle:hover { color: var(--text-secondary); }

/* Row inputs */
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Role picker */
.modal-role-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.modal-role-opt { position: relative; }
.modal-role-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.modal-role-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.modal-role-label:hover { border-color: var(--green); }
.modal-role-opt input:checked + .modal-role-label {
  border-color: var(--green);
  background: var(--green-light);
}
.modal-role-emoji { font-size: 1.3rem; }
.modal-role-text { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.modal-role-opt input:checked + .modal-role-label .modal-role-text { color: var(--green); }

/* Alert messages */
.modal-alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  display: none;
}
.modal-alert.show { display: block; }
.modal-alert.error {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ffffff;
}
.modal-alert.success {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-primary);
}
.modal-alert ul { margin: 0.2rem 0 0 1rem; }
.modal-alert li { margin-top: 0.2rem; }

/* Submit button */
.modal-submit {
  width: 100%;
  padding: 0.8rem;
  background: var(--gradient-green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.modal-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}
.modal-submit:active { transform: translateY(0); }
.modal-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Forgot password */
.modal-forgot {
  text-align: right;
  font-size: 0.8rem;
}
.modal-forgot a { color: var(--green); }
.modal-forgot a:hover { text-decoration: underline; }

/* Terms */
.modal-terms {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
.modal-terms a { color: var(--green); }
