/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
  --primary: #2e7d32;
  --primary-dark: #1b5e20;
  --primary-light: #a5d6a7;
  --accent: #66bb6a;
  --text-muted: #6c757d;
  --card-bg: rgba(255, 255, 255, 0.96);
  --input-border: #ced4da;
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.18);
  --transition: 0.3s ease;
  --border-radius: 1rem;
  --font: 'Prompt', sans-serif;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 40%, #388e3c 70%, #43a047 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

/* ==========================================================================
   3. PAGE LAYOUT
   ========================================================================== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.login-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ==========================================================================
   4. NAVBAR (manubar_index)
   ========================================================================== */
header .navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   5. LOGIN CARD
   ========================================================================== */
.login-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.5s ease both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   6. CARD HEADER
   ========================================================================== */
.login-logo {
  display: block;
  margin: 0 auto 1rem;
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* ==========================================================================
   7. FORM INPUTS
   ========================================================================== */
.input-group-icon {
  position: relative;
  margin-bottom: 1rem;
}

.input-group-icon .field-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.input-group-icon input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1.5px solid var(--input-border);
  border-radius: 0.6rem;
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fafafa;
}

.input-group-icon input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
  background: #fff;
}

.input-group-icon input::placeholder {
  color: #adb5bd;
}

/* ==========================================================================
   8. SUBMIT BUTTON
   ========================================================================== */
.btn-login {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 0.6rem;
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
}

.btn-login:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), #0a3d0a);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 94, 32, 0.35);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   9. PROGRESS BAR
   ========================================================================== */
#progress-loading {
  display: none;
  margin: 0.75rem 0;
}

#progress-loading .progress {
  border-radius: 0.5rem;
  height: 0.5rem;
  background: var(--primary-light);
}

#progress-loading .progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 0.5rem;
  width: 100%;
}

/* ==========================================================================
   10. BOTTOM AREA
   ========================================================================== */
.login-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e9ecef;
}

#count_user {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: #f8f9fa;
  width: auto;
  min-width: 200px;
}

.download-link {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition);
}

.download-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
footer #formFooter {
  font-size: 0.8rem !important;
  padding: 10px 15px !important;
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  /* Compact Header for Login Page */
  .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  /* Hide Map and simplify footer on mobile login */
  footer #formFooter .col-md-4,
  footer #formFooter .col-md-3 {
    display: none;
  }

  footer #formFooter {
    padding: 15px 10px !important;
  }

  footer #formFooter .col-md-5 {
    text-align: center;
    margin-bottom: 0 !important;
  }

  .login-area {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 0.75rem;
  }

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

  .login-logo {
    width: 60px;
    height: 60px;
  }
}
