/* Modern Authentication Pages Styling */

/* Base styles */
html, body {
  height: 100%;
  overflow-y: auto;
}

.login-page {
  /* Background is now set dynamically via JavaScript, but we provide a fallback */
  background: linear-gradient(135deg, rgb(13 110 253 / 0%) 0%, rgb(10 88 202 / 13%) 100%), url('../truckersignin.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  padding: 40px 0;
  overflow-y: auto;
}

.login-box {
  width: 500px;
  max-width: 90%;
  margin: 0 auto;
  margin-bottom: 40px;
}

.login-logo {
  margin-bottom: 25px;
  text-align: center;
}

.login-logo img {
  max-width: 150px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-logo a {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Card styling */
.login-box-body {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 30px;
  color: #343a40;
  transition: all 0.3s ease;
  overflow: visible;
  max-height: none;
  backdrop-filter: blur(5px);
}

.login-box-msg {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 25px;
  text-align: center;
  color: #212529;
}

/* Form elements */
.form-control {
  height: 45px;
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 10px 15px;
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-addon {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 0 8px 8px 0;
  color: #6c757d;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 8px;
  color: #495057;
}

.invalid-feedback {
  color: #dc3545;
  font-size: 14px;
  margin-top: 5px;
  display: block;
}

/* Buttons */
.btn {
  height: 45px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-block {
  width: 100%;
}

/* Links */
a {
  color: #0d6efd;
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

/* Auth Links */
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.auth-links a {
  display: inline-flex;
  align-items: center;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
}

.auth-links a i {
  margin-right: 5px;
  font-size: 16px;
}

.auth-links a:hover {
  color: #0d6efd;
  text-decoration: none;
}

.forgot-password {
  margin-right: 10px;
}

.register-link {
  margin-left: auto;
}

/* Password strength meter */
.kv-meter-container {
  margin-top: 10px;
}

.kv-scorebar-border {
  height: 6px;
  border-radius: 3px;
  background-color: #e9ecef;
  overflow: hidden;
}

/* OTP specific styles */
#otp {
  letter-spacing: 2px;
  font-size: 18px;
  text-align: center;
  height: 50px;
  font-weight: 600;
}

/* OTP page styling */
#resendOTPTimer {
  display: block;
  margin-top: 10px;
  color: #6c757d;
  font-size: 14px;
  text-align: center;
}

#resendOTPTime {
  font-weight: 600;
  color: #0d6efd;
}

.btn-block.btn-flat {
  border-radius: 8px;
  transition: all 0.2s ease;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-block.btn-flat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Improve the logout link */
.login-box-body a[onclick="logout()"] {
  display: inline-block;
  margin-top: 20px;
  color: #6c757d;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-box-body a[onclick="logout()"]:hover {
  color: #0d6efd;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .login-box {
    width: 100%;
    padding: 0 15px;
    margin-top: 20px;
  }

  .login-box-body {
    padding: 20px;
  }

  .login-page {
    padding: 20px 0;
    align-items: flex-start;
    background-position: center center;
  }

  .login-logo a {
    font-size: 20px;
  }
}

/* Animation for form elements */
.form-control, .btn {
  animation: fadeIn 0.5s ease-in-out;
}

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

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Custom checkbox container */
.checkbox-container {
  display: flex;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  align-items: flex-start;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #e9ecef;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 7px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.policy-text {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
  margin-left: 5px;
}

.policy-text a {
  color: #0d6efd;
  text-decoration: none;
}

.policy-text a:hover {
  text-decoration: underline;
}

.privacy-policy {
  margin-bottom: 20px;
}

/* Registration form specific */
textarea.form-control {
  min-height: 80px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
  padding-right: 40px;
}

/* Two-column form layout */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.form-col {
  flex: 0 0 50%;
  max-width: 50%;
  padding-right: 10px;
  padding-left: 10px;
}

.form-col-full {
  flex: 0 0 100%;
  max-width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}

/* Responsive adjustments for form columns */
@media (max-width: 576px) {
  .form-col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .login-box {
    width: 450px;
  }
}
