/* auth-form.css */

/* Unified container for all auth pages (replaces .auth-container and .card.shadow-sm structure) */
.auth-card-container {
    max-width: 600px; /* Slightly narrower for a more focused feel */
    margin: 3rem auto; /* More generous top/bottom margin */
    padding: 2.5rem; /* Generous internal padding */
    background-color: var(--clr-highlight-background, #ffffff);
    border: 1px solid var(--clr-border, #e0e0e0);
    border-radius: 1rem; /* Consistent large border-radius */
    box-shadow: 0 10px 30px rgba(0,0,0,0.12); /* Slightly more pronounced shadow for depth */
    text-align: center; /* Center text for titles and general info */
    position: relative; /* For potential future absolute positioning */
    overflow: hidden; /* Ensures shadow/borders are contained */
}

.auth-card-container h2,
.auth-card-container .card-title { /* Harmonize titles */
    color: var(--clr-main-text, #333333);
    font-size: 2rem; /* Adjusted for impact */
    font-weight: 700;
    margin-bottom: 2rem; /* More space below titles */
}

.auth-card-container p {
    color: var(--clr-secondary-text, #666666);
    line-height: 1.5;
    margin-bottom: 1.5rem; /* Consistent spacing */
}

/* Form group and control styling (now primarily in style.css) */
/* Specific overrides for auth-form if needed, but generally use global .form-group and .form-control */
.form-group,
.mb-3 {
    text-align: left; /* Align labels and inputs to the left within the card */
}

/* Password input wrapper for eye icon */
.password-input-wrapper {
    position: relative;
    display: flex; /* Use flex to align input and icon */
    align-items: center;
}

.password-input-wrapper .form-control.is-invalid {
    background-image: none !important;
    padding-right: 0.75rem !important; /* Adjust padding to prevent text from being too close to the eye icon */
}

.password-input-wrapper input {
    padding-right: 3rem; /* Make space for the eye icon */
}

.password-input-wrapper .toggle-password {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: var(--clr-secondary-text, #6c757d); /* Icon color */
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.password-input-wrapper .toggle-password:hover {
    color: var(--clr-primary-accent, #007bff); /* Hover effect for icon */
}

.d-grid.gap-2 { /* Ensure consistent spacing for button groups */
    margin-top: 1.5rem;
}

/* Checkbox (Remember me) */
.form-check {
    display: flex;
    align-items: center;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* ADDED: Allows items to wrap to the next line */
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
    border-radius: 0.25em;
    color: var(--clr-main-text, #333333);
}

.form-check-label {
    margin-bottom: 0;
    font-weight: 400;
    color: var(--clr-main-text, #333333) !important;
}

.form-check .invalid-feedback {
    /* Ensure it behaves as a block within the flex context and forces a wrap */
    flex-basis: 100%; /* Forces the error message to take up 100% width, pushing it to a new line */
    margin-top: 0.25rem; /* Add some space above the message */
    /* No need for display: block here, as flex-basis handles its layout within the flex container */
}

/* Alert messages (Thymeleaf conditional rendering) */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem; /* Consistent with other elements */
    font-size: 0.95rem;
    text-align: center;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Validation error messages (for specific fields) */
.invalid-feedback,
.error-message {
    display: block; /* Ensure it's always on a new line */
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--clr-danger, #dc3545);
    text-align: left; /* Align error message with input */
}

.is-invalid {
    border-color: var(--clr-danger, #dc3545) !important;
    padding-right: calc(1.5em + 0.75rem) !important; /* Adjust for potential icon space */
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

.form-check-input.is-invalid {
    padding-right: 0.75rem !important; /* Reset padding to a standard value */
    background-image: none !important; /* Remove the validation icon */
    background-size: 0 !important; /* Ensure no background image is rendered */
}

/* Links at the bottom of the card */
.mt-3.text-center p,
.card-body .mt-3.text-center p {
    margin-bottom: 0.75rem; /* Tighter spacing for bottom links */
}

.auth-card-container p a,
.card-body p a { /* Inherits from general link styling, ensure consistency */
    font-weight: 600; /* Slightly bolder for navigation links */
}


/* Responsive adjustments specific to auth-form.css */
@media (max-width: 768px) {
    .auth-card-container {
        padding: 1.5rem;
        margin: 2rem auto;
        max-width: 90%; /* Allow container to be wider on smaller screens */
    }
    .auth-card-container h2,
    .auth-card-container .card-title { font-size: 1.8rem; }
    /* .btn, .btn-primary, .btn-lg responsiveness handled by style.css */

    .form-check {
        flex-wrap: nowrap;
    }
}


@media (max-width: 480px) {
    .auth-card-container {
        padding: 1rem;
        margin: 1rem auto;
        border-radius: 0.75rem;
        box-shadow: none; /* Reduce shadow on very small screens for cleaner look */
        border: none; /* Remove border on very small screens, let background define area */
    }
    .auth-card-container h2,
    .auth-card-container .card-title { font-size: 1.6rem; margin-bottom: 1.5rem; }
    /* .btn, .btn-primary, .btn-lg responsiveness handled by style.css */
}