/* Login Page Styles - Mobile First */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  text-align: right;
  background-color: #fff;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
}

.login-container {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh; /* Dynamic viewport height */
}

/* Top Header - White Background */
.header {
  background-color: #fff;
  padding: 15px 20px; /* Reduced padding for mobile */
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.logo-image {
  width: 100px; /* Smaller on mobile */
  height: auto;
  max-width: 100%;
  display: block;
}

/* Middle Section - Green Background with Image */
.hero-section {
  background: linear-gradient(rgba(32, 156, 98, 0.9), rgba(32, 156, 98, 0.9)), 
              url('../data/coffeecup.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 30px 15px; /* Reduced padding for mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px; /* Minimum height - matching logged-in page */
  max-height: 180px; /* Maximum height - matching logged-in page */
}

.hero-title {
  color: white;
  font-size: 24px; /* Smaller on mobile */
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
}

/* Bottom Section - Login Form */
.login-section {
  background-color: #fff;
  padding: 35px 20px 30px; /* Increased top padding for better vertical centering */
  flex-shrink: 0;
}

.instruction-text {
  color: #333;
  font-size: 17px; /* Increased size for better readability */
  line-height: 1.7;
  margin-bottom: 18px;
}

.instruction-text:last-of-type {
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px; /* Reduced margin */
}

.input-field {
  width: 100%;
  padding: 12px; /* Reduced padding */
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px; /* Smaller on mobile */
  direction: rtl;
  text-align: right;
  background-color: #f5f5f5; /* Light gray background to make it pop */
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: #209c62;
  box-shadow: 0 0 0 2px rgba(32, 156, 98, 0.1);
  background-color: #f5f5f5; /* Keep gray background when focused */
}

.input-field::placeholder {
  color: #999;
  font-size: 13px; /* Smaller on mobile */
}

.login-button {
  width: 100%;
  padding: 12px 24px;
  background-color: #209c62;
  color: white;
  border: none;
  border-radius: 25px;
  font-family: "Rubik", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-button:hover {
  background-color: #1a8a55;
}

.login-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px; /* Reduced padding */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #209c62;
}

.toast.error {
  border-left: 4px solid #e74c3c;
}

.toast-message {
  color: #333;
  font-size: 13px; /* Smaller on mobile */
  text-align: center;
}

/* Loading State */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design - Mobile First */
@media (min-width: 768px) {
  .login-container {
    max-width: 400px;
    margin: 0 auto;
    min-height: 100dvh;
  }
  
  .header {
    padding: 20px; /* Larger padding on desktop */
  }
  
  .logo-image {
    width: 120px; /* Larger on desktop */
  }
  
  .hero-section {
    padding: 40px 20px; /* Larger padding on desktop */
    min-height: 150px; /* Matching logged-in page */
    max-height: 220px; /* Matching logged-in page */
  }
  
  .hero-title {
    font-size: 28px; /* Larger on desktop */
  }
  
  .login-section {
    padding: 40px 30px 35px; /* Increased padding on desktop for better vertical centering */
  }
  
  .instruction-text {
    font-size: 19px; /* Larger on desktop for better readability */
    margin-bottom: 22px;
  }
  
  .instruction-text:last-of-type {
    margin-bottom: 32px;
  }
  
  .form-group {
    margin-bottom: 25px;
  }
  
  .input-field {
    padding: 15px; /* Larger padding on desktop */
    font-size: 16px;
  }
  
  .input-field::placeholder {
    font-size: 14px;
  }
  
  .login-button {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 25px;
  }
  
  .toast {
    padding: 15px; /* Larger padding on desktop */
    max-width: 300px;
  }
  
  .toast-message {
    font-size: 14px;
  }
}

@media (min-width: 1024px) {
  .login-container {
    max-width: 450px;
  }
  
  .hero-section {
    padding: 50px 20px; /* Matching logged-in page */
    min-height: 180px; /* Matching logged-in page */
    max-height: 250px; /* Matching logged-in page */
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .instruction-text {
    font-size: 21px; /* Even larger on large desktop for better readability */
    margin-bottom: 24px;
  }
  
  .instruction-text:last-of-type {
    margin-bottom: 35px;
  }
  
  .login-section {
    padding: 45px 35px 40px; /* Even more padding on large desktop */
  }
}
