/* =========================================
   DARK GRID THEME - LOGIN CSS
   ========================================= */

/* 1. IMPORT INTER FONT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Theme Variables */
  --bg: #09090b;
  --card: #18181b;
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  
  --primary: #6366f1;         /* Indigo Accent */
  --primary-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.5);
  
  --border: #27272a;
  --error: #ef4444;
  --success: #22c55e;

  --radius: 12px;
  --transition: all 0.2s ease;
  --shadow: 0 4px 30px rgba(0,0,0,0.5);
}

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  
  /* The Grid Pattern Background */
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary);
}

/* NAVBAR (Matches new theme) */
header.navbar {
  background: rgba(9,9,11,0.85);
  backdrop-filter: blur(10px);
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-weight: 800;
  font-size: 18px;
  color: var(--text-main);
  text-decoration: none;
}
.logo i { color: var(--text-main); margin-right: 8px; }

/* MAIN LAYOUT */
main {
  padding-top: 120px; /* Space for fixed header */
  padding-bottom: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* LOGIN CARD */
.login-container {
  background: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 450px;
}

/* HEADERS */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}
.login-header h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* SOCIAL BUTTONS */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px; /* Slightly smaller radius for inputs/btns */
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.social-btn:hover {
  color: var(--text-main);
  border-color: var(--text-main);
  background: rgba(255,255,255,0.02);
}

/* DIVIDER */
.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { margin: 0 10px; } /* Assuming you have text inside divider */
/* If divider is just text, use this fallback: */
.divider { text-align: center; } 

/* FORMS & INPUTS */
.form-group { margin-bottom: 20px; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.input-with-icon { position: relative; }

.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none; /* Prevent clicking icon instead of input */
}

/* Password Toggle Icon Specifics */
.input-with-icon .password-toggle {
  left: auto;
  right: 14px;
  cursor: pointer;
  pointer-events: auto;
}

input {
  width: 100%;
  padding: 12px 14px 12px 40px; /* Left padding for icon */
  background: #09090b; /* Darker than card */
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* BUTTONS */
.btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* UTILITIES */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.remember-forgot a:hover {
  color: var(--primary);
  text-decoration: none;
}

.signup-link {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.signup-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.signup-link a:hover { text-decoration: underline; }

.error-message {
  color: var(--error);
  font-size: 12px;
  margin-top: 6px;
  display: none; /* JS toggles this */
}

/* POPUP (Keeping existing structure) */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); display: none;
  justify-content: center; align-items: center; z-index: 1000;
}
.popup-content {
  background: var(--card); padding: 30px;
  border-radius: 12px; border: 1px solid var(--border);
  max-width: 400px; width: 90%; text-align: center;
}
.popup-header i { font-size: 2rem; color: var(--error); margin-bottom: 15px; }
.popup-content p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
#closePopupBtn { width: auto; min-width: 100px; margin: 0 auto; }