/* Enhanced Login Styling for Muranga County IT Support Portal - Green, Gold and White Theme */

:root {
  --primary-color: #1e8449; /* Deep Green */
  --secondary-color: #d4af37; /* Gold */
  --light-color: #ffffff; /* White */
  --dark-green: #145a32; /* Darker Green for contrast */
  --light-green: #2ecc71; /* Light Green */
  --gold-highlight: #f1c40f; /* Brighter Gold for highlights */
  --light-gray: #f8f9fa; /* Light Gray for subtle backgrounds */
  --text-dark: #333333; /* Dark text color */
}

body {
  /* Animated background with three colors */
  background: linear-gradient(-45deg, var(--primary-color), var(--secondary-color), var(--light-color)) !important;
  background-size: 400% 400% !important;
  animation: gradientBackground 15s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

@keyframes gradientBackground {
  0% {
      background-position: 0% 50%;
  }
  50% {
      background-position: 100% 50%;
  }
  100% {
      background-position: 0% 50%;
  }
}

.login-container {
  animation: fadeIn 0.5s ease;
  /* Increase container width */
  width: 450px !important;
  max-width: 90% !important;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.login-header {
  background: linear-gradient(135deg, var(--primary-color), var(--dark-green));
  padding: 2.5rem 1.5rem; /* Increased padding for larger header */
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--secondary-color);
}

.login-header h4 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  color: var(--light-color);
  font-size: 1.5rem; /* Increased font size */
}

.login-header p {
  opacity: 0.9;
  position: relative;
  z-index: 1;
  color: var(--light-color);
  font-size: 1.1rem; /* Increased font size */
}

.login-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    rgba(212, 175, 55, 0.1),
    rgba(212, 175, 55, 0.1) 10px,
    transparent 10px,
    transparent 20px
  );
  animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.login-body {
  padding: 2.5rem; /* Increased padding */
  background-color: var(--light-color);
}

.form-control {
  border-radius: 8px;
  padding: 0.85rem 1rem; /* Increased padding */
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  font-size: 1.05rem; /* Slightly larger text */
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(30, 132, 73, 0.2);
  border-color: var(--primary-color);
}

.form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 1.1rem; /* Increased font size */
}

.login-btn {
  padding: 0.85rem 1.5rem; /* Increased padding */
  font-weight: 600;
  border-radius: 8px;
  background: var(--primary-color);
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  color: var(--light-color);
  font-size: 1.1rem; /* Increased font size */
}

.login-btn:hover {
  background: var(--dark-green);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(30, 132, 73, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

/* Gold accent on button */
.login-btn::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--secondary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: right;
}

.login-btn:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.login-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.login-btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
      transform: scale(0, 0);
      opacity: 0.5;
  }
  100% {
      transform: scale(200, 200);
      opacity: 0;
  }
}

.login-footer {
  background-color: var(--light-gray);
  border-top: 1px solid #eee;
  padding: 1rem;
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.login-footer a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.alert {
  border-radius: 8px;
  border-left: 4px solid;
}

.alert-danger {
  border-left-color: #e74c3c;
}

.alert-info {
  border-left-color: var(--primary-color);
}

.county-logo {
  max-width: 80px;
  margin-bottom: 1rem;
}

.input-group-text {
  background-color: var(--light-gray);
  border-right: none;
  color: var(--primary-color);
}

.password-field {
  border-left: none;
}

.toggle-password {
  cursor: pointer;
  color: var(--primary-color);
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: var(--secondary-color);
}

/* Gold accent on input focus */
.input-group:focus-within .input-group-text {
  border-color: var(--secondary-color);
}

/* Gold shine animation for header */
.gold-accent {
  display: inline-block;
  position: relative;
  color: var(--light-color);
}

.gold-accent::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.4),
    transparent
  );
  animation: goldShine 3s infinite;
}

@keyframes goldShine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

/* County title text on right side */
.county-title-container {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  z-index: 10;
}

.county-title {
  font-size: 3.5rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--light-color);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  animation: fadeInRight 1s ease-out, textGlow 3s infinite alternate;
}

.county-subtitle {
  font-size: 2rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: fadeInRight 1s ease-out 0.3s both, goldPulse 2s infinite alternate;
}

@keyframes fadeInRight {
  from {
      opacity: 0;
      transform: translateX(50px);
  }
  to {
      opacity: 1;
      transform: translateX(0);
  }
}

@keyframes textGlow {
  from {
      text-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
  }
  to {
      text-shadow: 0 0 20px rgba(46, 204, 113, 0.8), 0 0 40px rgba(46, 204, 113, 0.4);
  }
}

@keyframes goldPulse {
  from {
      color: var(--secondary-color);
  }
  to {
      color: var(--gold-highlight);
  }
}

/* Responsiveness */
@media (max-width: 1200px) {
  .county-title {
      font-size: 2.5rem;
  }
  .county-subtitle {
      font-size: 1.5rem;
  }
}

@media (max-width: 992px) {
  .county-title-container {
      display: none; /* Hide on smaller screens */
  }
}

@media (max-width: 768px) {
  .login-body {
      padding: 1.5rem;
  }
}