/* --- Global Reset & Background --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  /* This uses the 'background.jpg' file */
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center center;
  height: 100vh;
  color: #333;
}

/* --- Logo (Top Left) --- */
.site-logo {
  position: absolute;
  top: 30px;
  left: 40px;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Makes it readable */
}

/* --- Main Content Wrapper --- */
.main-content {
  display: flex;
  justify-content: center;
  align-items: center; /* Keeps it centered if it fits */
  width: 100%;

  /* FIX 1: Change fixed height to min-height to allow scrolling on small screens */
  min-height: 100vh;
  height: auto;
  padding: 40px 0; /* Adds breathing room at top and bottom */
}

/* --- Form Container --- */
.container {
  background-color: rgba(
    255,
    255,
    255,
    0.85
  ); /* Slightly less transparent for readability */
  padding: 30px; /* Reduced from 40px */
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 500px; /* Slightly wider to accommodate side-by-side inputs */
  width: 90%;

  /* FIX 2: Ensure the white box never goes off-screen vertically */
  max-height: 90vh;
  overflow-y: auto; /* Adds an internal scrollbar if the form is still too tall */
}

/* --- Form Group Spacing --- */
.form-group {
  margin-bottom: 12px; /* Reduced from 15px to save space */
  display: block;
}

/* --- NEW: Form Row for Side-by-Side Inputs --- */
.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1; /* Makes both inputs equal width */
}

/* Mobile Adjustment for Rows */
@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
/* --- Form Styles --- */
.auth-form h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.form-group {
  margin-bottom: 15px;
  /* Ensure form groups are blocks and take space */
  display: block;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  background-color: #f9f9f9;
}

.form-link {
  text-align: right;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.form-link a {
  color: #007bff;
  text-decoration: none;
}

.form-link a:hover {
  text-decoration: underline;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  background-color: #333; /* Dark color for primary action */
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-btn:hover {
  background-color: #007bff; /* Primary blue on hover */
}

/* --- Choice Buttons (Role Select) --- */
.choice-btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 15px 0;
  background-color: white;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.choice-btn:hover {
  background-color: #f8f8f8;
  border-color: #aaa;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- "or" text separator --- */
.or-text {
  text-align: center;
  color: #777;
  margin: 15px 0;
  font-weight: 600;
}

/* --- Bottom Link ("Don't have an account?") --- */
.switch-link {
  text-align: center;
  margin-top: 25px;
  font-size: 0.9rem;
  color: #555;
}

.switch-link a {
  color: #007bff; /* Standard blue link color */
  text-decoration: none;
  font-weight: 600;
}

.switch-link a:hover {
  text-decoration: underline;
}

/* --- Page Switching Logic --- */
.page {
  display: none; /* Hide all pages by default */
}

.page.active {
  display: block; /* Show only the active page */
}

/* --- Mobile Responsive --- */
@media (max-width: 480px) {
  .site-logo {
    font-size: 2rem;
    top: 20px;
    left: 20px;
  }
  .container {
    padding: 30px;
    max-width: 95%;
  }
  .choice-btn {
    padding: 12px;
  }
}

/* --- Profile Picture Upload Styles (From Previous Step) --- */

/* --- Truck/Profile Picture Upload Base Styles (Similar to AdminPage.css) --- */

.drop-area {
  /* Clear Visible Area */
  border: 2px dashed #007bff;
  padding: 30px 20px;
  background-color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center; /* Ensure text is centered */
}

.drop-area.dragover {
  background-color: #e9f7fe; /* Light blue background when dragging over */
}

.drop-area p {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* Style for the clickable "select a file" link (Highlighted) */
.drop-area span {
  color: #007bff; /* Primary blue for the link */
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline; /* Emphasize it's a link */
}

/* --- Profile Picture Upload Specific Styles (Circular) --- */

.image-upload-group {
  text-align: center;
  margin-bottom: 20px;
}

/* Center and size the profile drop area */
.profile-drop-area {
  max-width: 300px;
  margin: 0 auto;
}

/* Center the preview container and stack contents vertically */
#profilePreviewContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 300px;
  margin: 15px auto;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background-color: #fff;
}

/* Key style: Makes the image circular */
.profile-preview-img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%; /* Makes the image circular */
  border: 4px solid #007bff;
  display: block;
  margin: 0 auto 10px auto;
}

.clear-image-btn {
  padding: 5px 10px;
  margin-top: 5px;
  border: none;
  border-radius: 5px;
  background-color: #dc3545;
  color: white;
  cursor: pointer;
}

.upload-message {
  margin-top: 5px;
  font-size: 0.9rem;
  font-weight: 600;
}
/* --- Pop-up Modal CSS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-content.success {
  border-top: 5px solid #28a745;
}

.modal-content.error {
  border-top: 5px solid #dc3545;
}

.modal-header {
  font-size: 1.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.modal-body {
  margin-bottom: 20px;
  color: #555;
}

.modal-close-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.modal-close-btn:hover {
  background-color: #0056b3;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
