/* ================== */
/* Form Element Styles*/
/* ================== */

/* Input Group Wrapper */
.input-group {
  position: relative; 
  margin-bottom: 1.25rem; /* Slightly reduced default spacing */
}

/* Form Label */
.form-label {
  display: block; 
  margin-bottom: 0.6rem; /* Space between label and input */
  font-weight: 500; /* Medium weight for labels */
  color: var(--text-color);
  font-size: 0.9rem; /* Corresponds to .labelLarge or .bodyMedium */
  transition: color 0.3s ease;
}

/* General Form Input Styling (applies to input, textarea, select) */
.form-input,
.form-control { /* .form-control is often used with Bootstrap-like structures */
  width: 100%;
  padding: 0.85rem 1.1rem; /* Adjusted padding for a modern feel */
  border: 1px solid var(--border-color);
  border-radius: 8px; /* Softer corners */
  font-size: 0.95rem; /* Slightly larger input text */
  font-family: inherit; 
  line-height: 1.5; 
  transition: border-color 0.25s ease-out, box-shadow 0.25s ease-out, background-color 0.25s ease-out;
  background-color: var(--card-background); /* Inputs often on card-like backgrounds or should match them */
  color: var(--text-color);
  appearance: none; /* Remove default styling for select, etc. */
}
/* Ensure dark mode inputs have appropriate background */
.dark-mode .form-input,
.dark-mode .form-control {
    background-color: var(--background-color); /* Darker background for inputs in dark mode */
    border-color: var(--border-color); /* Ensure border is dark mode compatible */
}


/* Placeholder Text Styling */
.form-input::placeholder,
.form-control::placeholder {
  color: var(--text-light);
  opacity: 0.7; /* Make placeholder slightly more subtle */
}

/* Focus State for Inputs */
.form-input:focus,
.form-control:focus {
  border-color: var(--primary-color);
  background-color: var(--card-background); /* Ensure background remains consistent on focus */
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2); 
  outline: none; 
}
.dark-mode .form-input:focus,
.dark-mode .form-control:focus {
    background-color: var(--background-color); /* Consistent with dark mode input bg */
}


/* Style for <textarea> specifically */
textarea.form-input,
textarea.form-control {
    resize: vertical; 
    min-height: 120px; /* Increased min height */
    padding-top: 0.85rem; /* Ensure consistent top padding */
}

/* Style for <select> specifically */
select.form-input,
select.form-control {
    padding-right: 3rem; /* Make space for custom arrow */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23576574' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); /* Default (light mode) arrow color adjusted */
    background-repeat: no-repeat;
    background-position: right 0.85rem center; /* Adjusted position */
    background-size: 14px 10px; /* Slightly smaller arrow */
}
/* Dark mode select arrow */
.dark-mode select.form-input,
.dark-mode select.form-control {
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23909399' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); /* Light arrow for dark mode */
}
/* Remove default arrow for Firefox specifically on select */
select.form-input:-moz-focusring,
select.form-control:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 var(--text-color);
}
select.form-input::-ms-expand, /* For IE/Edge */
select.form-control::-ms-expand {
    display: none;
}


/* Input with Prefix Icon/Text */
.input-prefix-container { /* Optional wrapper if needed for complex prefix/suffix */
    position: relative;
}
.input-prefix { /* The icon or text itself */
  position: absolute;
  left: 1.1rem; /* Match input padding */
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none; 
  line-height: 1; 
  font-size: 1.1em; /* Slightly larger prefix icon */
  opacity: 0.7;
}

/* Adjust input padding when using a prefix */
.input-with-prefix {
  padding-left: 3rem; /* Make more space for the prefix icon + some breathing room */
}


/* --- Styles for Login/Signup page forms (from login.html structure) --- */
.login-container { /* Main wrapper on login page */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align card to top if page is scrollable */
    min-height: calc(100vh - 120px); /* Adjust based on header/footer height if they are present */
    padding: 2rem 1rem;
    background-color: var(--background-color); /* Ensure page bg */
}

.login-card { /* The card holding the form */
    background-color: var(--card-background);
    padding: 2rem 2.5rem; /* Generous padding */
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px; /* Max width for the login card */
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-header h1 { /* FitQuest title */
    font-size: 2rem; /* Adjust as needed */
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.login-header p { /* Subtitle */
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0;
}

.login-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}
.login-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px; /* Overlap main border */
    font-size: 1rem;
}
.login-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.login-form, .signup-form {
    display: none; /* Controlled by JS or .active class */
}
.login-form.active, .signup-form.active {
    display: block;
    animation: formFadeIn 0.4s ease-out;
}
@keyframes formFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


.form-group { /* Wrapper for label + input in login forms */
    margin-bottom: 1.25rem;
}
.form-group label { /* Using .form-label styles */
    /* font-size: 0.85rem; */ /* Already styled by .form-label */
}
.form-group .form-control { /* Using .form-input styles */
    /* Styles from .form-input apply */
}

.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
    color: var(--secondary-color);
}

.submit-button { /* Primary button for form submission */
    width: 100%;
    padding: 0.9rem 1.5rem; /* Specific padding for these buttons */
    font-size: 1rem;
    /* Inherits from .primary-button if that class is also applied */
    /* Otherwise, style as a primary button here: */
    background-color: var(--primary-button-bg);
    color: white;
    border: none;
    border-radius: 8px; /* Match input radius */
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.submit-button:hover {
    background-color: var(--primary-button-bg-hover);
    transform: translateY(-2px);
}
.submit-button:active {
    transform: translateY(0);
}


.or-divider {
    text-align: center;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.social-login {
    /* Container for social login buttons, e.g., Google button */
    /* .google-button styles in buttons.css will apply */
}

.back-home { /* Link to go back to homepage */
    display: inline-block; /* Or block with text-align:center on parent */
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}
.back-home i {
    margin-right: 0.3rem;
}
.back-home:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Error and Success Messages for forms */
.error-message, .success-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: left; /* Usually better for messages */
    display: none; /* Hidden by default, shown by JS */
}
.error-message {
    background-color: rgba(231, 76, 60, 0.1); /* Light Red from alert styles */
    color: #922B21; /* Dark Red from alert styles */
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.success-message {
    background-color: rgba(39, 174, 96, 0.1); /* Light Green */
    color: #007A4E; /* Dark Green */
    border: 1px solid rgba(39, 174, 96, 0.3);
}


/* Validation state examples (uncomment and customize if needed) */
/*
.form-input.is-invalid,
.form-control.is-invalid {
    border-color: #e74c3c; // Example danger color
}
.form-input.is-invalid:focus,
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}
.invalid-feedback { // Message displayed below invalid input
    display: block;
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
*/